ROHC compression/decompression library
Functions
rohc_decomp_rfc3095.c File Reference

Generic framework for RFC3095-based decompression profiles such as IP-only, UDP, UDP-Lite, ESP, and RTP profiles. More...

#include "rohc_decomp_rfc3095.h"
#include "rohc_traces_internal.h"
#include "rohc_time_internal.h"
#include "rohc_debug.h"
#include "rohc_packets.h"
#include "rohc_utils.h"
#include "rohc_bit_ops.h"
#include "rohc_decomp_internals.h"
#include "rohc_decomp_detect_packet.h"
#include "schemes/decomp_wlsb.h"
#include "schemes/decomp_list_ipv6.h"
#include "sdvl.h"
#include "crc.h"
#include "config.h"
#include <string.h>
#include <assert.h>
Include dependency graph for rohc_decomp_rfc3095.c:

Functions

static int parse_static_part_ip (const struct rohc_decomp_ctxt *const context, const uint8_t *const packet, const size_t length, struct rohc_extr_ip_bits *const bits)
 Parse the IP static part of a ROHC packet. More...
 
static int parse_static_part_ipv4 (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_ip_bits *const bits)
 Parse the IPv4 static part of a ROHC packet. More...
 
static int parse_static_part_ipv6 (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_ip_bits *const bits)
 Parse the IPv6 static part of a ROHC packet. More...
 
static int parse_dynamic_part_ip (const struct rohc_decomp_ctxt *const context, const uint8_t *const packet, const size_t length, struct rohc_extr_ip_bits *const bits, struct list_decomp *const list_decomp)
 Parse the IP dynamic part of a ROHC packet. More...
 
static int parse_dynamic_part_ipv4 (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_ip_bits *const bits)
 Decode the IPv4 dynamic part of a ROHC packet. More...
 
static int parse_dynamic_part_ipv6 (const struct rohc_decomp_ctxt *const context, const uint8_t *packet, const size_t length, struct rohc_extr_ip_bits *const bits, struct list_decomp *const list_decomp)
 Decode the IPv6 dynamic part of a ROHC packet. More...
 
