ROHC compression/decompression library
|
ROHC generic decompression context for IP-only, UDP and UDP Lite profiles. More...
#include "d_generic.h"
#include "d_rtp.h"
#include "config.h"
#include "rohc_traces.h"
#include "rohc_time.h"
#include "rohc_debug.h"
#include "rohc_packets.h"
#include "rohc_bit_ops.h"
#include "wlsb.h"
#include "sdvl.h"
#include "crc.h"
#include <assert.h>
Defines | |
#define | IPV4_DYN_PART_SIZE 6 |
The size (in bytes) of the IPv4 dynamic part. | |
#define | WEIGHT_OLD 1 |
#define | WEIGHT_NEW 1 |
#define | APPEND_BITS(field_descr, ext_no, field, field_nr, bits, bits_nr, max) |
#define | APPEND_SN_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_OUTER_IP_ID_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_INNER_IP_ID_BITS(ext_no, base, bits, bits_nr) |
#define | APPEND_TS_BITS(ext_no, base, bits, bits_nr) |
Functions | |
void * | d_generic_create (void) |
Create the generic decompression context. | |
void | d_generic_destroy (void *context) |
Destroy the context. | |
int | d_generic_decode (struct rohc_decomp *decomp, struct d_context *context, const unsigned char *const rohc_packet, const unsigned int rohc_length, const size_t add_cid_len, const size_t large_cid_len, unsigned char *dest) |
Decode one IR, IR-DYN or UO* packet. | |
int | d_generic_get_sn (struct d_context *context) |
Get the reference SN value of the context. |
ROHC generic decompression context for IP-only, UDP and UDP Lite profiles.
#define APPEND_BITS | ( | field_descr, | |
ext_no, | |||
field, | |||
field_nr, | |||
bits, | |||
bits_nr, | |||
max | |||
) |
Append new LSB bits to already extracted bits
#define APPEND_INNER_IP_ID_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
APPEND_BITS(inner IP-ID, ext_no, \ (base)->inner_ip.id, (base)->inner_ip.id_nr, \ (bits), (bits_nr), 16)
Inner IP-ID: append new LSB bits to already extracted bits
#define APPEND_OUTER_IP_ID_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
APPEND_BITS(outer IP-ID, ext_no, \ (base)->outer_ip.id, (base)->outer_ip.id_nr, \ (bits), (bits_nr), 16)
Outer IP-ID: append new LSB bits to already extracted bits
#define APPEND_SN_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
APPEND_BITS(SN, ext_no, \ (base)->sn, (base)->sn_nr, \ (bits), (bits_nr), 32)
SN: append new LSB bits to already extracted bits
#define APPEND_TS_BITS | ( | ext_no, | |
base, | |||
bits, | |||
bits_nr | |||
) |
APPEND_BITS(TS, ext_no, \ (base)->ts, (base)->ts_nr, \ (bits), (bits_nr), 32)
TS: append new LSB bits to already extracted bits
#define IPV4_DYN_PART_SIZE 6 |
The size (in bytes) of the IPv4 dynamic part.
According to RFC3095 section 5.7.7.4: 1 (TOS) + 1 (TTL) + 2 (IP-ID) + 1 (flags) + 1 (header list) = 6 bytes
The size of the generic extension header list field is considered constant because generic extension header list is not supported yet and thus 1 byte of zero is used.
#define WEIGHT_NEW 1 |
Constant to compute inter-arrival time between the received packets
#define WEIGHT_OLD 1 |
Constant to compute inter-arrival time between the received packets
void* d_generic_create | ( | void | ) |
Create the generic decompression context.
This function is one of the functions that must exist in one profile for the framework to work.
References list_decomp::check_index, compute_crc_dynamic(), d_generic_context::compute_crc_dynamic, compute_crc_static(), d_generic_context::compute_crc_static, list_decomp::create_item, list_decomp::encode_extension, list_decomp::free_table, list_decomp::get_ext_size, d_generic_context::inner_ip_changes, d_generic_context::inner_ip_id_offset_ctxt, ip_id_offset_free(), ip_id_offset_new(), d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_generic_context::next_header_proto, d_generic_context::outer_ip_changes, d_generic_context::outer_ip_id_offset_ctxt, rohc_debugf, and zfree.
Referenced by d_ip_create(), d_rtp_create(), d_udp_create(), and d_udp_lite_create().
int d_generic_decode | ( | struct rohc_decomp * | decomp, |
struct d_context * | context, | ||
const unsigned char *const | rohc_packet, | ||
const unsigned int | rohc_length, | ||
const size_t | add_cid_len, | ||
const size_t | large_cid_len, | ||
unsigned char * | dest | ||
) |
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.
decomp | The ROHC decompressor |
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet |
add_cid_len | The length of the optional Add-CID field |
large_cid_len | The length of the optional large CID field |
dest | OUT: The decoded IP packet |
References d_generic_context::detect_packet_type, NO_CONTEXT, PACKET_IR, PACKET_IR_DYN, d_generic_context::packet_type, PACKET_UO_0, PACKET_UO_1, PACKET_UO_1_ID, PACKET_UO_1_RTP, PACKET_UO_1_TS, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, rohc_debugf, ROHC_ERROR, rohc_get_packet_descr(), d_context::specific, d_context::state, and STATIC_CONTEXT.
Referenced by d_udp_lite_decode().
void d_generic_destroy | ( | void * | 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 |
References list_decomp::free_table, d_generic_context::inner_ip_changes, d_generic_context::inner_ip_id_offset_ctxt, ip_id_offset_free(), LIST_COMP_WINDOW, d_generic_context::list_decomp1, d_generic_context::list_decomp2, list_destroy(), list_decomp::list_table, d_generic_context::outer_ip_changes, d_generic_context::outer_ip_id_offset_ctxt, d_generic_context::specific, and zfree.
Referenced by d_rtp_create(), d_udp_create(), and d_udp_lite_create().
int d_generic_get_sn | ( | struct d_context * | 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 |
References rohc_lsb_get_ref(), d_generic_context::sn_lsb_ctxt, and d_context::specific.