ROHC compression/decompression library
Data Structures | Defines | Typedefs | Functions | Variables
d_tcp.c File Reference

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>
Include dependency graph for d_tcp.c:

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.

Detailed Description

ROHC decompression context for the TCP profile.

Author:
FWX <rohc_team@dialine.fr>
Didier Barvaux <didier@barvaux.org>
Didier Barvaux <didier.barvaux@toulouse.viveris.com>

Define Documentation

Value:
(rohc_max(sizeof(ipv4_context_t), \
                  sizeof(ipv6_context_t) + sizeof(ipv6_option_context_t) * 10) \
         * 4)
#define MAX_TCP_OPT_SIZE   64

Typedef Documentation

typedef struct ipv4_context ipv4_context_t

Define the IPv4 header context.

Define the IPv6 option context for AH option.

typedef struct ipv6_context ipv6_context_t

Define the IPv6 header context.

Define the IPv6 option context for GRE option.

Define the IPv6 option context for MIME option.

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.


Function Documentation

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)

Parameters:
ptrPointer to the compressed value
referenceThe reference value
sack_blockPointer to the uncompressed sack_block
Returns:
Pointer to the next compressed 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 
) [static]

Calculate the size of the compressed SACK block.

See RFC6846 page 68 (and RFC2018 for Selective Acknowledgement option)

Parameters:
contextThe decompression context
rohc_dataThe remaining ROHC data to decode
rohc_lengthThe length (in bytes) of the remaining ROHC data
Returns:
The size (in bytes) of the compressed value, -1 in case of problem
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)

Parameters:
ptrPointer to the compressed value
baseThe base value
fieldPointer to the uncompressed value
Returns:
Number of bytes read, -1 if error
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)

Parameters:
contextThe decompression context
rohc_dataThe remaining ROHC data to decode
rohc_lengthThe length (in bytes) of the remaining ROHC data
Returns:
The size (in bytes) of the compressed value, -1 in case of problem
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.

Parameters:
contextThe decompression context
rohc_dataThe remaining ROHC data
rohc_lengthThe length (in bytes) of the remaining ROHC data
Returns:
The length (in bytes) of the compressed TCP option, -1 in case of problem
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.

Parameters:
contextThe decompression context
Returns:
The newly-created TCP 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.

Parameters:
decompThe ROHC decompressor
contextThe decompression context
rohc_packetThe ROHC packet to decode
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the optional large CID field
[out]uncomp_packetThe uncompressed packet
packet_typeIN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
Returns:
ROHC_STATUS_OK if packet is successfully decoded, ROHC_STATUS_MALFORMED if packet is malformed, ROHC_STATUS_BAD_CRC if a CRC error occurs, ROHC_STATUS_ERROR if an error occurs
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
    |                               |
     - - - - - - - - - - - - - - - -

Parameters:
decompThe ROHC decompressor
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the optional large CID field
packet_typeThe type of the ROHC packet to parse
destOUT: The decoded IP packet
Returns:
The length of the uncompressed IP packet or ROHC_ERROR if an error occurs or ROHC_ERROR_CRC if a CRC error occurs
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.

Parameters:
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet to decode
add_cid_lenThe length of the optional Add-CID field
large_cid_lenThe length of the optional large CID field
destThe decoded IP packet
Returns:
The length of the uncompressed IP packet or ROHC_OK_NO_DATA if packet is feedback only or ROHC_ERROR if an error occurs
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.

Parameters:
contextThe decompression context
rohc_packetThe ROHC packet to decode
rohc_lengthThe length of the ROHC packet to decode
large_cid_lenThe length of the optional large CID field
destThe decoded IP packet
Returns:
The length of the uncompressed IP packet or ROHC_OK_NO_DATA if packet is feedback only or ROHC_ERROR if an error occurs
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.

Parameters:
contextThe 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.

Parameters:
contextThe decompression context
Returns:
The reference MSN value
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

Parameters:
ptrPointer to the compressed TCP option
pOptionsPointer to the uncompressed TCP option
Returns:
Pointer to the next compressed value
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)

Parameters:
contextThe decompression context
ptrPointer to the compressed value
pOptionsPointer to the uncompressed option
ack_valueThe ack value
Returns:
Pointer to the next compressed 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

Parameters:
tcp_contextThe specific TCP context
rohc_dataThe remaining ROHC data
rohc_lengthThe length (in bytes) of the remaining ROHC data
uncomp_lenThe length (in bytes) of the uncompressed TCP option
Returns:
The number of ROHC bytes parsed
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)

Parameters:
contextThe decompression context
rohc_dataThe remaining ROHC data to decode
rohc_lengthThe length (in bytes) of the remaining ROHC data
uncomp_lenThe length (in bytes) of the uncompressed TCP option
Returns:
The size (in bytes) of the compressed value, -1 in case of problem
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

Parameters:
contextThe decompression context
lsbThe LSB decoding context
ptrPointer to the compressed value
timestampPointer to the uncompressed value
Returns:
Pointer to the next compressed 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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
base_headerThe IP header
Returns:
The size of the static part
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.

Parameters:
contextThe decompression context
protocolThe IPv6 protocol option
ip_contextThe specific IP decompression context
base_headerThe IP header
Returns:
The size of the static part
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.

Parameters:
contextThe decompression context
tcpThe decoded TCP header
Returns:
The number of bytes copied to the 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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
destThe decoded IP packet
Returns:
The length of dynamic IP header in case of success, -1 if an error occurs
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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
protocolThe IPv6 protocol option
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
base_headerThe decoded IP packet
Returns:
The length of dynamic IP header 0 if an error occurs
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.

Parameters:
contextThe decompression context
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
tcpThe decoded TCP header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
base_headerThe IP header under built
rohc_dataThe remaining part of the ROHC packet
is_innermostTrue if the IP header is the innermost of the packet
ttl_irregular_chain_flagTrue if one of the TTL value of header change
ip_inner_ecnThe ECN flags of inner IP header
Returns:
The number of ROHC bytes parsed, -1 if packet is malformed
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

Parameters:
contextThe decompression context
base_header_innerThe inner IP header under built
tcpThe TCP header under built
rohc_dataThe remain datas of the rohc packet
Returns:
The number of ROHC bytes parsed, -1 if packet is malformed
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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
destThe decoded IP packet
Returns:
The length of static IP header in case of success, -1 if an error occurs
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.

Parameters:
contextThe decompression context
ip_contextThe specific IP decompression context
protocolThe IPv6 protocol option
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
base_headerThe decoded IP packet
Returns:
The length of static IP header in case of success, -1 if an error occurs
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.

Parameters:
contextThe decompression context
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of the ROHC packet
tcpThe decoded TCP header
Returns:
The number of bytes read in the ROHC packet, -1 in case of failure
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.

Parameters:
contextThe decompression context
dataThe compressed TCP options
data_lenThe length (in bytes) of compressed TCP options
[in,out]tcpThe TCP header where to append uncompressed TCP options
Returns:
Pointer on data after the compressed TCP options, NULL in case of malformed data
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.

Parameters:
contextThe decompression context
rohc_packetThe ROHC packet
rohc_lengthThe length of the ROHC packet
large_cid_lenThe length of the optional large CID field
Returns:
The packet type
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.

Parameters:
contextThe decompression context
dataThe compressed TCP options
data_lenThe length (in bytes) of compressed TCP options
[out]uncomp_lenThe length (in bytes) of uncompressed TCP options
Returns:
The length of compressed TCP options, -1 in case of malformed data

Variable Documentation

Initial value:
{
        .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.