static bool parse_ir (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one IR packet. More...
 
static bool parse_irdyn (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one IR-DYN packet. More...
 
static bool parse_uo0 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UO-0 header. More...
 
static bool parse_uo1 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UO-1 header for non-RTP profiles. More...
 
static bool parse_uo1rtp (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UO-1 header for RTP profile. More...
 
static bool parse_uo1id (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UO-1-ID header for RTP profiles. More...
 
static bool parse_uo1ts (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UO-1-TS header for RTP profiles. More...
 
static bool parse_uor2 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UOR-2 header for non-RTP profiles. More...
 
static bool parse_uor2rtp (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UOR-2 header for RTP profile (in 2 passes if needed) More...
 
static bool parse_uor2rtp_once (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, const rohc_packet_t packet_type, uint8_t outer_rnd, uint8_t inner_rnd, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse)
 Parse one UOR-2-RTP header for RTP profile. More...
 
static bool parse_uor2id (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UOR-2-ID header for RTP profile (in 2 passes if needed) More...
 
static bool parse_uor2id_once (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, const rohc_packet_t packet_type, uint8_t outer_rnd, uint8_t inner_rnd, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse)
 Parse one UOR-2-ID header for RTP profile. More...
 
static bool parse_uor2ts (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one UOR-2-TS header for RTP profile (in 2 passes if needed) More...
 
static bool parse_uor2ts_once (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, const rohc_packet_t packet_type, uint8_t outer_rnd, uint8_t inner_rnd, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse)
 Parse one UOR-2-TS header for RTP profile. More...
 
static bool parse_uo_remainder (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse the remainder of the UO* header. More...
 
static uint8_t parse_extension_type (const uint8_t *const rohc_ext)
 Find out which extension is carried by the UOR-2 packet. More...
 
static int parse_extension0 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, const rohc_packet_t packet_type, const ip_header_pos_t innermost_ip_hdr, struct rohc_extr_bits *const bits)
 Parse the extension 0 of the UO-1-ID or UOR-2* packet. More...
 
static int parse_extension1 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, const rohc_packet_t packet_type, const ip_header_pos_t innermost_ip_hdr, struct rohc_extr_bits *const bits)
 Parse the extension 1 of the UO-1-ID or UOR-2* packet. More...
 
static int parse_extension2 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, const rohc_packet_t packet_type, const ip_header_pos_t innermost_ip_hdr, struct rohc_extr_bits *const bits)
 Parse the extension 2 of the UO-1-ID or UOR-2* packet. More...
 
static bool build_uncomp_ip (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, uint8_t *const dest, const size_t uncomp_hdrs_max_len, size_t *const uncomp_hdrs_len, const size_t payload_size, const struct list_decomp *const list_decomp)
 Build an uncompressed IP header. More...
 
static bool build_uncomp_ipv4 (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, uint8_t *const dest, const size_t uncomp_hdrs_max_len, size_t *const uncomp_hdrs_len, const size_t payload_size)
 Build an uncompressed IPv4 header. More...
 
static bool build_uncomp_ipv6 (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, uint8_t *const dest, const size_t uncomp_hdrs_max_len, size_t *const uncomp_hdrs_len, const size_t payload_size, const struct list_decomp *const list_decomp)
 Build an uncompressed IPv6 header. More...
 
static bool decode_ip_values_from_bits (const struct rohc_decomp_ctxt *const context, const struct rohc_decomp_rfc3095_changes *const ctxt, const struct ip_id_offset_decode *const ip_id_decode, const uint32_t decoded_sn, const rohc_lsb_ref_t lsb_ref_type, const struct rohc_extr_ip_bits *const bits, const char *const descr, const size_t ip_hdr_pos, struct rohc_decoded_ip_values *const decoded)
 Decode IP values from extracted bits. More...
 
static bool check_uncomp_crc (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const uint8_t *const outer_ip_hdr, const uint8_t *const inner_ip_hdr, const uint8_t *const next_header, const rohc_crc_type_t crc_type, const uint8_t crc_packet)
 Check whether the CRC on uncompressed header is correct or not. More...
 
static bool is_sn_wraparound (const struct rohc_ts cur_arrival_time, const struct rohc_ts arrival_times[ROHC_MAX_ARRIVAL_TIMES], const size_t arrival_times_nr, const size_t arrival_times_index, const size_t k, const rohc_lsb_shift_t p)
 Is SN wraparound possible? More...
 
static void reset_extr_bits (const struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, struct rohc_extr_bits *const bits)
 Reset the extracted bits for next parsing. More...
 
bool rohc_decomp_rfc3095_create (const struct rohc_decomp_ctxt *const context, struct rohc_decomp_rfc3095_ctxt **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv, const int profile_id)
 Create the RFC3095 volatile and persistent parts of the context. More...
 
void rohc_decomp_rfc3095_destroy (struct rohc_decomp_rfc3095_ctxt *const rfc3095_ctxt, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy the context. More...
 
bool rfc3095_decomp_parse_pkt (const struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet. More...
 
uint32_t rohc_decomp_rfc3095_get_sn (const struct rohc_decomp_ctxt *const context)
 Get the reference SN value of the context. More...
 
rohc_status_t rfc3095_decomp_build_hdrs (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decomp_crc *const extr_crc, const struct rohc_decoded_values *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
 Build the uncompressed headers. More...
 
bool rfc3095_decomp_attempt_repair (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const struct rohc_ts pkt_arrival_time, struct rohc_decomp_crc_corr_ctxt *const crc_corr, struct rohc_extr_bits *const extr_bits)
 Attempt a packet/context repair upon CRC failure. More...
 
bool rfc3095_decomp_decode_bits (const struct rohc_decomp_ctxt *const context, const struct rohc_extr_bits *const bits, const size_t payload_len, struct rohc_decoded_values *const decoded)
 Decode values from extracted bits. More...
 
void rfc3095_decomp_update_ctxt (struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values *const decoded, const size_t payload_len, bool *const do_change_mode)
 Update context with decoded values. More...
 

Detailed Description

Generic framework for RFC3095-based decompression profiles such as IP-only, UDP, UDP-Lite, ESP, and RTP profiles.

Author
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org
David Moreau from TAS

Function Documentation

◆ build_uncomp_ip()

static bool build_uncomp_ip ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_decoded_ip_values  decoded,
uint8_t *const  dest,
const size_t  uncomp_hdrs_max_len,
size_t *const  uncomp_hdrs_len,
const size_t  payload_size,
const struct list_decomp *const  list_decomp 
)
static

Build an uncompressed IP header.

Parameters
contextThe decompression context
decodedThe decoded IPv4 fields
destThe buffer to store the IP header
uncomp_hdrs_max_lenThe max length of the IP header
[out]uncomp_hdrs_lenThe length of the IPv4 header
payload_sizeThe length of the IP payload
list_decompThe list decompressor (IPv6 only)
Returns
true if the IP header is successfully built, false if an error occurs

◆ build_uncomp_ipv4()

static bool build_uncomp_ipv4 ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_decoded_ip_values  decoded,
uint8_t *const  dest,
const size_t  uncomp_hdrs_max_len,
size_t *const  uncomp_hdrs_len,
const size_t  payload_size 
)
static

Build an uncompressed IPv4 header.

Parameters
contextThe decompression context
decodedThe decoded IPv4 fields
destThe buffer to store the IPv4 header
uncomp_hdrs_max_lenThe max length of the IPv4 header
[out]uncomp_hdrs_lenThe length of the IPv4 header
payload_sizeThe length of the IPv4 payload
Returns
true if the IPv4 header is successfully built, false if an error occurs

◆ build_uncomp_ipv6()

static bool build_uncomp_ipv6 ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_decoded_ip_values  decoded,
uint8_t *const  dest,
const size_t  uncomp_hdrs_max_len,
size_t *const  uncomp_hdrs_len,
const size_t  payload_size,
const struct list_decomp *const  list_decomp 
)
static

Build an uncompressed IPv6 header.

Parameters
contextThe decompression context
decodedThe decoded IPv6 fields
destThe buffer to store the IPv6 header
uncomp_hdrs_max_lenThe max length of the IPv6 header
[out]uncomp_hdrs_lenThe length of the IPv6 header
payload_sizeThe length of the IPv6 payload
list_decompThe list decompressor
Returns
true if the IPv6 header is successfully built, false if an error occurs

◆ check_uncomp_crc()

static bool check_uncomp_crc ( const struct rohc_decomp *const  decomp,
const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  outer_ip_hdr,
const uint8_t *const  inner_ip_hdr,
const uint8_t *const  next_header,
const rohc_crc_type_t  crc_type,
const uint8_t  crc_packet 
)
static

Check whether the CRC on uncompressed header is correct or not.

TODO: The CRC should be computed only on the CRC-DYNAMIC fields if the CRC-STATIC fields did not change.

Parameters
decompThe ROHC decompressor
contextThe decompression context
outer_ip_hdrThe outer IP header
inner_ip_hdrThe inner IP header if it exists, NULL otherwise
next_headerThe transport header, eg. UDP
crc_typeThe type of CRC
crc_packetThe CRC extracted from the ROHC header
Returns
true if the CRC is correct, false otherwise

◆ decode_ip_values_from_bits()

static bool decode_ip_values_from_bits ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_decomp_rfc3095_changes *const  ctxt,
const struct ip_id_offset_decode *const  ip_id_decode,
const uint32_t  decoded_sn,
const rohc_lsb_ref_t  lsb_ref_type,
const struct rohc_extr_ip_bits *const  bits,
const char *const  descr,
const size_t  ip_hdr_pos,
struct rohc_decoded_ip_values *const  decoded 
)
static

Decode IP values from extracted bits.

Parameters
contextThe decompression context
ctxtThe decompression context for the IP header
ip_id_decodeThe context for decoding IP-ID offset
decoded_snThe SN that was decoded
lsb_ref_typeThe reference value to use to decode LSB values (used for context repair upon CRC failure)
bitsThe IP bits extracted from ROHC header (all headers included: static/dynamic chains, UO* base header, UO* extension header, UO* remainder header)
descrThe description of the IP header
ip_hdr_posThe position of the IP header (1 = outer, 2 = inner)
decodedOUT: The corresponding decoded IP values
Returns
true if decoding is successful, false otherwise

◆ is_sn_wraparound()

static bool is_sn_wraparound ( const struct rohc_ts  cur_arrival_time,
const struct rohc_ts  arrival_times[ROHC_MAX_ARRIVAL_TIMES],
const size_t  arrival_times_nr,
const size_t  arrival_times_index,
const size_t  k,
const rohc_lsb_shift_t  p 
)
static

Is SN wraparound possible?

According to RFC3095, §5.3.2.2.4, step c, SN wraparound is possible if the inter-packet interval of the current packet is at least 2^k times the nominal inter-packet interval (with k the number of SN bits in the current header).

However SN wraparound may happen sooner depending on the shift parameter p of the W-LSB algorithm. If p is large, the interpretation interval is shifted on the left: the positive part of the interpretation interval is smaller. Less (lost) packets are needed to cause a wraparound.

The 'width of the positive part of the interpretation interval' (2^k - p) is used instead of the 'width of the full interpretation interval' (2^k).

A -10% marge is taken to handle problems due to clock precision.

Parameters
cur_arrival_timeThe arrival time of the current packet
arrival_timesThe arrival times for the last packets
arrival_times_nrThe number of arrival times for last packets
arrival_times_indexThe index for the arrival time of the next packet
kThe number of bits for SN
pThe shift parameter p for SN
Returns
Whether SN wraparound is possible or not

◆ parse_dynamic_part_ip()

static int parse_dynamic_part_ip ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits,
struct list_decomp *const  list_decomp 
)
static

Parse the IP dynamic part of a ROHC packet.

See 5.7.7.3 and 5.7.7.4 in RFC 3095 for details.

Parameters
contextThe decompression context
packetThe ROHC packet to parse
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IP dynamic part
list_decompThe list decompressor (only for IPv6)
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_dynamic_part_ipv4()

static int parse_dynamic_part_ipv4 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits 
)
static

Decode the IPv4 dynamic part of a ROHC packet.

See 5.7.7.4 in RFC 3095 for details. Generic extension header list is not managed yet. See 3.3 in RFC 3843 for details on the Static IP Identifier (SID) flag.

Dynamic part:

      +---+---+---+---+---+---+---+---+
      |        Type of Service        |
      +---+---+---+---+---+---+---+---+
      |         Time to Live          |
      +---+---+---+---+---+---+---+---+
      /        Identification         /   2 octets, sent verbatim
      +---+---+---+---+---+---+---+---+
      | DF|RND|NBO|SID|       0       |
      +---+---+---+---+---+---+---+---+
      / Generic extension header list /  variable length
      +---+---+---+---+---+---+---+---+
Parameters
contextThe decompression context
packetThe ROHC packet to decode
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IP dynamic part
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_dynamic_part_ipv6()

static int parse_dynamic_part_ipv6 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits,
struct list_decomp *const  list_decomp 
)
static

Decode the IPv6 dynamic part of a ROHC packet.

See 5.7.7.3 in RFC 3095 for details. Generic extension header list is not managed yet.

Parameters
contextThe decompression context
packetThe ROHC packet to decode
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IP dynamic part
list_decompThe list decompressor
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_extension0()

static int parse_extension0 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_data,
const size_t  rohc_data_len,
const rohc_packet_t  packet_type,
const ip_header_pos_t  innermost_ip_hdr,
struct rohc_extr_bits *const  bits 
)
static

Parse the extension 0 of the UO-1-ID or UOR-2* packet.

Bits extracted:

  • 3 bits of SN
  • UOR-2: 3 bits of innermost non-random IP-ID
  • UOR-2-ID: 3 bits of innermost non-random IP-ID
  • UOR-2-RTP: 3 bits of TS
  • UOR-2-TS: 3 bits of TS
  • UO-1-ID: 3 bits of innermost non-random IP-ID
Parameters
contextThe decompression context
rohc_dataThe ROHC data to parse
rohc_data_lenThe length of the ROHC data to parse
packet_typeThe type of ROHC packet
innermost_ip_hdrThe innermost IPv4 header with non-random IP-ID
bitsIN: the bits already found in base header OUT: the bits found in the extension header 0
Returns
The data length read from the ROHC packet, -1 in case of error

◆ parse_extension1()

static int parse_extension1 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_data,
const size_t  rohc_data_len,
const rohc_packet_t  packet_type,
const ip_header_pos_t  innermost_ip_hdr,
struct rohc_extr_bits *const  bits 
)
static

