ROHC compression/decompression library
|
ROHC generic decompression context for IP-only, UDP and UDP Lite profiles. More...
#include "d_generic.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 "comp_list.h"
#include "rohc_decomp_detect_packet.h"
#include "schemes/wlsb.h"
#include "schemes/list_ipv6.h"
#include "sdvl.h"
#include "crc.h"
#include "config.h"
#include <string.h>
#include <assert.h>
Functions | |
static int | parse_static_part_ip (const struct rohc_decomp_ctxt *const context, const unsigned char *const packet, const size_t length, struct rohc_extr_ip_bits *const bits) |
Parse the IP static part of a ROHC packet. | |
static int | parse_static_part_ipv4 (const struct rohc_decomp_ctxt *const context, const unsigned char *packet, const size_t length, struct rohc_extr_ip_bits *const bits) |
Parse the IPv4 static part of a ROHC packet. | |
static int | parse_static_part_ipv6 (const struct rohc_decomp_ctxt *const context, const unsigned char *packet, const size_t length, struct rohc_extr_ip_bits *const bits) |
Parse the IPv6 static part of a ROHC packet. | |
static int | parse_dynamic_part_ip (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static int | parse_dynamic_part_ipv4 (const struct rohc_decomp_ctxt *const context, const unsigned char *packet, const size_t length, struct rohc_extr_ip_bits *const bits) |
Decode the IPv4 dynamic part of a ROHC packet. | |
static int | parse_dynamic_part_ipv6 (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static bool | parse_packet (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, 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. | |
static bool | parse_ir (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one IR packet. | |
static bool | parse_irdyn (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one IR-DYN packet. | |
static bool | parse_uo0 (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UO-0 header. | |
static bool | parse_uo1 (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UO-1 header for non-RTP profiles. | |
static bool | parse_uo1rtp (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UO-1 header for RTP profile. | |
static bool | parse_uo1id (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UO-1-ID header for RTP profiles. | |
static bool | parse_uo1ts (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UO-1-TS header for RTP profiles. | |
static bool | parse_uor2 (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_extr_bits *const bits, size_t *const rohc_hdr_len) |
Parse one UOR-2 header for non-RTP profiles. | |
static bool | parse_uor2rtp (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, 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) | |
static bool | parse_uor2rtp_once (const struct rohc_decomp_ctxt *const context, const unsigned char *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_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse) |
Parse one UOR-2-RTP header for RTP profile. | |
static bool | parse_uor2id (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, 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) | |
static bool | parse_uor2id_once (const struct rohc_decomp_ctxt *const context, const unsigned char *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_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse) |
Parse one UOR-2-ID header for RTP profile. | |
static bool | parse_uor2ts (const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, rohc_packet_t *const packet_type, 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) | |
static bool | parse_uor2ts_once (const struct rohc_decomp_ctxt *const context, const unsigned char *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_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const need_reparse) |
Parse one UOR-2-TS header for RTP profile. | |
static bool | parse_uo_remainder (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static uint8_t | parse_extension_type (const unsigned char *const rohc_ext) |
Find out which extension is carried by the UOR-2 packet. | |
static int | parse_extension0 (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static int | parse_extension1 (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static int | parse_extension2 (const struct rohc_decomp_ctxt *const context, const unsigned char *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. | |
static rohc_status_t | build_uncomp_hdrs (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decoded_values decoded, const size_t payload_len, const rohc_crc_type_t crc_type, const uint8_t crc_packet, unsigned char *uncomp_hdrs, const size_t uncomp_hdrs_max_len, size_t *const uncomp_hdrs_len) |
Build the uncompressed headers. | |
static bool | build_uncomp_ip (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, unsigned char *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. | |
static bool | build_uncomp_ipv4 (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, unsigned char *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. | |
static bool | build_uncomp_ipv6 (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_ip_values decoded, unsigned char *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. | |
static bool | decode_values_from_bits (struct rohc_decomp_ctxt *const context, const struct rohc_extr_bits bits, struct rohc_decoded_values *const decoded) |
Decode values from extracted bits. | |
static bool | decode_ip_values_from_bits (const struct rohc_decomp_ctxt *const context, const struct d_generic_changes *const ctxt, const struct ip_id_offset_decode *const ip_id_decode, const uint32_t decoded_sn, const struct rohc_extr_ip_bits bits, const char *const descr, struct rohc_decoded_ip_values *const decoded) |
Decode IP values from extracted bits. | |
static bool | check_ir_crc (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_hdr, const size_t rohc_hdr_len, const size_t add_cid_len, const size_t large_cid_len, const uint8_t crc_packet) |
Check whether the CRC on IR or IR-DYN header is correct or not. | |
static bool | check_uncomp_crc (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const unsigned char *const outer_ip_hdr, const unsigned char *const inner_ip_hdr, const unsigned char *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. | |
static bool | attempt_repair (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, struct rohc_extr_bits *const bits) |
Attempt a packet/context repair upon CRC failure. | |
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? | |
static void | update_context (const struct rohc_decomp_ctxt *const context, const struct rohc_decoded_values decoded) |
Update context with decoded values. | |
static void | stats_add_decomp_success (struct rohc_decomp_ctxt *const context, const size_t comp_hdr_len, const size_t uncomp_hdr_len) |
Update statistics upon successful decompression. | |
static void | reset_extr_bits (const struct d_generic_context *const g_context, struct rohc_extr_bits *const bits) |
Reset the extracted bits for next parsing. | |
void * | d_generic_create (const struct rohc_decomp_ctxt *const context, rohc_trace_callback_t trace_cb, rohc_trace_callback2_t trace_cb2, void *const trace_cb_priv, const int profile_id) |
Create the generic decompression context. | |
void | d_generic_destroy (void *const context) |
Destroy the context. | |
rohc_status_t | d_generic_decode (struct rohc_decomp *const decomp, struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t add_cid_len, const size_t large_cid_len, struct rohc_buf *const uncomp_packet, rohc_packet_t *const packet_type) |
Decode one IR, IR-DYN or UO* packet. | |
uint32_t | d_generic_get_sn (const struct rohc_decomp_ctxt *const context) |
Get the reference SN value of the context. |
ROHC generic decompression context for IP-only, UDP and UDP Lite profiles.
static bool attempt_repair | ( | const struct rohc_decomp *const | decomp, |
const struct rohc_decomp_ctxt *const | context, | ||
struct rohc_extr_bits *const | bits | ||
) | [static] |
Attempt a packet/context repair upon CRC failure.
decomp | The ROHC decompressor |
context | The decompression context |
bits | OUT: The bits extracted from the UO-0 header |
static rohc_status_t build_uncomp_hdrs | ( | const struct rohc_decomp *const | decomp, |
const struct rohc_decomp_ctxt *const | context, | ||
const rohc_packet_t | packet_type, | ||
const struct rohc_decoded_values | decoded, | ||
const size_t | payload_len, | ||
const rohc_crc_type_t | crc_type, | ||
const uint8_t | crc_packet, | ||
unsigned char * | uncomp_hdrs, | ||
const size_t | uncomp_hdrs_max_len, | ||
size_t *const | uncomp_hdrs_len | ||
) | [static] |
Build the uncompressed headers.
decomp | The ROHC decompressor | |
context | The decompression context | |
packet_type | The type of ROHC packet | |
decoded | The values decoded from ROHC header | |
payload_len | The length of the packet payload | |
crc_type | The type of CRC | |
crc_packet | The CRC extracted from the ROHC header | |
[out] | uncomp_hdrs | The buffer to store the uncompressed headers |
uncomp_hdrs_max_len | The max length of the uncompressed headers | |
[out] | uncomp_hdrs_len | The length of the uncompressed headers written into the buffer |
static bool build_uncomp_ip | ( | const struct rohc_decomp_ctxt *const | context, |
const struct rohc_decoded_ip_values | decoded, | ||
unsigned char *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.
context | The decompression context | |
decoded | The decoded IPv4 fields | |
dest | The buffer to store the IP header | |
uncomp_hdrs_max_len | The max length of the IP header | |
[out] | uncomp_hdrs_len | The length of the IPv4 header |
payload_size | The length of the IP payload | |
list_decomp | The list decompressor (IPv6 only) |
static bool build_uncomp_ipv4 | ( | const struct rohc_decomp_ctxt *const | context, |
const struct rohc_decoded_ip_values | decoded, | ||
unsigned char *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.
context | The decompression context | |
decoded | The decoded IPv4 fields | |
dest | The buffer to store the IPv4 header | |
uncomp_hdrs_max_len | The max length of the IPv4 header | |
[out] | uncomp_hdrs_len | The length of the IPv4 header |
payload_size | The length of the IPv4 payload |
static bool build_uncomp_ipv6 | ( | const struct rohc_decomp_ctxt *const | context, |
const struct rohc_decoded_ip_values | decoded, | ||
unsigned char *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.
context | The decompression context | |
decoded | The decoded IPv6 fields | |
dest | The buffer to store the IPv6 header | |
uncomp_hdrs_max_len | The max length of the IPv6 header | |
[out] | uncomp_hdrs_len | The length of the IPv6 header |
payload_size | The length of the IPv6 payload | |
list_decomp | The list decompressor |
static bool check_ir_crc | ( | const struct rohc_decomp *const | decomp, |
const struct rohc_decomp_ctxt *const | context, | ||
const unsigned char *const | rohc_hdr, | ||
const size_t | rohc_hdr_len, | ||
const size_t | add_cid_len, | ||
const size_t | large_cid_len, | ||
const uint8_t | crc_packet | ||
) | [static] |
Check whether the CRC on IR or IR-DYN header is correct or not.
The CRC for IR/IR-DYN headers is always CRC-8. It is computed on the whole compressed header (payload excluded, but any CID bits included).
decomp | The ROHC decompressor |
context | The decompression context |
rohc_hdr | The compressed IR or IR-DYN header |
rohc_hdr_len | The length (in bytes) of the compressed header |
add_cid_len | The length of the optional Add-CID field |
large_cid_len | The length of the optional large CID field |
crc_packet | The CRC extracted from the ROHC header |
static bool check_uncomp_crc | ( | const struct rohc_decomp *const | decomp, |
const struct rohc_decomp_ctxt *const | context, | ||
const unsigned char *const | outer_ip_hdr, | ||
const unsigned char *const | inner_ip_hdr, | ||
const unsigned char *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.
decomp | The ROHC decompressor |
context | The decompression context |
outer_ip_hdr | The outer IP header |
inner_ip_hdr | The inner IP header if it exists, NULL otherwise |
next_header | The transport header, eg. UDP |
crc_type | The type of CRC |
crc_packet | The CRC extracted from the ROHC header |
void* d_generic_create | ( | const struct rohc_decomp_ctxt *const | context, |
rohc_trace_callback_t | trace_cb, | ||
rohc_trace_callback2_t | trace_cb2, | ||
void *const | trace_cb_priv, | ||
const int | profile_id | ||
) |
Create the generic decompression context.
This function is one of the functions that must exist in one profile for the framework to work.
context | The decompression context |
trace_cb | The old function to call for printing traces |
trace_cb2 | The new function to call for printing traces |
trace_cb_priv | An optional private context, may be NULL |
profile_id | The ID of the associated decompression profile |
rohc_status_t d_generic_decode | ( | struct rohc_decomp *const | decomp, |
struct rohc_decomp_ctxt *const | context, | ||
const struct rohc_buf | rohc_packet, | ||
const size_t | add_cid_len, | ||
const size_t | large_cid_len, | ||
struct rohc_buf *const | uncomp_packet, | ||
rohc_packet_t *const | packet_type | ||
) |
Decode one IR, IR-DYN or UO* packet.
This function is one of the functions that must exist in one profile for the framework to work.
Steps:
Steps C and D may be repeated if packet or context repair is attempted upon CRC failure.
decomp | The ROHC decompressor | |
context | The decompression context | |
rohc_packet | The ROHC packet to decode | |
add_cid_len | The length of the optional Add-CID field | |
large_cid_len | The length of the optional large CID field | |
[out] | uncomp_packet | The uncompressed packet |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
void d_generic_destroy | ( | void *const | context | ) |
Destroy the context.
This function is one of the functions that must exist in one profile for the framework to work.
context | The compression context |
uint32_t d_generic_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.
context | The decompression context |
static bool decode_ip_values_from_bits | ( | const struct rohc_decomp_ctxt *const | context, |
const struct d_generic_changes *const | ctxt, | ||
const struct ip_id_offset_decode *const | ip_id_decode, | ||
const uint32_t | decoded_sn, | ||
const struct rohc_extr_ip_bits | bits, | ||
const char *const | descr, | ||
struct rohc_decoded_ip_values *const | decoded | ||
) | [static] |
Decode IP values from extracted bits.
context | The decompression context |
ctxt | The decompression context for the IP header |
ip_id_decode | The context for decoding IP-ID offset |
decoded_sn | The SN that was decoded |
bits | The IP bits extracted from ROHC header (all headers included: static/dynamic chains, UO* base header, UO* extension header, UO* remainder header) |
descr | The description of the IP header |
decoded | OUT: The corresponding decoded IP values |
static bool decode_values_from_bits | ( | struct rohc_decomp_ctxt *const | context, |
const struct rohc_extr_bits | bits, | ||
struct rohc_decoded_values *const | decoded | ||
) | [static] |
Decode values from extracted bits.
The following values are decoded:
Other fields may be decoded by the profile-specific callback named decode_values_from_bits.
context | The decompression context |
bits | The extracted bits |
decoded | OUT: The corresponding decoded values |
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.
cur_arrival_time | The arrival time of the current packet |
arrival_times | The arrival times for the last packets |
arrival_times_nr | The number of arrival times for last packets |
arrival_times_index | The index for the arrival time of the next packet |
k | The number of bits for SN |
p | The shift parameter p for SN |
static int parse_dynamic_part_ip | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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.
context | The decompression context |
packet | The ROHC packet to parse |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IP dynamic part |
list_decomp | The list decompressor (only for IPv6) |
static int parse_dynamic_part_ipv4 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char * | 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 +---+---+---+---+---+---+---+---+
context | The decompression context |
packet | The ROHC packet to decode |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IP dynamic part |
static int parse_dynamic_part_ipv6 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char * | 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.
context | The decompression context |
packet | The ROHC packet to decode |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IP dynamic part |
list_decomp | The list decompressor |
static int parse_extension0 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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:
context | The decompression context |
rohc_data | The ROHC data to parse |
rohc_data_len | The length of the ROHC data to parse |
packet_type | The type of ROHC packet |
innermost_ip_hdr | The innermost IPv4 header with non-random IP-ID |
bits | IN: the bits already found in base header OUT: the bits found in the extension header 0 |
static int parse_extension1 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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:
context | The decompression context |
rohc_data | The ROHC data to parse |
rohc_data_len | The length of the ROHC data to parse |
packet_type | The type of ROHC packet |
innermost_ip_hdr | The innermost IPv4 header with non-random IP-ID |
bits | IN: the bits already found in base header OUT: the bits found in the extension header 1 |
static int parse_extension2 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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:
context | The decompression context |
rohc_data | The ROHC data to parse |
rohc_data_len | The length of the ROHC data to parse |
packet_type | The type of ROHC packet |
innermost_ip_hdr | The innermost IPv4 header with non-random IP-ID |
bits | IN: the bits already found in base header OUT: the bits found in the extension header 2 |
static uint8_t parse_extension_type | ( | const unsigned char *const | rohc_ext | ) | [static] |
Find out which extension is carried by the UOR-2 packet.
rohc_ext | The ROHC UOR-2 packet |
static bool parse_ir | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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 | | - - - - - - - - - - - - - - - -
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the IR header |
rohc_hdr_len | OUT: The size of the IR header |
static bool parse_irdyn | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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 : : - - - - - - - - - - - - - - - -
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the IR-DYN header |
rohc_hdr_len | OUT: The size of the IR-DYN header |
static bool parse_packet | ( | const struct rohc_decomp *const | decomp, |
const struct rohc_decomp_ctxt *const | context, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
struct rohc_extr_bits *const | bits, | ||
size_t *const | rohc_hdr_len | ||
) | [static] |
Parse one IR, IR-DYN, UO-0, UO-1*, or UOR-2* packet.
decomp | The ROHC decompressor |
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the ROHC header |
rohc_hdr_len | OUT: The size of the ROHC header |
static int parse_static_part_ip | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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.
context | The decompression context |
packet | The ROHC packet to parse |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IP static part |
static int parse_static_part_ipv4 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char * | 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.
context | The decompression context |
packet | The ROHC packet to parse |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IPv4 static part |
static int parse_static_part_ipv6 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char * | 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.
context | The decompression context |
packet | The ROHC packet to parse |
length | The length of the ROHC packet |
bits | OUT: The bits extracted from the IPv6 static part |
static bool parse_uo0 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UO-0 header |
rohc_hdr_len | OUT: The size of the UO-0 header |
static bool parse_uo1 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UO-1 header |
rohc_hdr_len | OUT: The size of the UO-1 header |
static bool parse_uo1id | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
bits | OUT: The bits extracted from the UO-1-ID header |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
rohc_hdr_len | OUT: The size of the UO-1-ID header |
static bool parse_uo1rtp | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UO-1-RTP header |
rohc_hdr_len | OUT: The size of the UO-1-RTP header |
static bool parse_uo1ts | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UO-1-TS header |
rohc_hdr_len | OUT: The size of the UO-1-TS header |
static bool parse_uo_remainder | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
bits | OUT: The bits extracted from the UO* header |
rohc_hdr_len | OUT: The size of the UO* header |
static bool parse_uor2 | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UOR-2 header |
rohc_hdr_len | OUT: The size of the UOR-2 header |
static bool parse_uor2id | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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)
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UOR-2-ID header |
rohc_hdr_len | OUT: The size of the UOR-2-ID header |
static bool parse_uor2id_once | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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_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.
context | The decompression context | |
rohc_packet | The ROHC packet to decode | |
rohc_length | The length of the ROHC packet | |
large_cid_len | The length of the optional large CID field | |
packet_type | The type of ROHC packet to parse | |
outer_rnd | The forced value for outer RND (used for reparsing) | |
inner_rnd | The forced value for inner RND (used for reparsing) | |
bits | OUT: The bits extracted from the UOR-2-ID header | |
rohc_hdr_len | OUT: The size of the UOR-2-ID header | |
[out] | need_reparse | true if packet needs to be parsed again |
static bool parse_uor2rtp | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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)
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UOR-2-RTP header |
rohc_hdr_len | OUT: The size of the UOR-2-RTP header |
static bool parse_uor2rtp_once | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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_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.
context | The decompression context | |
rohc_packet | The ROHC packet to decode | |
rohc_length | The length of the ROHC packet | |
large_cid_len | The length of the optional large CID field | |
packet_type | The type of ROHC packet to parse | |
outer_rnd | The forced value for outer RND (used for reparsing) | |
inner_rnd | The forced value for inner RND (used for reparsing) | |
bits | OUT: The bits extracted from the UOR-2-RTP header | |
rohc_hdr_len | OUT: The size of the UOR-2-RTP header | |
[out] | need_reparse | true if packet needs to be parsed again |
static bool parse_uor2ts | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
rohc_packet_t *const | packet_type, | ||
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)
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
packet_type | IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet |
bits | OUT: The bits extracted from the UOR-2-TS header |
rohc_hdr_len | OUT: The size of the UOR-2-TS header |
static bool parse_uor2ts_once | ( | const struct rohc_decomp_ctxt *const | context, |
const unsigned char *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_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.
context | The decompression context | |
rohc_packet | The ROHC packet to decode | |
rohc_length | The length of the ROHC packet | |
large_cid_len | The length of the optional large CID field | |
packet_type | The type of ROHC packet to parse | |
outer_rnd | The forced value for outer RND (used for reparsing) | |
inner_rnd | The forced value for inner RND (used for reparsing) | |
bits | OUT: The bits extracted from the UOR-2-TS header | |
rohc_hdr_len | OUT: The size of the UOR-2-TS header | |
[out] | need_reparse | true if packet needs to be parsed again |
static void reset_extr_bits | ( | const struct d_generic_context *const | g_context, |
struct rohc_extr_bits *const | bits | ||
) | [static] |
Reset the extracted bits for next parsing.
g_context | The generic decompression context |
bits | OUT: The extracted bits to reset |
static void stats_add_decomp_success | ( | struct rohc_decomp_ctxt *const | context, |
const size_t | comp_hdr_len, | ||
const size_t | uncomp_hdr_len | ||
) | [static] |
Update statistics upon successful decompression.
context | The decompression context |
comp_hdr_len | The length (in bytes) of the compressed header |
uncomp_hdr_len | The length (in bytes) of the uncompressed header |
static void update_context | ( | const struct rohc_decomp_ctxt *const | context, |
const struct rohc_decoded_values | decoded | ||
) | [static] |
Update context with decoded values.
The following decoded values are updated in context:
context | The decompression context |
decoded | The decoded values to update in the context |