|
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_internal.h"#include "rohc_time.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 "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 (const struct d_context *const context, rohc_trace_callback_t trace_callback, const int profile_id) |
| Create the generic decompression context. | |
| void | d_generic_destroy (void *const 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 | ( | const struct d_context *const | context, |
| rohc_trace_callback_t | trace_callback, | ||
| 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_callback | The function to call for printing traces |
| profile_id | The ID of the associated decompression profile |
References list_decomp::check_index, d_generic_context::compute_crc_dynamic, compute_crc_dynamic(), compute_crc_static(), d_generic_context::compute_crc_static, list_decomp::create_item, d_context::decompressor, list_decomp::encode_extension, list_decomp::free_table, list_decomp::get_ext_size, d_profile::id, 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, d_context::profile, list_decomp::profile_id, rohc_error, ROHC_TRACE_DECOMP, list_decomp::trace_callback, 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 dest, d_generic_context::detect_packet_type, d_profile::id, 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, d_context::profile, rohc_decomp_debug, ROHC_ERROR, rohc_get_packet_descr(), ROHC_TRACE_DECOMP, rohc_warning, d_context::specific, d_context::state, and STATIC_CONTEXT.
Referenced by d_udp_lite_decode().
| 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 |
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.
1.7.6.1