Parse the extension 1 of the UO-1-ID or UOR-2* packet.

Bits extracted:

  • 3 bits of SN
  • UOR-2: 11 bits of innermost IP-ID
  • UOR-2-RTP: 11 bits of TS
  • UOR-2-TS: 3 bits of TS / 8 bits of innermost IP-ID
  • UOR-2-ID: 3 bits of innermost IP-ID / 8 bits of TS
  • UO-1-ID: 3 bits of innermost IP-ID / 8 bits of TS
Parameters
contextThe decompression context
rohc_dataThe ROHC data to parse
rohc_data_lenThe length of the ROHC data to parse
packet_typeThe type of ROHC packet
innermost_ip_hdrThe innermost IPv4 header with non-random IP-ID
bitsIN: the bits already found in base header OUT: the bits found in the extension header 1
Returns
The data length read from the ROHC packet, -1 in case of error

◆ parse_extension2()

static int parse_extension2 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_data,
const size_t  rohc_data_len,
const rohc_packet_t  packet_type,
const ip_header_pos_t  innermost_ip_hdr,
struct rohc_extr_bits *const  bits 
)
static

Parse the extension 2 of the UO-1-ID or UOR-2* packet.

Bits extracted:

  • 3 bits of SN
  • UOR-2: 11 bits of outer IP-ID / 8 bits of inner IP-ID
  • UOR-2-RTP: 19 bits of TS
  • UOR-2-TS: 11 bits of TS / 8 bits of the innermost IP-ID
  • UOR-2-ID: 8 bits of TS / 11 bits of the innermost IP-ID
  • UO-1-ID: 8 bits of TS / 11 bits of the innermost IP-ID
