|
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 <assert.h>
Defines | |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | IPV4_DYN_PART_SIZE 6 |
| The size (in bytes) of the IPv4 dynamic part. | |
Functions | |
| int | decode_irdyn (struct rohc_decomp *decomp, struct d_context *context, unsigned char *head, unsigned char *packet, unsigned char *dest, int plen) |
| Decode one IR-DYN packet. | |
| int | decode_uo1 (struct rohc_decomp *decomp, struct d_context *context, unsigned char *head, unsigned char *packet, unsigned char *dest, int plen) |
| Decode one UO-1 packet. | |
| int | decode_uo0 (struct rohc_decomp *decomp, struct d_context *context, unsigned char *head, unsigned char *packet, unsigned char *dest, int plen) |
| Decode one UO-0 packet. | |
| int | do_decode_uo0_and_uo1 (struct d_context *context, const unsigned char *packet, unsigned char *dest, int *plen, int sn_bits, int nb_of_sn_bits, int *id, int nb_of_id_bits, int *id2, int *sn, int *calc_crc) |
| Decode one UO-0 or UO-1 packet. | |
| int | decode_uor2 (struct rohc_decomp *decomp, struct d_context *context, unsigned char *head, unsigned char *packet, unsigned char *dest, int plen) |
| Decode one UOR-2 packet. | |
| int | do_decode_uor2 (struct rohc_decomp *decomp, struct d_context *context, unsigned char *packet, unsigned char *dest, int *plen, int *id, int *id2, int *sn, int *sn_size, int sn_bits, int ext, int *calc_crc) |
| Decode one UOR-2 packet. | |
| int | decode_extension0 (unsigned char *packet, unsigned int length, int packet_type, int *sn, int *ip_id, int *ts) |
| Decode the extension 0 of the UOR-2 packet. | |
| int | decode_extension1 (unsigned char *packet, unsigned int length, int packet_type, int *sn, int *ip_id, int *ts) |
| Decode the extension 1 of the UOR-2 packet. | |
| int | decode_extension2 (unsigned char *packet, unsigned int length, int packet_type, int *sn, int *ip_id, int *ip_id2, int *ts) |
| Decode the extension 2 of the UOR-2 packet. | |
| int | decode_extension3 (struct rohc_decomp *decomp, struct d_context *context, unsigned char *packet, unsigned int length, int *sn, int *sn_size, int *is_id_updated, int *is_id2_updated, int *is_rtp_present, int *is_pt_updated) |
| Decode the extension 3 of the UOR-2 packet. | |
| int | extension_type (const unsigned char *packet) |
| Find out which extension is carried by the UOR-2 packet. | |
| int | d_decode_static_ip (const unsigned char *packet, const unsigned int length, struct d_generic_changes *info) |
| Decode the IP static part of a ROHC packet. | |
| int | d_decode_static_ip4 (const unsigned char *packet, const unsigned int length, struct ip_packet *ip) |
| Decode the IPv4 static part of a ROHC packet. | |
| int | d_decode_static_ip6 (const unsigned char *packet, const unsigned int length, struct ip_packet *ip) |
| Decode the IPv6 static part of a ROHC packet. | |
| int | d_decode_dynamic_ip (const unsigned char *packet, unsigned int length, struct d_generic_changes *info, struct list_decomp *decomp) |
| Decode the IP dynamic part of a ROHC packet. | |
| int | d_decode_dynamic_ip4 (const unsigned char *packet, unsigned int length, struct ip_packet *ip, int *rnd, int *nbo) |
| Decode the IPv4 dynamic part of a ROHC packet. | |
| int | d_decode_dynamic_ip6 (const unsigned char *packet, unsigned int length, struct ip_packet *ip, struct list_decomp *decomp, struct d_generic_changes *info) |
| Decode the IPv6 dynamic part of a ROHC packet. | |
| int | decode_outer_header_flags (struct d_context *context, unsigned char *flags, unsigned char *fields, unsigned int length, struct d_generic_changes *info, int *updated_id) |
| Decode the outer IP header flags and fields. | |
| int | decode_inner_header_flags (struct d_context *context, unsigned char *flags, unsigned char *fields, unsigned int length, struct d_generic_changes *info) |
| Decode the inner IP header flags and fields. | |
| unsigned int | build_uncompressed_ip (struct d_generic_changes *active, unsigned char *dest, unsigned int payload_size, struct list_decomp *decomp) |
| Build an uncompressed IP header. | |
| unsigned int | build_uncompressed_ip4 (struct d_generic_changes *active, unsigned char *dest, unsigned int payload_size) |
| Build an uncompressed IPv4 header. | |
| unsigned int | build_uncompressed_ip6 (struct d_generic_changes *active, unsigned char *dest, unsigned int payload_size, struct list_decomp *decomp) |
| Build an uncompressed IPv6 header. | |
| void | copy_generic_changes (struct d_generic_changes *dst, struct d_generic_changes *src) |
| Copy the header changes object into another one. | |
| int | cmp_generic_changes (struct d_generic_changes *first, struct d_generic_changes *second) |
| Compare two header changes objects. | |
| void | sync_on_failure (struct d_generic_context *context) |
| Replace the active header changes with the last ones. | |
| void | synchronize (struct d_generic_context *context) |
| Replace last header changes with the active ones. | |
| void | update_inter_packet (struct d_generic_context *context) |
| Update the inter-packet time, a sort of average over the last inter-packet times. | |
| int | act_on_crc_failure (struct rohc_decomp *decomp, struct d_context *context, unsigned char *packet, unsigned char *dest, int sn_size, int *sn, int sn_bits, int *payload_size, int *id, int id_size, int *id2, int *calc_crc, int real_crc, int ext) |
| Try to repair the SN in one of two different ways. | |
| int | check_id (struct list_decomp *decomp, int gen_id) |
| Check if the gen_id is present in list table. | |
| int | get_bit_index (unsigned char byte, int index) |
| Get the bit in the byte at the specified index. | |
| int | check_ip6_index (struct list_decomp *decomp, int index) |
| Check if the index is correct in IPv6 table. | |
| int | encode_ip6_extension (struct d_generic_changes *active, struct list_decomp *decomp, unsigned char *dest) |
| Build an extension list in IPv6 header. | |
| void | create_ip6_item (const unsigned char *data, int length, int index, struct list_decomp *decomp) |
| Create an IPv6 item extension list. | |
| void | ip6_d_init_table (struct list_decomp *decomp) |
| Initialize the tables IPv6 extension in decompressor. | |
| int | get_ip6_ext_size (const unsigned char *ext) |
| Get the size of the extension in bytes. | |
| void * | d_generic_create (void) |
| Create the generic decompression context. | |
| void | d_generic_destroy (void *context) |
| Destroy the context. | |
| int | d_algo_list_decompress (struct list_decomp *decomp, const unsigned char *packet) |
| Algorithm of list decompression. | |
| int | decode_type_0 (struct list_decomp *decomp, const unsigned char *packet, int gen_id, int ps, int m) |
| Decode an extension list type 0. | |
| int | decode_type_1 (struct list_decomp *decomp, const unsigned char *packet, int gen_id, int ps, int m, int ref_id) |
| Decode an extension list type 1. | |
| int | decode_type_2 (struct list_decomp *decomp, const unsigned char *packet, int gen_id, int ps, int ref_id) |
| Decode an extension list type 2. | |
| int | decode_type_3 (struct list_decomp *decomp, const unsigned char *packet, int gen_id, int ps, int m, int ref_id) |
| Decode an extension list type 3. | |
| int | d_generic_decode_ir (struct rohc_decomp *decomp, struct d_context *context, unsigned char *packet, int plen, int large_cid_len, int is_addcid_used, unsigned char *dest) |
| Decode one IR packet. | |
| unsigned int | d_generic_detect_ir_size (struct d_context *context, unsigned char *packet, unsigned int plen, unsigned int large_cid_len) |
| Find the length of the IR header. | |
| unsigned int | d_generic_detect_ir_dyn_size (struct d_context *context, unsigned char *packet, unsigned int plen, unsigned int large_cid_len) |
| Find the length of the IR-DYN header. | |
| int | d_generic_decode (struct rohc_decomp *decomp, struct d_context *context, unsigned char *packet, int size, int second_byte, unsigned char *dest) |
| Decode one IR-DYN, UO-0, UO-1 or UOR-2 packet, but not IR packet. | |
| int | d_generic_get_sn (struct d_context *context) |
| Get the reference SN value of the context. | |
| int | find_packet_type (struct rohc_decomp *decomp, struct d_context *context, const unsigned char *packet, int second_byte) |
| Find out of which type is the ROHC packet. | |
ROHC generic decompression context for IP-only, UDP and UDP Lite profiles.
| #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.
Referenced by d_decode_dynamic_ip4(), d_generic_detect_ir_dyn_size(), and d_generic_detect_ir_size().
| #define MIN | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (a) : (b)) |
Get the minimum of two values
Referenced by decode_type_2(), and decode_type_3().
| int act_on_crc_failure | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int | sn_size, | ||
| int * | sn, | ||
| int | sn_bits, | ||
| int * | payload_size, | ||
| int * | id, | ||
| int | id_size, | ||
| int * | id2, | ||
| int * | calc_crc, | ||
| int | real_crc, | ||
| int | ext | ||
| ) |
Try to repair the SN in one of two different ways.
TODO: check this function
| decomp | The ROHC decompressor |
| context | The decompression context |
| packet | The ROHC packet with a wrong CRC |
| dest | The decoded IP packet |
| sn_size | The number of bits used to code the SN |
| sn | OUT: The Sequence Number (SN) value |
| sn_bits | The LSB part of the SN |
| payload_size | OUT: The length of the ROHC payload |
| id | OUT: The outer IP-ID |
| id_size | The number of bits used to code the IP-ID |
| id2 | OUT: The inner IP-ID |
| calc_crc | OUT: The computed CRC |
| real_crc | The CRC transmitted in the ROHC packet |
| ext | Whether the UOR-2 packet owns an extension or not |
References d_generic_context::counter, CRC_ACTION, d_generic_context::current_packet_time, d_get_lsb_old_ref(), d_get_lsb_ref(), d_ip_id_update(), d_lsb_decode(), d_lsb_sync_ref(), d_lsb_update(), do_decode_uo0_and_uo1(), do_decode_uor2(), d_generic_context::inter_arrival_time, d_generic_context::ip_id1, d_generic_context::ip_id2, d_generic_context::last_packet_time, d_generic_context::multiple_ip, 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_CRC, d_generic_context::sn, d_context::specific, sync_on_failure(), synchronize(), and update_inter_packet().
Referenced by decode_uo0(), decode_uo1(), and decode_uor2().
| unsigned int build_uncompressed_ip | ( | struct d_generic_changes * | active, |
| unsigned char * | dest, | ||
| unsigned int | payload_size, | ||
| struct list_decomp * | decomp | ||
| ) |
Build an uncompressed IP header.
| active | The IP header changes |
| dest | The buffer to store the IP header (MUST be at least of sizeof(struct iphdr) or sizeof(struct ip6_hdr) bytes depending on the IP version) |
| payload_size | The length of the IP payload |
| decomp | The list decompressor (IPv6 only) |
References build_uncompressed_ip4(), build_uncompressed_ip6(), d_generic_changes::ip, ip_get_version(), and IPV4.
Referenced by d_generic_decode_ir(), decode_irdyn(), do_decode_uo0_and_uo1(), and do_decode_uor2().
| unsigned int build_uncompressed_ip4 | ( | struct d_generic_changes * | active, |
| unsigned char * | dest, | ||
| unsigned int | payload_size | ||
| ) |
Build an uncompressed IPv4 header.
| active | The IPv4 header changes |
| dest | The buffer to store the IPv4 header (MUST be at least of sizeof(struct iphdr) bytes) |
| payload_size | The length of the IPv4 payload |
References ip_packet::header, d_generic_changes::ip, d_generic_changes::nbo, rohc_debugf, and ip_packet::v4.
Referenced by build_uncompressed_ip().
| unsigned int build_uncompressed_ip6 | ( | struct d_generic_changes * | active, |
| unsigned char * | dest, | ||
| unsigned int | payload_size, | ||
| struct list_decomp * | decomp | ||
| ) |
Build an uncompressed IPv6 header.
| active | The IPv6 header changes |
| dest | The buffer to store the IPv6 header (MUST be at least of sizeof(struct ip6_hdr) bytes) |
| payload_size | The length of the IPv6 payload |
| decomp | The list decompressor |
References d_generic_changes::complist, list_decomp::counter_list, list_decomp::encode_extension, c_list::first_elt, ip_packet::header, d_generic_changes::ip, list_elt::item, list_decomp::list_decomp, list_decomp::list_table, rohc_debugf, d_generic_changes::size_list, size_list(), item::type, and ip_packet::v6.
Referenced by build_uncompressed_ip().
| int check_id | ( | struct list_decomp * | decomp, |
| int | gen_id | ||
| ) |
Check if the gen_id is present in list table.
| decomp | The list decompressor |
| gen_id | The specified id |
References c_list::gen_id, LIST_COMP_WINDOW, and list_decomp::list_table.
Referenced by decode_type_0(), decode_type_1(), decode_type_2(), and decode_type_3().
| int check_ip6_index | ( | struct list_decomp * | decomp, |
| int | index | ||
| ) |
Check if the index is correct in IPv6 table.
| decomp | The list decompressor |
| index | The specified index |
References rohc_debugf.
Referenced by d_generic_create().
| int cmp_generic_changes | ( | struct d_generic_changes * | first, |
| struct d_generic_changes * | second | ||
| ) |
Compare two header changes objects.
| first | One header changes object |
| second | Another header changes object |
References d_generic_changes::ip, d_generic_changes::nbo, d_generic_changes::next_header, d_generic_changes::next_header_len, and d_generic_changes::rnd.
Referenced by d_generic_decode().
| void copy_generic_changes | ( | struct d_generic_changes * | dst, |
| struct d_generic_changes * | src | ||
| ) |
Copy the header changes object into another one.
| dst | The destination header changes |
| src | The source header changes |
References d_generic_changes::ip, d_generic_changes::nbo, d_generic_changes::next_header, d_generic_changes::next_header_len, d_generic_changes::rnd, and rohc_debugf.
Referenced by sync_on_failure(), and synchronize().
| void create_ip6_item | ( | const unsigned char * | data, |
| int | length, | ||
| int | index, | ||
| struct list_decomp * | decomp | ||
| ) |
Create an IPv6 item extension list.
| data | The data in the item |
| length | The length of the item |
| index | The index of the item in based table |
| decomp | The list decompressor |
References item::ahhdr, list_decomp::based_table, item::data, item::dest, item::hbh, item::header, ip6_ahhdr::ip6ah_len, ip6_ahhdr::ip6ah_nxt, d_translation::known, item::length, rohc_debugf, item::rthdr, list_decomp::trans_table, and zfree.
Referenced by d_generic_create().
| int d_algo_list_decompress | ( | struct list_decomp * | decomp, |
| const unsigned char * | packet | ||
| ) |
Algorithm of list decompression.
| decomp | The list decompressor |
| packet | The ROHC packet to decompress |
References decode_type_0(), decode_type_1(), decode_type_2(), decode_type_3(), GET_BIT_0_3, GET_BIT_4, GET_BIT_6_7, GET_REAL, list_decomp::list_decomp, m, and rohc_debugf.
Referenced by d_generic_detect_ir_dyn_size(), and d_generic_detect_ir_size().
| int d_decode_dynamic_ip | ( | const unsigned char * | packet, |
| unsigned int | length, | ||
| struct d_generic_changes * | info, | ||
| struct list_decomp * | decomp | ||
| ) |
Decode the IP dynamic part of a ROHC packet.
See 5.7.7.3 and 5.7.7.4 in RFC 3095 for details.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| info | The decoded IP header information |
| decomp | The list decompressor (only for IPv6) |
References d_decode_dynamic_ip4(), d_decode_dynamic_ip6(), d_generic_changes::ip, ip_get_version(), IPV4, d_generic_changes::nbo, and d_generic_changes::rnd.
Referenced by d_generic_decode_ir(), and decode_irdyn().
| int d_decode_dynamic_ip4 | ( | const unsigned char * | packet, |
| unsigned int | length, | ||
| struct ip_packet * | ip, | ||
| int * | rnd, | ||
| int * | nbo | ||
| ) |
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.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| ip | The decoded IP packet |
| rnd | Boolean to store whether the IP-ID is random or not |
| nbo | Boolean to store whether the IP-ID is in NBO or not |
References GET_BIT_0_7, GET_BIT_5, GET_BIT_6, GET_BIT_7, GET_NEXT_16_BITS, GET_REAL, ip_get_tos(), ip_get_ttl(), ip_set_tos(), ip_set_ttl(), IPV4_DYN_PART_SIZE, ipv4_get_df(), ipv4_get_id(), ipv4_set_df(), ipv4_set_id(), and rohc_debugf.
Referenced by d_decode_dynamic_ip().
| int d_decode_dynamic_ip6 | ( | const unsigned char * | packet, |
| unsigned int | length, | ||
| struct ip_packet * | ip, | ||
| struct list_decomp * | decomp, | ||
| struct d_generic_changes * | info | ||
| ) |
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.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| ip | The decoded IP packet |
| decomp | The list decompressor |
| info | The decoded IP header information |
References list_decomp::counter_list, c_list::first_elt, GET_BIT_0_7, get_elt(), ip_get_tos(), ip_get_ttl(), ip_set_tos(), ip_set_ttl(), list_elt::item, item::length, list_decomp::list_decomp, list_decomp::list_table, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, list_decomp::size_ext, d_generic_changes::size_list, and size_list().
Referenced by d_decode_dynamic_ip().
| int d_decode_static_ip | ( | const unsigned char * | packet, |
| const unsigned int | length, | ||
| struct d_generic_changes * | info | ||
| ) |
Decode the IP static part of a ROHC packet.
See 5.7.7.3 and 5.7.7.4 in RFC 3095 for details.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| info | The decoded IP header information |
References d_decode_static_ip4(), d_decode_static_ip6(), GET_BIT_4_7, d_generic_changes::ip, ip_new(), IPV4, IPV6, and rohc_debugf.
Referenced by d_generic_decode_ir().
| int d_decode_static_ip4 | ( | const unsigned char * | packet, |
| const unsigned int | length, | ||
| struct ip_packet * | ip | ||
| ) |
Decode the IPv4 static part of a ROHC packet.
See 5.7.7.4 in RFC 3095 for details.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| ip | The decoded IP packet |
References GET_BIT_0_7, GET_BIT_4_7, ip_get_protocol(), ip_set_daddr(), ip_set_protocol(), ip_set_saddr(), IPV4, ipv4_get_daddr(), ipv4_get_saddr(), rohc_debugf, ip_packet::version, and version.
Referenced by d_decode_static_ip().
| int d_decode_static_ip6 | ( | const unsigned char * | packet, |
| const unsigned int | length, | ||
| struct ip_packet * | ip | ||
| ) |
Decode the IPv6 static part of a ROHC packet.
See 5.7.7.3 in RFC 3095 for details.
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| ip | The decoded IP packet |
References GET_BIT_0_3, GET_BIT_0_7, GET_BIT_4_7, ip_packet::header, ip_set_daddr(), ip_set_protocol(), ip_set_saddr(), IPV6, IPV6_ADDR, IPV6_ADDR_FORMAT, ipv6_get_daddr(), ipv6_get_flow_label(), ipv6_get_saddr(), ipv6_set_flow_label(), rohc_debugf, ip_packet::v6, ip_packet::version, and version.
Referenced by d_decode_static_ip().
| 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 d_generic_context::active1, d_generic_context::active2, list_decomp::check_index, check_ip6_index(), d_generic_context::compute_crc_dynamic, compute_crc_dynamic(), d_generic_context::compute_crc_static, compute_crc_static(), create_ip6_item(), list_decomp::create_item, list_decomp::encode_extension, encode_ip6_extension(), d_generic_context::first_packet_processed, list_decomp::free_table, list_decomp::get_ext_size, get_ip6_ext_size(), ip6_d_init_table(), d_generic_context::last1, d_generic_context::last2, d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_generic_context::next_header_proto, 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, | ||
| unsigned char * | packet, | ||
| int | size, | ||
| int | second_byte, | ||
| unsigned char * | dest | ||
| ) |
Decode one IR-DYN, UO-0, UO-1 or UOR-2 packet, but not IR 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 |
| packet | The ROHC packet to decode |
| size | The length of the ROHC packet |
| second_byte | The offset for the second byte of the ROHC packet (depends on the CID encoding and the packet type) |
| dest | The decoded IP packet |
References d_generic_context::active1, d_generic_context::active2, cmp_generic_changes(), d_generic_context::current_packet_time, d_generic_decode(), decode_irdyn(), decode_uo0(), decode_uo1(), decode_uor2(), find_packet_type(), d_generic_changes::ip, ip_get_version(), IPV4, d_generic_context::last1, d_generic_context::last2, d_generic_context::multiple_ip, d_generic_changes::nbo, NO_CONTEXT, 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_generic_changes::rnd, rohc_debugf, ROHC_ERROR, ROHC_NEED_REPARSE, d_context::specific, d_context::state, STATIC_CONTEXT, and synchronize().
Referenced by d_generic_decode(), and d_udp_lite_decode().
| int d_generic_decode_ir | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | packet, | ||
| int | plen, | ||
| int | large_cid_len, | ||
| int | is_addcid_used, | ||
| unsigned char * | dest | ||
| ) |
Decode one IR 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 |
| packet | The ROHC packet to decode |
| plen | The length of the ROHC packet to decode |
| large_cid_len | The length of the large CID field |
| is_addcid_used | Whether the add-CID field is present or not |
| dest | The decoded IP packet |
References d_generic_context::active1, d_generic_context::active2, d_generic_context::build_next_header, build_uncompressed_ip(), c_add_wlsb(), d_generic_context::counter, d_generic_context::current_packet_time, d_decode_dynamic_ip(), d_decode_static_ip(), d_generic_context::decode_dynamic_next_header, d_generic_context::decode_static_next_header, d_generic_context::first_packet_processed, FULL_CONTEXT, GET_BIT_0, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_generic_changes::ip, ip_get_hdrlen(), ip_get_protocol(), ip_get_version(), d_generic_context::last1, d_generic_context::last2, d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_generic_context::multiple_ip, d_generic_changes::next_header, d_generic_changes::next_header_len, d_generic_context::next_header_proto, PACKET_IR, d_generic_context::packet_type, rohc_debugf, ROHC_ERROR, d_generic_changes::size_list, d_context::specific, d_context::state, synchronize(), and update_inter_packet().
Referenced by d_udp_lite_decode_ir().
| 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 d_generic_context::active1, d_generic_context::active2, destroy_list(), list_decomp::free_table, d_generic_context::last1, d_generic_context::last2, LIST_COMP_WINDOW, d_generic_context::list_decomp1, d_generic_context::list_decomp2, list_decomp::list_table, d_generic_context::specific, list_decomp::temp_list, and zfree.
Referenced by d_rtp_create(), d_udp_create(), d_udp_destroy(), d_udp_lite_create(), and d_udp_lite_destroy().
| unsigned int d_generic_detect_ir_dyn_size | ( | struct d_context * | context, |
| unsigned char * | packet, | ||
| unsigned int | plen, | ||
| unsigned int | large_cid_len | ||
| ) |
Find the length of the IR-DYN header.
This function is one of the functions that must exist in one profile for the framework to work.
Basic structure of the 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
+---+---+---+---+---+---+---+---+
: :
8 / Payload / variable length
: :
- - - - - - - - - - - - - - - -
The function computes the length of the fields 2 + 4-7, ie. the first byte, the Profile and CRC fields and the dynamic chains (outer and inner IP headers).
| context | The decompression context |
| packet | The IR-DYN packet after the Add-CID byte if present (ie. field 2 in the figure) |
| plen | The length of the IR-DYN packet minus the Add-CID byte |
| large_cid_len | The size of the large CID field (ie. field 3 in the figure) |
References d_generic_context::active1, d_generic_context::active2, d_algo_list_decompress(), d_generic_changes::ip, ip_get_protocol(), ip_get_version(), IPV4, IPV4_DYN_PART_SIZE, d_generic_context::list_decomp1, d_generic_context::list_decomp2, list_decomp::size_ext, d_context::specific, and version.
Referenced by ip_detect_ir_dyn_size(), and rtp_detect_ir_dyn_size().
| unsigned int d_generic_detect_ir_size | ( | struct d_context * | context, |
| unsigned char * | packet, | ||
| unsigned int | plen, | ||
| unsigned int | large_cid_len | ||
| ) |
Find the length of the IR header.
This function is one of the functions that must exist in one profile for the framework to work.
Basic structure of the 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
+---+---+---+---+---+---+---+---+
| |
9 | Payload | variable length
| |
- - - - - - - - - - - - - - - -
The function computes the length of the fields 2 + 4-7, ie. the first byte, the Profile and CRC fields and the static and dynamic chains (outer and inner IP headers).
| context | The decompression context |
| packet | The pointer on the IR packet minus the Add-CID byte (ie. the field 2 in the figure) |
| plen | The length of the IR packet minus the Add-CID byte |
| large_cid_len | The size of the large CID field (ie. the field 3 in the figure) |
References d_algo_list_decompress(), GET_BIT_0, GET_REAL, d_profile::get_static_part, IPV4, IPV4_DYN_PART_SIZE, IPV6, d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_context::profile, rohc_debugf, list_decomp::size_ext, and d_context::specific.
Referenced by ip_detect_ir_size(), and rtp_detect_ir_size().
| 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 d_get_lsb_ref(), d_generic_context::sn, and d_context::specific.
| int decode_extension0 | ( | unsigned char * | packet, |
| unsigned int | length, | ||
| int | packet_type, | ||
| int * | sn, | ||
| int * | ip_id, | ||
| int * | ts | ||
| ) |
Decode the extension 0 of the UOR-2 packet.
Actions taken:
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| packet_type | The type of ROHC packet |
| sn | IN/OUT: The updated SN value |
| ip_id | IN/OUT: The updated IP-ID value |
| ts | OUT: The TS value |
References GET_BIT_0_2, GET_BIT_3_5, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, and rohc_debugf.
Referenced by do_decode_uor2().
| int decode_extension1 | ( | unsigned char * | packet, |
| unsigned int | length, | ||
| int | packet_type, | ||
| int * | sn, | ||
| int * | ip_id, | ||
| int * | ts | ||
| ) |
Decode the extension 1 of the UOR-2 packet.
Actions taken:
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| packet_type | The type of ROHC packet |
| sn | IN/OUT: The updated SN value |
| ip_id | IN/OUT: The updated IP-ID value |
| ts | OUT: The TS value |
References GET_BIT_0_2, GET_BIT_3_5, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, and rohc_debugf.
Referenced by do_decode_uor2().
| int decode_extension2 | ( | unsigned char * | packet, |
| unsigned int | length, | ||
| int | packet_type, | ||
| int * | sn, | ||
| int * | ip_id, | ||
| int * | ip_id2, | ||
| int * | ts | ||
| ) |
Decode the extension 2 of the UOR-2 packet.
Actions taken:
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| packet_type | The type of ROHC packet |
| sn | IN/OUT: The updated SN value |
| ip_id | IN/OUT: The updated inner IP-ID value |
| ip_id2 | OUT: The outer IP-ID value |
| ts | OUT: The TS value |
References GET_BIT_0_2, GET_BIT_3_5, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, and rohc_debugf.
Referenced by do_decode_uor2().
| int decode_extension3 | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | packet, | ||
| unsigned int | length, | ||
| int * | sn, | ||
| int * | sn_size, | ||
| int * | is_id_updated, | ||
| int * | is_id2_updated, | ||
| int * | is_rtp_present, | ||
| int * | is_pt_updated | ||
| ) |
Decode the extension 3 of the UOR-2 packet.
Actions taken:
| decomp | The ROHC decompressor |
| context | The decompression context |
| packet | The ROHC packet to decode |
| length | The length of the ROHC packet |
| sn | IN/OUT: The updated SN value |
| sn_size | IN/OUT: The new SN size |
| is_id_updated | OUT: Whether the outer IP-ID is updated by the extension or not |
| is_id2_updated | OUT: Whether the inner IP-ID is updated by the extension or not |
| is_rtp_present | OUT: Whether RTP flags & fields are present or not |
| is_pt_updated | OUT: Whether RTP PT is updated by the extension or not |
References d_generic_context::active1, d_generic_context::active2, d_add_ts_stride(), d_change_mode_feedback(), d_decode_ts(), d_lsb_decode(), d_sdvalue_decode(), d_sdvalue_size(), decode_inner_header_flags(), decode_outer_header_flags(), GET_BIT_0, GET_BIT_1, GET_BIT_2, GET_BIT_3, GET_BIT_3_4, GET_BIT_4, GET_BIT_5, GET_BIT_6_7, GET_BIT_7, GET_NEXT_16_BITS, GET_REAL, d_profile::id, d_generic_changes::ip, ipv4_get_id(), ipv4_set_id(), d_rtp_context::m, MAX_BITS_IN_4_BYTE_SDVL, d_context::mode, d_generic_context::multiple_ip, d_generic_context::packet_type, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, d_context::profile, d_rtp_context::pt, rohc_debugf, ROHC_PROFILE_RTP, d_rtp_context::rp, d_rtp_context::rx, d_generic_context::sn, d_context::specific, d_generic_context::specific, d_rtp_context::timestamp, ts_deducted(), d_rtp_context::ts_received, d_rtp_context::ts_received_size, and d_rtp_context::ts_sc.
Referenced by do_decode_uor2().
| int decode_inner_header_flags | ( | struct d_context * | context, |
| unsigned char * | flags, | ||
| unsigned char * | fields, | ||
| unsigned int | length, | ||
| struct d_generic_changes * | info | ||
| ) |
Decode the inner IP header flags and fields.
Store the values in an IP header info structure.
Inner IP header flags (5.7.5):
0 1 2 3 4 5 6 7
..... ..... ..... ..... ..... ..... ..... .....
| TOS | TTL | DF | PR | IPX | NBO | RND | ip2 | if ip = 1
..... ..... ..... ..... ..... ..... ..... .....
Inner IP header fields (5.7.5):
..... ..... ..... ..... ..... ..... ..... .....
| Type of Service/Traffic Class | if TOS = 1
..... ..... ..... ..... ..... ..... ..... .....
| Time to Live/Hop Limit | if TTL = 1
..... ..... ..... ..... ..... ..... ..... .....
| Protocol/Next Header | if PR = 1
..... ..... ..... ..... ..... ..... ..... .....
/ IP extension headers / variable,
..... ..... ..... ..... ..... ..... ..... ..... if IPX = 1
| context | The decompression context |
| flags | The ROHC flags that indicate which IP fields are present in the packet |
| fields | The ROHC packet part that contains some IP header fields |
| length | The length of the ROHC packet part that contains some IP header fields |
| info | The IP header info to store the decoded values in |
References GET_BIT_1, GET_BIT_2, GET_BIT_3, GET_BIT_4, GET_BIT_5, GET_BIT_6, GET_BIT_7, GET_REAL, d_profile::id, d_generic_changes::ip, ip_get_version(), ip_set_protocol(), ip_set_tos(), ip_set_ttl(), IPV4, ipv4_get_df(), ipv4_set_df(), d_generic_changes::nbo, d_context::profile, d_generic_changes::rnd, rohc_debugf, and ROHC_PROFILE_RTP.
Referenced by decode_extension3(), and decode_outer_header_flags().
| int decode_irdyn | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | head, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int | plen | ||
| ) |
Decode one IR-DYN packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| head | The first byte the the ROHC packet |
| packet | The end of the ROHC packet to decode |
| dest | The decoded IP packet |
| plen | The length of the ROHC packet |
References d_generic_context::active1, d_generic_context::active2, d_generic_context::build_next_header, build_uncompressed_ip(), c_add_wlsb(), d_generic_context::counter, d_decode_dynamic_ip(), d_generic_context::decode_dynamic_next_header, FULL_CONTEXT, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_generic_changes::ip, ip_get_hdrlen(), d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_generic_context::multiple_ip, d_generic_changes::next_header, d_generic_changes::next_header_len, rohc_debugf, ROHC_ERROR, d_generic_changes::size_list, d_context::specific, d_context::state, synchronize(), and update_inter_packet().
Referenced by d_generic_decode().
| int decode_outer_header_flags | ( | struct d_context * | context, |
| unsigned char * | flags, | ||
| unsigned char * | fields, | ||
| unsigned int | length, | ||
| struct d_generic_changes * | info, | ||
| int * | updated_id | ||
| ) |
Decode the outer IP header flags and fields.
Store the values in an IP header info structure.
Outer IP header flags (5.7.5):
0 1 2 3 4 5 6 7
..... ..... ..... ..... ..... ..... ..... .....
| TOS2| TTL2| DF2 | PR2 |IPX2 |NBO2 |RND2 | I2 | if ip2 = 1
..... ..... ..... ..... ..... ..... ..... .....
Outer IP header fields
..... ..... ..... ..... ..... ..... ..... .....
| Type of Service/Traffic Class | if TOS2 = 1
..... ..... ..... ..... ..... ..... ..... .....
| Time to Live/Hop Limit | if TTL2 = 1
..... ..... ..... ..... ..... ..... ..... .....
| Protocol/Next Header | if PR2 = 1
..... ..... ..... ..... ..... ..... ..... .....
/ IP extension header(s) / variable,
..... ..... ..... ..... ..... ..... ..... ..... if IPX2 = 1
| IP-ID | 2 octets,
..... ..... ..... ..... ..... ..... ..... ..... if I2 = 1
| context | The decompression context |
| flags | The ROHC flags that indicate which IP fields are present in the packet |
| fields | The ROHC packet part that contain some IP header fields |
| length | The length of the ROHC packet part that contains some IP header fields |
| info | The IP header info to store the decoded values in |
| updated_id | The boolean to store whether the IP-ID is updated or not |
References decode_inner_header_flags(), GET_BIT_0, GET_NEXT_16_BITS, GET_REAL, d_generic_changes::ip, ip_get_version(), IPV4, ipv4_get_id(), ipv4_set_id(), and rohc_debugf.
Referenced by decode_extension3().
| int decode_type_0 | ( | struct list_decomp * | decomp, |
| const unsigned char * | packet, | ||
| int | gen_id, | ||
| int | ps, | ||
| int | m | ||
| ) |
Decode an extension list type 0.
| decomp | The list decompressor |
| packet | The ROHC packet to decompress |
| gen_id | The id of the current list |
| ps | The ps field |
| m | The m fiel |
References list_decomp::based_table, check_id(), list_decomp::counter, list_decomp::counter_list, list_decomp::create_item, empty_list(), c_list::first_elt, c_list::gen_id, GET_BIT_0_2, GET_BIT_0_6, GET_BIT_3, GET_BIT_4_6, GET_BIT_7, list_decomp::get_ext_size, insert_elt(), d_translation::known, L, LIST_COMP_WINDOW, list_decomp::list_table, m, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, and list_decomp::trans_table.
Referenced by d_algo_list_decompress().
| int decode_type_1 | ( | struct list_decomp * | decomp, |
| const unsigned char * | packet, | ||
| int | gen_id, | ||
| int | ps, | ||
| int | m, | ||
| int | ref_id | ||
| ) |
Decode an extension list type 1.
| decomp | The list decompressor |
| packet | The ROHC packet to decompress |
| gen_id | The id of the current list |
| ps | The ps field |
| m | The m fiel |
| ref_id | The id of the reference list |
References list_decomp::based_table, check_id(), list_decomp::check_index, list_decomp::counter, list_decomp::counter_list, list_decomp::create_item, empty_list(), c_list::first_elt, c_list::gen_id, GET_BIT_0_2, GET_BIT_0_6, GET_BIT_3, GET_BIT_4_6, GET_BIT_7, get_bit_index(), get_elt(), list_decomp::get_ext_size, list_elt::index_table, insert_elt(), list_elt::item, d_translation::known, L, LIST_COMP_WINDOW, list_decomp::list_table, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, size_list(), and list_decomp::trans_table.
Referenced by d_algo_list_decompress().
| int decode_type_2 | ( | struct list_decomp * | decomp, |
| const unsigned char * | packet, | ||
| int | gen_id, | ||
| int | ps, | ||
| int | ref_id | ||
| ) |
Decode an extension list type 2.
| decomp | The list decompressor |
| packet | The ROHC packet to decompress |
| gen_id | The id of the current list |
| ps | The ps field |
| ref_id | The id of the reference list |
References check_id(), list_decomp::counter, list_decomp::counter_list, empty_list(), c_list::first_elt, c_list::gen_id, get_bit_index(), get_elt(), list_elt::index_table, insert_elt(), list_elt::item, L, LIST_COMP_WINDOW, list_decomp::list_table, MIN, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, and size_list().
Referenced by d_algo_list_decompress().
| int decode_type_3 | ( | struct list_decomp * | decomp, |
| const unsigned char * | packet, | ||
| int | gen_id, | ||
| int | ps, | ||
| int | m, | ||
| int | ref_id | ||
| ) |
Decode an extension list type 3.
| decomp | The list decompressor |
| packet | The ROHC packet to decompress |
| gen_id | The id of the current list |
| ps | The ps field |
| m | The m fiel |
| ref_id | The id of the reference list |
References list_decomp::based_table, check_id(), list_decomp::check_index, list_decomp::counter, list_decomp::counter_list, list_decomp::create_item, empty_list(), c_list::first_elt, c_list::gen_id, GET_BIT_0_2, GET_BIT_0_6, GET_BIT_3, GET_BIT_4_6, GET_BIT_7, get_bit_index(), get_elt(), list_decomp::get_ext_size, GET_REAL, list_elt::index_table, insert_elt(), list_elt::item, d_translation::known, L, LIST_COMP_WINDOW, list_decomp::list_table, MIN, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, size_list(), list_decomp::temp_list, and list_decomp::trans_table.
Referenced by d_algo_list_decompress().
| int decode_uo0 | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | head, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int | plen | ||
| ) |
Decode one UO-0 packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| head | The first byte the the ROHC packet |
| packet | The end of the ROHC packet to decode |
| dest | The decoded IP packet |
| plen | The length of the ROHC packet |
References act_on_crc_failure(), d_generic_context::active1, d_generic_context::active2, c_add_wlsb(), d_generic_changes::complist, d_generic_context::counter, d_add_ts(), d_ip_id_update(), d_lsb_sync_ref(), d_lsb_update(), do_decode_uo0_and_uo1(), GET_BIT_0_2, GET_BIT_3_6, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_profile::id, d_generic_changes::ip, ip_get_version(), d_generic_context::ip_id1, d_generic_context::ip_id2, IPV4, d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_rtp_context::m, d_generic_context::multiple_ip, d_context::profile, list_decomp::ref_ok, rohc_debugf, rohc_debugf_, ROHC_ERROR, ROHC_ERROR_CRC, ROHC_PROFILE_RTP, sn, d_generic_context::sn, d_context::specific, d_generic_context::specific, synchronize(), d_rtp_context::timestamp, d_rtp_context::ts_received_size, d_rtp_context::ts_sc, and update_inter_packet().
Referenced by d_generic_decode().
| int decode_uo1 | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | head, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int | plen | ||
| ) |
Decode one UO-1 packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| head | The first byte the the ROHC packet |
| packet | The end of the ROHC packet to decode |
| dest | The decoded IP packet |
| plen | The length of the ROHC packet |
References act_on_crc_failure(), d_generic_context::active1, d_generic_context::active2, c_add_wlsb(), d_generic_changes::complist, d_generic_context::counter, d_add_ts(), d_ip_id_update(), d_lsb_sync_ref(), d_lsb_update(), do_decode_uo0_and_uo1(), GET_BIT_0_2, GET_BIT_0_4, GET_BIT_0_5, GET_BIT_3_6, GET_BIT_3_7, GET_BIT_7, GET_REAL, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_profile::id, d_generic_changes::ip, ip_get_version(), d_generic_context::ip_id1, d_generic_context::ip_id2, IPV4, d_generic_context::list_decomp1, d_generic_context::list_decomp2, m, d_rtp_context::m, d_generic_context::multiple_ip, d_generic_context::packet_type, PACKET_UO_1, PACKET_UO_1_ID, PACKET_UO_1_RTP, PACKET_UO_1_TS, d_context::profile, list_decomp::ref_ok, rohc_debugf, rohc_debugf_, ROHC_ERROR, ROHC_ERROR_CRC, ROHC_PROFILE_RTP, sn, d_generic_context::sn, d_context::specific, d_generic_context::specific, synchronize(), d_rtp_context::timestamp, d_rtp_context::ts_received, d_rtp_context::ts_received_size, d_rtp_context::ts_sc, and update_inter_packet().
Referenced by d_generic_decode().
| int decode_uor2 | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | head, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int | plen | ||
| ) |
Decode one UOR-2 packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| head | The first byte the the ROHC packet |
| packet | The end of the ROHC packet to decode |
| dest | The decoded IP packet |
| plen | The length of the ROHC packet |
References act_on_crc_failure(), d_generic_context::active1, d_generic_context::active2, c_add_wlsb(), d_generic_changes::complist, d_generic_context::counter, d_add_ts(), d_ip_id_update(), d_lsb_sync_ref(), d_lsb_update(), do_decode_uor2(), FULL_CONTEXT, GET_BIT_0_4, GET_BIT_0_5, GET_BIT_0_6, GET_BIT_6, GET_BIT_7, GET_REAL, d_context::header_16_compressed, d_context::header_16_uncompressed, d_context::header_compressed_size, d_context::header_uncompressed_size, d_profile::id, d_generic_changes::ip, ip_get_version(), d_generic_context::ip_id1, d_generic_context::ip_id2, IPV4, d_generic_context::list_decomp1, d_generic_context::list_decomp2, m, d_rtp_context::m, d_generic_context::multiple_ip, d_generic_context::packet_type, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, d_context::profile, list_decomp::ref_ok, rohc_debugf, rohc_debugf_, ROHC_ERROR, ROHC_ERROR_CRC, ROHC_NEED_REPARSE, ROHC_PROFILE_RTP, sn, d_generic_context::sn, d_context::specific, d_generic_context::specific, d_context::state, synchronize(), d_rtp_context::timestamp, d_rtp_context::ts_received, d_rtp_context::ts_received_size, d_rtp_context::ts_sc, and update_inter_packet().
Referenced by d_generic_decode().
| int do_decode_uo0_and_uo1 | ( | struct d_context * | context, |
| const unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int * | plen, | ||
| int | sn_bits, | ||
| int | nb_of_sn_bits, | ||
| int * | id, | ||
| int | nb_of_id_bits, | ||
| int * | id2, | ||
| int * | sn, | ||
| int * | calc_crc | ||
| ) |
Decode one UO-0 or UO-1 packet.
| context | The decompression context |
| packet | The ROHC packet to decode |
| dest | The decoded IP packet |
| plen | IN/OUT: The length of the ROHC packet |
| sn_bits | The SN bits as they are transmitted in the ROHC packet |
| nb_of_sn_bits | The number of bits that code the SN field |
| id | The outer IP-ID |
| nb_of_id_bits | The number of bits that code the outer IP-ID field |
| id2 | The inner IP-ID |
| sn | The SN value |
| calc_crc | The computed CRC |
References d_generic_context::active1, d_generic_context::active2, d_generic_context::build_next_header, build_uncompressed_ip(), d_generic_changes::complist, d_generic_context::compute_crc_dynamic, d_generic_context::compute_crc_static, CRC_INIT_3, CRC_TYPE_3, d_decode_ts(), d_ip_id_decode(), d_generic_context::decode_uo_tail, GET_NEXT_16_BITS, d_profile::id, d_generic_changes::ip, ip_get_hdrlen(), ip_get_version(), d_generic_context::ip_id1, d_generic_context::ip_id2, IPV4, ipv4_get_id(), ipv4_set_id(), d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_rtp_context::m, d_generic_context::multiple_ip, d_generic_changes::next_header, d_generic_changes::next_header_len, d_generic_context::packet_type, PACKET_UO_0, d_context::profile, d_generic_changes::rnd, rohc_debugf, ROHC_PROFILE_RTP, d_generic_changes::size_list, size_list(), d_generic_context::sn, d_context::specific, d_generic_context::specific, d_rtp_context::timestamp, ts_deducted(), d_rtp_context::ts_received, d_rtp_context::ts_received_size, and d_rtp_context::ts_sc.
Referenced by act_on_crc_failure(), decode_uo0(), and decode_uo1().
| int do_decode_uor2 | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| unsigned char * | packet, | ||
| unsigned char * | dest, | ||
| int * | plen, | ||
| int * | id, | ||
| int * | id2, | ||
| int * | sn, | ||
| int * | sn_size, | ||
| int | sn_bits, | ||
| int | ext, | ||
| int * | calc_crc | ||
| ) |
Decode one UOR-2 packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| packet | The ROHC packet to decode |
| dest | The decoded IP packet |
| plen | IN/OUT: The length of the ROHC packet |
| id | The outer IP-ID |
| id2 | The inner IP-ID |
| sn | The SN value |
| sn_size | The SN size |
| sn_bits | The SN bits as they are transmitted in the ROHC packet |
| ext | Whether the UOR-2 packet owns an extension or not |
| calc_crc | The computed CRC |
References d_generic_context::active1, d_generic_context::active2, d_generic_context::build_next_header, build_uncompressed_ip(), d_generic_changes::complist, d_generic_context::compute_crc_dynamic, d_generic_context::compute_crc_static, CRC_INIT_6, CRC_INIT_7, CRC_TYPE_6, CRC_TYPE_7, d_decode_ts(), d_ip_id_decode(), d_lsb_decode(), decode_extension0(), decode_extension1(), decode_extension2(), decode_extension3(), d_generic_context::decode_uo_tail, extension_type(), GET_NEXT_16_BITS, d_profile::id, d_generic_changes::ip, ip_get_hdrlen(), ip_get_version(), d_generic_context::ip_id1, d_generic_context::ip_id2, IPV4, ipv4_get_id(), ipv4_set_id(), d_generic_context::list_decomp1, d_generic_context::list_decomp2, d_rtp_context::m, d_generic_context::multiple_ip, d_generic_changes::next_header, d_generic_changes::next_header_len, PACKET_EXT_0, PACKET_EXT_1, PACKET_EXT_2, PACKET_EXT_3, d_generic_context::packet_type, PACKET_UOR_2, PACKET_UOR_2_ID, PACKET_UOR_2_RTP, PACKET_UOR_2_TS, d_context::profile, d_rtp_context::pt, d_generic_changes::rnd, rohc_debugf, ROHC_PROFILE_RTP, d_rtp_context::rp, d_rtp_context::rx, d_generic_changes::size_list, size_list(), d_generic_context::sn, d_context::specific, d_generic_context::specific, d_rtp_context::timestamp, rtphdr::timestamp, ts_deducted(), d_rtp_context::ts_received, d_rtp_context::ts_received_size, and d_rtp_context::ts_sc.
Referenced by act_on_crc_failure(), and decode_uor2().
| int encode_ip6_extension | ( | struct d_generic_changes * | active, |
| struct list_decomp * | decomp, | ||
| unsigned char * | dest | ||
| ) |
Build an extension list in IPv6 header.
| active | The IPv6 header changes |
| decomp | The list decompressor |
| dest | The buffer to store the IPv6 header |
References list_decomp::counter_list, item::data, c_list::first_elt, get_elt(), ip_packet::header, d_generic_changes::ip, list_elt::item, item::length, list_decomp::list_table, list_elt::next_elt, list_decomp::ref_list, list_decomp::ref_ok, rohc_debugf, size_list(), item::type, and ip_packet::v6.
Referenced by d_generic_create().
| int extension_type | ( | const unsigned char * | packet | ) |
Find out which extension is carried by the UOR-2 packet.
| packet | The ROHC UOR-2 packet |
References GET_BIT_6_7.
Referenced by do_decode_uor2().
| int find_packet_type | ( | struct rohc_decomp * | decomp, |
| struct d_context * | context, | ||
| const unsigned char * | packet, | ||
| int | second_byte | ||
| ) |
Find out of which type is the ROHC packet.
| decomp | The ROHC decompressor |
| context | The decompression context |
| packet | The ROHC packet |
| second_byte | The offset for the second byte of the ROHC packet (depends on the CID encoding and the packet type) |
References GET_BIT_5, GET_BIT_5_7, GET_BIT_6, GET_BIT_6_7, GET_BIT_7, d_profile::id, d_generic_changes::ip, ip_get_version(), IPV4, d_generic_context::last1, d_generic_context::last2, d_generic_context::multiple_ip, PACKET_IR, PACKET_IR_DYN, PACKET_UNKNOWN, 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, d_generic_changes::rnd, ROHC_PROFILE_RTP, and d_context::specific.
Referenced by d_generic_decode(), and d_udp_lite_decode().
| int get_bit_index | ( | unsigned char | byte, |
| int | index | ||
| ) |
Get the bit in the byte at the specified index.
| byte | the byte to analyse |
| index | the specified index |
References GET_BIT_0, GET_BIT_1, GET_BIT_2, GET_BIT_3, GET_BIT_4, GET_BIT_5, GET_BIT_6, GET_BIT_7, and rohc_debugf.
Referenced by decode_type_1(), decode_type_2(), and decode_type_3().
| int get_ip6_ext_size | ( | const unsigned char * | ext | ) |
Get the size of the extension in bytes.
| ext | The extension |
Referenced by d_generic_create().
| void ip6_d_init_table | ( | struct list_decomp * | decomp | ) |
Initialize the tables IPv6 extension in decompressor.
| decomp | The list decompressor |
References AH, item::ahhdr, list_decomp::based_table, item::data, DEST, item::dest, HBH, item::hbh, item::header, d_translation::item, d_translation::known, item::length, RTHDR, item::rthdr, list_decomp::trans_table, and item::type.
Referenced by d_generic_create().
| void sync_on_failure | ( | struct d_generic_context * | context | ) |
Replace the active header changes with the last ones.
| context | The generic decompression context |
References d_generic_context::active1, d_generic_context::active2, copy_generic_changes(), d_generic_context::last1, and d_generic_context::last2.
Referenced by act_on_crc_failure().
| void synchronize | ( | struct d_generic_context * | context | ) |
Replace last header changes with the active ones.
| context | The generic decompression context |
References d_generic_context::active1, d_generic_context::active2, copy_generic_changes(), d_generic_context::last1, and d_generic_context::last2.
Referenced by act_on_crc_failure(), d_generic_decode(), d_generic_decode_ir(), decode_irdyn(), decode_uo0(), decode_uo1(), and decode_uor2().
| void update_inter_packet | ( | struct d_generic_context * | context | ) |
Update the inter-packet time, a sort of average over the last inter-packet times.
| context | The generic decompression context |
References d_generic_context::current_packet_time, d_generic_context::inter_arrival_time, d_generic_context::last_packet_time, rohc_debugf, WEIGHT_NEW, and WEIGHT_OLD.
Referenced by act_on_crc_failure(), d_generic_decode_ir(), decode_irdyn(), decode_uo0(), decode_uo1(), and decode_uor2().
1.7.6.1