ROHC compression/decompression library
|
ROHC decompression context for the TCP profile. More...
#include "rohc_bit_ops.h"
#include "rohc_traces_internal.h"
#include "rohc_utils.h"
#include "rohc_debug.h"
#include "schemes/rfc4996.h"
#include "schemes/wlsb.h"
#include "protocols/tcp.h"
#include "crc.h"
#include "d_generic.h"
#include "config.h"
#include <string.h>
#include <stdint.h>
Data Structures | |
struct | ipv6_option_context |
Define the IPv6 generic option context. More... | |
struct | ipv6_gre_option_context |
Define the IPv6 GRE option context. More... | |
struct | ipv6_mime_option_context |
Define the IPv6 MIME option context. More... | |
struct | ipv6_ah_option_context |
Define the IPv6 AH option context. More... | |
struct | ipvx_context |
Define the common IP header context to IPv4 and IPv6. More... | |
struct | ipv4_context |
Define the IPv4 header context. More... | |
struct | ipv6_context |
Define the IPv6 header context. More... | |
union | ip_context_ptr_t |
Define union of IP contexts pointers. More... | |
struct | d_tcp_context |
Define the TCP part of the decompression profile context. More... | |
Defines | |
#define | MAX_IP_CONTEXT_SIZE |
#define | MAX_TCP_OPT_SIZE 64 |
Typedefs | |
typedef struct ipv6_option_context | ipv6_option_context_t |
Define the IPv6 option context for Destination, Hop-by-Hop and Routing option. | |
typedef struct ipv6_gre_option_context | ipv6_gre_option_context_t |
Define the IPv6 option context for GRE option. | |
typedef struct ipv6_mime_option_context | ipv6_mime_option_context_t |
Define the IPv6 option context for MIME option. | |
typedef struct ipv6_ah_option_context | ipv6_ah_option_context_t |
Define the IPv6 option context for AH option. | |
typedef struct ipvx_context | ipvx_context_t |
Define the common IP header context to IPv4 and IPv6. | |
typedef struct ipv4_context | ipv4_context_t |
Define the IPv4 header context. | |
typedef struct ipv6_context | ipv6_context_t |
Define the IPv6 header context. | |
Functions | |
static void * | d_tcp_create (const struct rohc_decomp_ctxt *const context) |
Create the TCP decompression context. | |
static void | d_tcp_destroy (void *const context) |
Destroy the context. | |
static int | tcp_decode_static_ipv6_option (struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, uint8_t protocol, const unsigned char *const rohc_packet, const size_t rohc_length, base_header_ip_t base_header) |
Decode the static IP v6 option header of the rohc packet. | |
static unsigned int | tcp_copy_static_ipv6_option (const struct rohc_decomp_ctxt *const context, uint8_t protocol, ip_context_ptr_t ip_context, base_header_ip_t base_header) |
Copy the static IP part to the IPv6 option header. | |
static int | tcp_decode_dynamic_ipv6_option (struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, uint8_t protocol, const unsigned char *const rohc_packet, const size_t rohc_length, base_header_ip_t base_header) |
Decode the dynamic IP v6 option header of the rohc packet. | |
static int | tcp_decode_static_ip (struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, const unsigned char *const rohc_packet, const size_t rohc_length, unsigned char *dest) |
Decode the static IP header of the rohc packet. | |
static unsigned int | tcp_copy_static_ip (const struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, base_header_ip_t base_header) |
Copy the static IP part to the IP header. | |
static int | tcp_decode_dynamic_ip (struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, const unsigned char *const rohc_packet, const size_t rohc_length, unsigned char *dest) |
Decode the dynamic IP header of the rohc packet. | |
static int | tcp_decode_irregular_ip (struct rohc_decomp_ctxt *const context, ip_context_ptr_t ip_context, base_header_ip_t base_header, const uint8_t *rohc_data, int is_innermost, int ttl_irregular_chain_flag, int ip_inner_ecn) |
Decode the irregular IP header of the rohc packet. | |
static int | tcp_decode_static_tcp (struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, tcphdr_t *tcp) |
Decode the TCP static part of the ROHC packet. | |
static unsigned int | tcp_copy_static_tcp (struct rohc_decomp_ctxt *const context, tcphdr_t *tcp) |
Copy the TCP static part of the TCP header. | |
static int | tcp_decode_dynamic_tcp (struct rohc_decomp_ctxt *const context, const unsigned char *const rohc_packet, const size_t rohc_length, tcphdr_t *tcp) |
Decode the TCP dynamic part of the ROHC packet. | |
static rohc_packet_t | tcp_detect_packet_type (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len) |
Detect the type of ROHC packet for the TCP profile. | |
static int | d_tcp_decode_ir (struct rohc_decomp_ctxt *context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t add_cid_len, const size_t large_cid_len, unsigned char *dest) |
Decode one IR packet for the TCP profile. | |
static int | d_tcp_decode_irdyn (struct rohc_decomp_ctxt *context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, unsigned char *dest) |
Decode one IR-DYN packet for the TCP profile. | |
static int | d_tcp_decode_CO (struct rohc_decomp *decomp, struct rohc_decomp_ctxt *context, const unsigned char *const rohc_packet, const size_t rohc_length, const size_t add_cid_len, const size_t large_cid_len, const rohc_packet_t packet_type, unsigned char *dest) |
Decode one CO packet. | |
static bool | rohc_decomp_tcp_decode_seq (const struct rohc_decomp_ctxt *const context, const uint32_t seq_bits, const size_t seq_bits_nr, const rohc_lsb_shift_t p, uint32_t *const seq) |
decode the tcp sequence number from packet and context information | |
static bool | rohc_decomp_tcp_decode_ack (const struct rohc_decomp_ctxt *const context, const uint8_t ack_flag, const uint32_t ack_bits, const size_t ack_bits_nr, const rohc_lsb_shift_t p, uint32_t *const ack) |
Decode the TCP ACK number from packet and context information. | |
static uint32_t | d_tcp_get_msn (const struct rohc_decomp_ctxt *const context) |
Get the reference MSN value of the context. | |
static const uint8_t * | d_ts_lsb (const struct rohc_decomp_ctxt *const context, const struct rohc_lsb_decode *const lsb, const uint8_t *ptr, uint32_t *const timestamp) |
Decompress the LSBs bits of TimeStamp TCP option. | |
static const uint8_t * | d_tcp_opt_sack (const struct rohc_decomp_ctxt *const context, const uint8_t *ptr, uint8_t **pOptions, uint32_t ack_value) |
Uncompress the SACK TCP option. | |
static rohc_status_t | d_tcp_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, IR-CO IR-CR packet for TCP profile. | |
static int | tcp_decode_irregular_tcp (struct rohc_decomp_ctxt *const context, base_header_ip_t base_header_inner, tcphdr_t *tcp, const uint8_t *const rohc_data) |
Decode the irregular TCP header of the rohc packet. | |
static int | d_size_ts_lsb (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_length) |
Calculate the size of TimeStamp compressed TCP option. | |
static int | d_sack_pure_lsb (const uint8_t *ptr, uint32_t base, uint32_t *field) |
Uncompress the SACK field value. | |
static const uint8_t * | d_sack_block (const uint8_t *ptr, uint32_t reference, sack_block_t *sack_block) |
Uncompress a SACK block. | |
static int | d_sack_var_length_size_dec (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_length) |
Calculate the size of the compressed SACK field value. | |
static int | d_sack_block_size (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_length) |
Calculate the size of the compressed SACK block. | |
static int | d_tcp_size_opt_sack (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_length, uint16_t *const uncomp_len) |
Calculate the size of the SACK TCP option. | |
static const uint8_t * | d_tcp_opt_generic (const uint8_t *ptr, uint8_t **pOptions) |
Uncompress a generic TCP option. | |
static int | d_tcp_size_opt_generic (struct d_tcp_context *tcp_context, const uint8_t *const rohc_data, const size_t rohc_length, uint16_t *const uncomp_len) |
Calculate the size of a generic TCP option. | |
static const uint8_t * | tcp_decompress_tcp_options (struct rohc_decomp_ctxt *const context, const uint8_t *data, const size_t data_len, tcphdr_t *const tcp) |
Uncompress the TCP options. | |
static int | tcp_size_decompress_tcp_options (struct rohc_decomp_ctxt *const context, const uint8_t *data, const size_t data_len, uint16_t *uncomp_len) |
Calculate the compressed TCP options size. | |
Variables | |
struct rohc_decomp_profile | d_tcp_profile |
Define the decompression part of the TCP profile as described in the RFC 3095. |
ROHC decompression context for the TCP profile.
#define MAX_IP_CONTEXT_SIZE |
(rohc_max(sizeof(ipv4_context_t), \ sizeof(ipv6_context_t) + sizeof(ipv6_option_context_t) * 10) \ * 4)
#define MAX_TCP_OPT_SIZE 64 |
typedef struct ipv4_context ipv4_context_t |
Define the IPv4 header context.
typedef struct ipv6_ah_option_context ipv6_ah_option_context_t |
Define the IPv6 option context for AH option.
typedef struct ipv6_context ipv6_context_t |
Define the IPv6 header context.
typedef struct ipv6_gre_option_context ipv6_gre_option_context_t |
Define the IPv6 option context for GRE option.
typedef struct ipv6_mime_option_context ipv6_mime_option_context_t |
Define the IPv6 option context for MIME option.
typedef struct ipv6_option_context ipv6_option_context_t |
Define the IPv6 option context for Destination, Hop-by-Hop and Routing option.
typedef struct ipvx_context ipvx_context_t |
Define the common IP header context to IPv4 and IPv6.
static const uint8_t* d_sack_block | ( | const uint8_t * | ptr, |
uint32_t | reference, | ||
sack_block_t * | sack_block | ||
) | [static] |
Uncompress a SACK block.
See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)
ptr | Pointer to the compressed value |
reference | The reference value |
sack_block | Pointer to the uncompressed sack_block |
static int d_sack_block_size | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t *const | rohc_data, | ||
const size_t | rohc_length | ||
) | [static] |
Calculate the size of the compressed SACK block.
See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)
context | The decompression context |
rohc_data | The remaining ROHC data to decode |
rohc_length | The length (in bytes) of the remaining ROHC data |
static int d_sack_pure_lsb | ( | const uint8_t * | ptr, |
uint32_t | base, | ||
uint32_t * | field | ||
) | [static] |
Uncompress the SACK field value.
See RFC6846 page 67 (and RFC2018 for Selective Acknowledgement option)
ptr | Pointer to the compressed value |
base | The base value |
field | Pointer to the uncompressed value |
static int d_sack_var_length_size_dec | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t *const | rohc_data, | ||
const size_t | rohc_length | ||
) | [static] |
Calculate the size of the compressed SACK field value.
See RFC6846 page 67 (and RFC2018 for Selective Acknowledgement option)
context | The decompression context |
rohc_data | The remaining ROHC data to decode |
rohc_length | The length (in bytes) of the remaining ROHC data |
static int d_size_ts_lsb | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t *const | rohc_data, | ||
const size_t | rohc_length | ||
) | [static] |
Calculate the size of TimeStamp compressed TCP option.
context | The decompression context |
rohc_data | The remaining ROHC data |
rohc_length | The length (in bytes) of the remaining ROHC data |
static void * d_tcp_create | ( | const struct rohc_decomp_ctxt *const | context | ) | [static] |
Create the TCP decompression context.
This function is one of the functions that must exist in one profile for the framework to work.
context | The decompression context |
static rohc_status_t d_tcp_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 | ||
) | [static] |
Decode one IR, IR-DYN, IR-CO IR-CR packet for TCP profile.
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 | |
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 |
static int d_tcp_decode_CO | ( | struct rohc_decomp * | decomp, |
struct rohc_decomp_ctxt * | context, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | add_cid_len, | ||
const size_t | large_cid_len, | ||
const rohc_packet_t | packet_type, | ||
unsigned char * | dest | ||
) | [static] |
Decode one CO packet.
RFC 6846, section 7.3. Compressed (CO) Packets 0 1 2 3 4 5 6 7 --- --- --- --- --- --- --- --- 1 : Add-CID octet : if for small CIDs and CID 1-15 +---+---+---+---+---+---+---+---+ 2 | First octet of base header | (with type indication) +---+---+---+---+---+---+---+---+ : : 3 / 0, 1, or 2 octets of CID / 1-2 octets if large CIDs : : +---+---+---+---+---+---+---+---+ 4 / Remainder of base header / variable number of octets +---+---+---+---+---+---+---+---+ : Irregular chain : 5 / (including irregular chain / variable : items for TCP options) : --- --- --- --- --- --- --- --- | | 6 / Payload / variable length | | - - - - - - - - - - - - - - - -
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 |
packet_type | The type of the ROHC packet to parse |
dest | OUT: The decoded IP packet |
static int d_tcp_decode_ir | ( | struct rohc_decomp_ctxt * | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | add_cid_len, | ||
const size_t | large_cid_len, | ||
unsigned char * | dest | ||
) | [static] |
Decode one IR packet for the TCP profile.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of 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 |
dest | The decoded IP packet |
static int d_tcp_decode_irdyn | ( | struct rohc_decomp_ctxt * | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len, | ||
unsigned char * | dest | ||
) | [static] |
Decode one IR-DYN packet for the TCP profile.
context | The decompression context |
rohc_packet | The ROHC packet to decode |
rohc_length | The length of the ROHC packet to decode |
large_cid_len | The length of the optional large CID field |
dest | The decoded IP packet |
static void d_tcp_destroy | ( | void *const | context | ) | [static] |
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 |
static uint32_t d_tcp_get_msn | ( | const struct rohc_decomp_ctxt *const | context | ) | [static] |
Get the reference MSN 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 const uint8_t* d_tcp_opt_generic | ( | const uint8_t * | ptr, |
uint8_t ** | pOptions | ||
) | [static] |
Uncompress a generic TCP option.
See RFC4996 page 67
ptr | Pointer to the compressed TCP option |
pOptions | Pointer to the uncompressed TCP option |
static const uint8_t * d_tcp_opt_sack | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t * | ptr, | ||
uint8_t ** | pOptions, | ||
uint32_t | ack_value | ||
) | [static] |
Uncompress the SACK TCP option.
See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)
context | The decompression context |
ptr | Pointer to the compressed value |
pOptions | Pointer to the uncompressed option |
ack_value | The ack value |
static int d_tcp_size_opt_generic | ( | struct d_tcp_context * | tcp_context, |
const uint8_t *const | rohc_data, | ||
const size_t | rohc_length, | ||
uint16_t *const | uncomp_len | ||
) | [static] |
Calculate the size of a generic TCP option.
See RFC4996 page 67
tcp_context | The specific TCP context |
rohc_data | The remaining ROHC data |
rohc_length | The length (in bytes) of the remaining ROHC data |
uncomp_len | The length (in bytes) of the uncompressed TCP option |
static int d_tcp_size_opt_sack | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t *const | rohc_data, | ||
const size_t | rohc_length, | ||
uint16_t *const | uncomp_len | ||
) | [static] |
Calculate the size of the SACK TCP option.
See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)
context | The decompression context |
rohc_data | The remaining ROHC data to decode |
rohc_length | The length (in bytes) of the remaining ROHC data |
uncomp_len | The length (in bytes) of the uncompressed TCP option |
static const uint8_t * d_ts_lsb | ( | const struct rohc_decomp_ctxt *const | context, |
const struct rohc_lsb_decode *const | lsb, | ||
const uint8_t * | ptr, | ||
uint32_t *const | timestamp | ||
) | [static] |
Decompress the LSBs bits of TimeStamp TCP option.
See RFC4996 page 65
context | The decompression context |
lsb | The LSB decoding context |
ptr | Pointer to the compressed value |
timestamp | Pointer to the uncompressed value |
static bool rohc_decomp_tcp_decode_ack | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t | ack_flag, | ||
const uint32_t | ack_bits, | ||
const size_t | ack_bits_nr, | ||
const rohc_lsb_shift_t | p, | ||
uint32_t *const | ack | ||
) | [static] |
Decode the TCP ACK number from packet and context information.
static bool rohc_decomp_tcp_decode_seq | ( | const struct rohc_decomp_ctxt *const | context, |
const uint32_t | seq_bits, | ||
const size_t | seq_bits_nr, | ||
const rohc_lsb_shift_t | p, | ||
uint32_t *const | seq | ||
) | [static] |
decode the tcp sequence number from packet and context information
static unsigned int tcp_copy_static_ip | ( | const struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
base_header_ip_t | base_header | ||
) | [static] |
Copy the static IP part to the IP header.
context | The decompression context |
ip_context | The specific IP decompression context |
base_header | The IP header |
static unsigned int tcp_copy_static_ipv6_option | ( | const struct rohc_decomp_ctxt *const | context, |
uint8_t | protocol, | ||
ip_context_ptr_t | ip_context, | ||
base_header_ip_t | base_header | ||
) | [static] |
Copy the static IP part to the IPv6 option header.
context | The decompression context |
protocol | The IPv6 protocol option |
ip_context | The specific IP decompression context |
base_header | The IP header |
static unsigned int tcp_copy_static_tcp | ( | struct rohc_decomp_ctxt *const | context, |
tcphdr_t * | tcp | ||
) | [static] |
Copy the TCP static part of the TCP header.
context | The decompression context |
tcp | The decoded TCP header |
static int tcp_decode_dynamic_ip | ( | struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
unsigned char * | dest | ||
) | [static] |
Decode the dynamic IP header of the rohc packet.
context | The decompression context |
ip_context | The specific IP decompression context |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
dest | The decoded IP packet |
static int tcp_decode_dynamic_ipv6_option | ( | struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
uint8_t | protocol, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
base_header_ip_t | base_header | ||
) | [static] |
Decode the dynamic IP v6 option header of the rohc packet.
context | The decompression context |
ip_context | The specific IP decompression context |
protocol | The IPv6 protocol option |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
base_header | The decoded IP packet |
static int tcp_decode_dynamic_tcp | ( | struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
tcphdr_t * | tcp | ||
) | [static] |
Decode the TCP dynamic part of the ROHC packet.
context | The decompression context |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
tcp | The decoded TCP header |
static int tcp_decode_irregular_ip | ( | struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
base_header_ip_t | base_header, | ||
const uint8_t * | rohc_data, | ||
int | is_innermost, | ||
int | ttl_irregular_chain_flag, | ||
int | ip_inner_ecn | ||
) | [static] |
Decode the irregular IP header of the rohc packet.
context | The decompression context |
ip_context | The specific IP decompression context |
base_header | The IP header under built |
rohc_data | The remaining part of the ROHC packet |
is_innermost | True if the IP header is the innermost of the packet |
ttl_irregular_chain_flag | True if one of the TTL value of header change |
ip_inner_ecn | The ECN flags of inner IP header |
static int tcp_decode_irregular_tcp | ( | struct rohc_decomp_ctxt *const | context, |
base_header_ip_t | base_header_inner, | ||
tcphdr_t * | tcp, | ||
const uint8_t *const | rohc_data | ||
) | [static] |
Decode the irregular TCP header of the rohc packet.
See RFC4996 page 75
context | The decompression context |
base_header_inner | The inner IP header under built |
tcp | The TCP header under built |
rohc_data | The remain datas of the rohc packet |
static int tcp_decode_static_ip | ( | struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
unsigned char * | dest | ||
) | [static] |
Decode the static IP header of the rohc packet.
context | The decompression context |
ip_context | The specific IP decompression context |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
dest | The decoded IP packet |
static int tcp_decode_static_ipv6_option | ( | struct rohc_decomp_ctxt *const | context, |
ip_context_ptr_t | ip_context, | ||
uint8_t | protocol, | ||
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
base_header_ip_t | base_header | ||
) | [static] |
Decode the static IP v6 option header of the rohc packet.
context | The decompression context |
ip_context | The specific IP decompression context |
protocol | The IPv6 protocol option |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
base_header | The decoded IP packet |
static int tcp_decode_static_tcp | ( | struct rohc_decomp_ctxt *const | context, |
const unsigned char *const | rohc_packet, | ||
const size_t | rohc_length, | ||
tcphdr_t * | tcp | ||
) | [static] |
Decode the TCP static part of the ROHC packet.
context | The decompression context |
rohc_packet | The remaining part of the ROHC packet |
rohc_length | The remaining length (in bytes) of the ROHC packet |
tcp | The decoded TCP header |
static const uint8_t* tcp_decompress_tcp_options | ( | struct rohc_decomp_ctxt *const | context, |
const uint8_t * | data, | ||
const size_t | data_len, | ||
tcphdr_t *const | tcp | ||
) | [static] |
Uncompress the TCP options.
context | The decompression context | |
data | The compressed TCP options | |
data_len | The length (in bytes) of compressed TCP options | |
[in,out] | tcp | The TCP header where to append uncompressed TCP options |
static rohc_packet_t tcp_detect_packet_type | ( | const struct rohc_decomp_ctxt *const | context, |
const uint8_t *const | rohc_packet, | ||
const size_t | rohc_length, | ||
const size_t | large_cid_len | ||
) | [static] |
Detect the type of ROHC packet for the TCP profile.
context | The decompression context |
rohc_packet | The ROHC packet |
rohc_length | The length of the ROHC packet |
large_cid_len | The length of the optional large CID field |
static int tcp_size_decompress_tcp_options | ( | struct rohc_decomp_ctxt *const | context, |
const uint8_t * | data, | ||
const size_t | data_len, | ||
uint16_t * | uncomp_len | ||
) | [static] |
Calculate the compressed TCP options size.
See RFC6846 pages 26-27.
context | The decompression context | |
data | The compressed TCP options | |
data_len | The length (in bytes) of compressed TCP options | |
[out] | uncomp_len | The length (in bytes) of uncompressed TCP options |
struct rohc_decomp_profile d_tcp_profile |
{ .id = ROHC_PROFILE_TCP, .new_context = d_tcp_create, .free_context = d_tcp_destroy, .decode = d_tcp_decode, .detect_pkt_type = tcp_detect_packet_type, .get_sn = d_tcp_get_msn }
Define the decompression part of the TCP profile as described in the RFC 3095.