Parameters
contextThe decompression context
rohc_dataThe ROHC data to parse
rohc_data_lenThe length of the ROHC data to parse
packet_typeThe type of ROHC packet
innermost_ip_hdrThe innermost IPv4 header with non-random IP-ID
bitsIN: the bits already found in base header OUT: the bits found in the extension header 2
Returns
The data length read from the ROHC packet, -1 in case of error

◆ parse_extension_type()

static uint8_t parse_extension_type ( const uint8_t *const  rohc_ext)
static

Find out which extension is carried by the UOR-2 packet.

Parameters
rohc_extThe ROHC UOR-2 packet
Returns
The UOR-2 extension type among:
  • ROHC_EXT_0
  • ROHC_EXT_1
  • ROHC_EXT_2
  • ROHC_EXT_3

◆ parse_ir()

static bool parse_ir ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one IR packet.

 IR packet (5.7.7.1):

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  |         Add-CID octet         |  if for small CIDs and CID != 0
    +---+---+---+---+---+---+---+---+
 2  | 1   1   1   1   1   1   0 | D |
    +---+---+---+---+---+---+---+---+
    |                               |
 3  /    0-2 octets of CID info     /  1-2 octets if for large CIDs
    |                               |
    +---+---+---+---+---+---+---+---+
 4  |            Profile            |  1 octet
    +---+---+---+---+---+---+---+---+
 5  |              CRC              |  1 octet
    +---+---+---+---+---+---+---+---+
    |                               |
 6  |         Static chain          |  variable length
    |                               |
    +---+---+---+---+---+---+---+---+
    |                               |
 7  |         Dynamic chain         |  present if D = 1, variable length
    |                               |
    +---+---+---+---+---+---+---+---+
 8  |             SN                |  2 octets if not RTP
    +---+---+---+---+---+---+---+---+
    |                               |
    |           Payload             |  variable length
    |                               |
     - - - - - - - - - - - - - - - -
Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC extracted from the ROHC packet
bitsOUT: The bits extracted from the IR header
rohc_hdr_lenOUT: The size of the IR header
Returns
true if IR is successfully parsed, false otherwise

◆ parse_irdyn()

static bool parse_irdyn ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one IR-DYN packet.

 IR-DYN packet (5.7.7.2):

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         : if for small CIDs and CID != 0
    +---+---+---+---+---+---+---+---+
 2  | 1   1   1   1   1   0   0   0 | IR-DYN packet type
    +---+---+---+---+---+---+---+---+
    :                               :
 3  /     0-2 octets of CID info    / 1-2 octets if for large CIDs
    :                               :
    +---+---+---+---+---+---+---+---+
 4  |            Profile            | 1 octet
    +---+---+---+---+---+---+---+---+
 5  |              CRC              | 1 octet
    +---+---+---+---+---+---+---+---+
    |                               |
 6  /         Dynamic chain         / variable length
    |                               |
    +---+---+---+---+---+---+---+---+
 7  |             SN                | 2 octets if not RTP
    +---+---+---+---+---+---+---+---+
    :                               :
    /           Payload             / variable length
    :                               :
     - - - - - - - - - - - - - - - -
Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the IR-DYN header
[out]bitsThe bits extracted from the IR-DYN header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if IR-DYN is successfully parsed, false otherwise

◆ parse_static_part_ip()

static int parse_static_part_ip ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits 
)
static

Parse the IP static part of a ROHC packet.

See 5.7.7.3 and 5.7.7.4 in RFC 3095 for details.

Parameters
contextThe decompression context
packetThe ROHC packet to parse
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IP static part
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_static_part_ipv4()

static int parse_static_part_ipv4 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits 
)
static

Parse the IPv4 static part of a ROHC packet.

See 5.7.7.4 in RFC 3095 for details.

Parameters
contextThe decompression context
packetThe ROHC packet to parse
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IPv4 static part
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_static_part_ipv6()

static int parse_static_part_ipv6 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  packet,
const size_t  length,
struct rohc_extr_ip_bits *const  bits 
)
static

Parse the IPv6 static part of a ROHC packet.

See 5.7.7.3 in RFC 3095 for details.

Parameters
contextThe decompression context
packetThe ROHC packet to parse
lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the IPv6 static part
Returns
The number of bytes read in the ROHC packet, -1 in case of failure

◆ parse_uo0()

static bool parse_uo0 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UO-0 header.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UO-0 (5.7.1)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 0 |      SN       |    CRC    |
    +===+===+===+===+===+===+===+===+

 Part 4 is empty.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UO-0 header
[out]bitsThe bits extracted from the UO-0 header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UO-0 is successfully parsed, false otherwise

◆ parse_uo1()

static bool parse_uo1 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UO-1 header for non-RTP profiles.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UO-1 (5.11.3):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   0 |         IP-ID         |
    +===+===+===+===+===+===+===+===+
 4  |        SN         |    CRC    |
    +---+---+---+---+---+---+---+---+

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UO-1 header
[out]bitsThe bits extracted from the UO-1 header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UO-1 is successfully parsed, false otherwise

◆ parse_uo1id()

static bool parse_uo1id ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UO-1-ID header for RTP profiles.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UO-1-ID (5.7.3):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   0 |T=0|      IP-ID        |
    +===+===+===+===+===+===+===+===+
 4  | X |      SN       |    CRC    |
    +---+---+---+---+---+---+---+---+

 X: X = 0 indicates that no extension is present;
    X = 1 indicates that an extension is present.

 T: T = 0 indicates format UO-1-ID;
    T = 1 indicates format UO-1-TS.

 UO-1-ID cannot be used if there is no IPv4 header in the context or
 if value(RND) and value(RND2) are both 1.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UO-1-ID header
[out]bitsThe bits extracted from the UO-1-ID header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UO-1-ID is successfully parsed, false otherwise

◆ parse_uo1rtp()

static bool parse_uo1rtp ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UO-1 header for RTP profile.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UO-1-RTP (5.7.3):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   0 |          TS           |
    +===+===+===+===+===+===+===+===+
 4  | M |      SN       |    CRC    |
    +---+---+---+---+---+---+---+---+

 T: T = 0 indicates format UO-1-ID;
    T = 1 indicates format UO-1-TS.

 UO-1-RTP cannot be used if there is no IPv4 header in the context or
 if value(RND) and value(RND2) are both 1.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UO-1-RTP header
[out]bitsThe bits extracted from the UO-1-RTP header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UO-1-RTP is successfully parsed, false otherwise

◆ parse_uo1ts()

static bool parse_uo1ts ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UO-1-TS header for RTP profiles.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UO-1-TS (5.7.3):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   0 |T=1|        TS         |
    +===+===+===+===+===+===+===+===+
 4  | M |      SN       |    CRC    |
    +---+---+---+---+---+---+---+---+

 T: T = 0 indicates format UO-1-ID;
    T = 1 indicates format UO-1-TS.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UO-1-TS header
[out]bitsThe bits extracted from the UO-1-TS header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UO-1-TS is successfully parsed, false otherwise

◆ parse_uo_remainder()

static bool parse_uo_remainder ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse the remainder of the UO* header.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1, 2, 3, 4, and 5 are parsed in parent functions. Parts 6 and 9 are parsed in this function. Part 13 is parsed in profile-specific function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
bitsOUT: The bits extracted from the UO* header
rohc_hdr_lenOUT: The size of the UO* header
Returns
true if UO* is successfully parsed, false otherwise

◆ parse_uor2()

static bool parse_uor2 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UOR-2 header for non-RTP profiles.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UOR-2 (5.11.3):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   1   0 |        SN         |
    +===+===+===+===+===+===+===+===+
 4  | X |            CRC            |
    +---+---+---+---+---+---+---+---+

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UOR-2 header
[out]bitsThe bits extracted from the UOR-2 header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UOR-2 is successfully parsed, false otherwise

◆ parse_uor2id()

static bool parse_uor2id ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UOR-2-ID header for RTP profile (in 2 passes if needed)

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UOR-2-ID header
[out]bitsThe bits extracted from the UOR-2-ID header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UOR-2-ID is successfully parsed, false otherwise
See also
parse_uor2id_once

◆ parse_uor2id_once()

static bool parse_uor2id_once ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
const rohc_packet_t  packet_type,
uint8_t  outer_rnd,
uint8_t  inner_rnd,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len,
bool *const  need_reparse 
)
static

Parse one UOR-2-ID header for RTP profile.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UOR-2-ID (5.7.4):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   1   0 |      IP-ID        |
    +===+===+===+===+===+===+===+===+
 4a |T=0| M |          SN           |
    +---+---+---+---+---+---+---+---+
 4b | X |           CRC             |
    +---+---+---+---+---+---+---+---+

 X: X = 0 indicates that no extension is present;
    X = 1 indicates that an extension is present.

 T: T = 0 indicates format UOR-2-ID;
    T = 1 indicates format UOR-2-TS.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
outer_rndThe forced value for outer RND (used for reparsing)
inner_rndThe forced value for inner RND (used for reparsing)
[out]extr_crcThe CRC bits extracted from the UOR-2-ID header
[out]bitsThe bits extracted from the UOR-2-ID header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
[out]need_reparsetrue if packet needs to be parsed again
Returns
true if UOR-2-ID is successfully parsed, false otherwise
See also
parse_uor2id

◆ parse_uor2rtp()

static bool parse_uor2rtp ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UOR-2 header for RTP profile (in 2 passes if needed)

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UOR-2-RTP header
[out]bitsThe bits extracted from the UOR-2-RTP header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UOR-2-RTP is successfully parsed, false otherwise
See also
parse_uor2rtp_once

◆ parse_uor2rtp_once()

static bool parse_uor2rtp_once ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
const rohc_packet_t  packet_type,
uint8_t  outer_rnd,
uint8_t  inner_rnd,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len,
bool *const  need_reparse 
)
static

Parse one UOR-2-RTP header for RTP profile.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UOR-2-RTP (5.7.4):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   1   0 |        TS         |
    +===+===+===+===+===+===+===+===+
 4a | TS| M |       SN              |
    +---+---+---+---+---+---+---+---+
 4b | X |            CRC            |
    +---+---+---+---+---+---+---+---+

 X: X = 0 indicates that no extension is present;
    X = 1 indicates that an extension is present.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
outer_rndThe forced value for outer RND (used for reparsing)
inner_rndThe forced value for inner RND (used for reparsing)
[out]extr_crcThe CRC bits extracted from the UOR-2-RTP header
[out]bitsThe bits extracted from the UOR-2-RTP header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
[out]need_reparsetrue if packet needs to be parsed again
Returns
true if UOR-2-RTP is successfully parsed, false otherwise

◆ parse_uor2ts()

static bool parse_uor2ts ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)
static

Parse one UOR-2-TS header for RTP profile (in 2 passes if needed)

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the UOR-2-TS header
[out]bitsThe bits extracted from the UOR-2-TS header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if UOR-2-TS is successfully parsed, false otherwise
See also
parse_uor2ts_once

◆ parse_uor2ts_once()

static bool parse_uor2ts_once ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
const rohc_packet_t  packet_type,
uint8_t  outer_rnd,
uint8_t  inner_rnd,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len,
bool *const  need_reparse 
)
static

Parse one UOR-2-TS header for RTP profile.

      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
 1  :         Add-CID octet         :                    |
    +---+---+---+---+---+---+---+---+                    |
 2  |   first octet of base header  |                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 3  /   0, 1, or 2 octets of CID    /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :   remainder of base header    :                    |
 4  /     see below for details     /                    |
    :                               :                    |
    +---+---+---+---+---+---+---+---+                    |
    :                               :                    |
 5  /           Extension           /                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 6  +   IP-ID of outer IPv4 header  +
    :                               :     (see section 5.7 or [RFC-3095])
     --- --- --- --- --- --- --- ---
 7  /    AH data for outer list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 8  +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 9  +   IP-ID of inner IPv4 header  +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---                     |
 10 /    AH data for inner list     /                    |
     --- --- --- --- --- --- --- ---                     |
    :                               :                    |
 11 +         GRE checksum          +                    |
    :                               :                    |
     --- --- --- --- --- --- --- ---
    :            List of            :
 12 /        Dynamic chains         /  variable, given by static chain
    :   for additional IP headers   :  (includes no SN)
     --- --- --- --- --- --- --- ---

     --- --- --- --- --- --- --- ---
    :                               :  RTP/UDP profiles only [RFC-3095]
 13 +         UDP Checksum          +  2 octets,
    :                               :  if context(UDP Checksum) != 0
     --- --- --- --- --- --- --- ---

 UOR-2-TS (5.7.4):

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
 2  | 1   1   0 |        TS         |
    +===+===+===+===+===+===+===+===+
 4a |T=1| M |          SN           |
    +---+---+---+---+---+---+---+---+
 4b | X |           CRC             |
    +---+---+---+---+---+---+---+---+

 X: X = 0 indicates that no extension is present;
    X = 1 indicates that an extension is present.

 T: T = 0 indicates format UOR-2-ID;
    T = 1 indicates format UOR-2-TS.

Parts 7, 8, 10, 11 and 12 are not supported. Parts 1 and 3 are parsed in parent functions. Parts 6, 9, and 13 are parsed in sub-function. Parts 2, 4, and 5 are parsed in this function.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
outer_rndThe forced value for outer RND (used for reparsing)
inner_rndThe forced value for inner RND (used for reparsing)
[out]extr_crcThe CRC bits extracted from the UOR-2-TS header
[out]bitsThe bits extracted from the UOR-2-TS header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
[out]need_reparsetrue if packet needs to be parsed again
Returns
true if UOR-2-TS is successfully parsed, false otherwise
See also
parse_uor2ts

◆ reset_extr_bits()

static void reset_extr_bits ( const struct rohc_decomp_rfc3095_ctxt *const  rfc3095_ctxt,
struct rohc_extr_bits *const  bits 
)
static

Reset the extracted bits for next parsing.

Parameters
rfc3095_ctxtThe generic decompression context
[out]bitsThe extracted bits to reset

◆ rfc3095_decomp_attempt_repair()

bool rfc3095_decomp_attempt_repair ( const struct rohc_decomp *const  decomp,
const struct rohc_decomp_ctxt *const  context,
const struct rohc_ts  pkt_arrival_time,
struct rohc_decomp_crc_corr_ctxt *const  crc_corr,
struct rohc_extr_bits *const  extr_bits 
)

Attempt a packet/context repair upon CRC failure.

Parameters
decompThe ROHC decompressor
contextThe decompression context
pkt_arrival_timeThe arrival time of the ROHC packet that caused the CRC failure
[in,out]crc_corrThe context for corrections upon CRC failures
[in,out]extr_bitsThe bits extracted from the ROHC header
Returns
true if repair is possible, false if not

◆ rfc3095_decomp_build_hdrs()

rohc_status_t rfc3095_decomp_build_hdrs ( const struct rohc_decomp *const  decomp,
const struct rohc_decomp_ctxt *const  context,
const rohc_packet_t  packet_type,
const struct rohc_decomp_crc *const  extr_crc,
const struct rohc_decoded_values *const  decoded,
const size_t  payload_len,
struct rohc_buf *const  uncomp_hdrs,
size_t *const  uncomp_hdrs_len 
)

Build the uncompressed headers.

Todo:
check for uncomp_hdrs size before writing into it
Parameters
decompThe ROHC decompressor
contextThe decompression context
packet_typeThe type of ROHC packet
extr_crcThe CRC bits extracted from the ROHC header
decodedThe values decoded from ROHC header
payload_lenThe length of the packet payload
[out]uncomp_hdrsThe buffer to store the uncompressed headers
[out]uncomp_hdrs_lenThe length of the uncompressed headers written into the buffer
Returns
Possible values:
  • ROHC_STATUS_OK if headers are built successfully,
  • ROHC_STATUS_BAD_CRC if headers do not match CRC,
  • ROHC_STATUS_OUTPUT_TOO_SMALL if the output buffer is too small

◆ rfc3095_decomp_decode_bits()

bool rfc3095_decomp_decode_bits ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_extr_bits *const  bits,
const size_t  payload_len,
struct rohc_decoded_values *const  decoded 
)

Decode values from extracted bits.

The following values are decoded:

  • SN
  • fields related to the outer IP header
  • fields related to the inner IP header (if it exists)

Other fields may be decoded by the profile-specific callback named decode_values_from_bits.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
bitsThe bits extracted from the ROHC packet
payload_lenThe length of the packet payload (in bytes)
[out]decodedThe corresponding decoded values
Returns
true if decoding is successful, false otherwise

◆ rfc3095_decomp_parse_pkt()

bool rfc3095_decomp_parse_pkt ( const struct rohc_decomp_ctxt *const  context,
const struct rohc_buf  rohc_packet,
const size_t  large_cid_len,
rohc_packet_t *const  packet_type,
struct rohc_decomp_crc *const  extr_crc,
struct rohc_extr_bits *const  bits,
size_t *const  rohc_hdr_len 
)

Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.

Parameters
contextThe decompression context
rohc_packetThe ROHC packet to decode
large_cid_lenThe length of the optional large CID field
[in,out]packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out]extr_crcThe CRC bits extracted from the ROHC header
[out]bitsThe bits extracted from the ROHC header
[out]rohc_hdr_lenThe length of the ROHC header (in bytes)
Returns
true if packet is successfully parsed, false otherwise
See also
parse_ir
parse_irdyn
parse_uo0
parse_uo1
parse_uo1rtp
parse_uo1id
parse_uo1ts
parse_uor2
parse_uor2rtp
parse_uor2id
parse_uor2ts

◆ rfc3095_decomp_update_ctxt()

void rfc3095_decomp_update_ctxt ( struct rohc_decomp_ctxt *const  context,
const struct rohc_decoded_values *const  decoded,
const size_t  payload_len,
bool *const  do_change_mode 
)

Update context with decoded values.

The following decoded values are updated in context:

  • SN
  • static & dynamic fields of the outer IP header
  • static & dynamic fields of the inner IP header (if it exists)
  • fields for the next header (optional, depends on profile)

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
decodedThe decoded values to update in the context
payload_lenThe length of the packet payload
[out]do_change_modeWhether the profile context wants to change its operational mode or not

◆ rohc_decomp_rfc3095_create()

bool rohc_decomp_rfc3095_create ( const struct rohc_decomp_ctxt *const  context,
struct rohc_decomp_rfc3095_ctxt **const  persist_ctxt,
struct rohc_decomp_volat_ctxt *const  volat_ctxt,
rohc_trace_callback2_t  trace_cb,
void *const  trace_cb_priv,
const int  profile_id 
)

Create the RFC3095 volatile and persistent parts of the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
[out]persist_ctxtThe persistent part of the decompression context
[out]volat_ctxtThe volatile part of the decompression context
trace_cbThe function to call for printing traces
trace_cb_privAn optional private context, may be NULL
profile_idThe ID of the associated decompression profile
Returns
true if the Uncompressed context was successfully created, false if a problem occurred

◆ rohc_decomp_rfc3095_destroy()

void rohc_decomp_rfc3095_destroy ( struct rohc_decomp_rfc3095_ctxt *const  rfc3095_ctxt,
const struct rohc_decomp_volat_ctxt *const  volat_ctxt 
)

Destroy the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
rfc3095_ctxtThe generic decompression context
volat_ctxtThe volatile part of the decompression context

◆ rohc_decomp_rfc3095_get_sn()

uint32_t rohc_decomp_rfc3095_get_sn ( const struct rohc_decomp_ctxt *const  context)

Get the reference SN value of the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters
contextThe decompression context
Returns
The reference SN value