ROHC compression/decompression library
Functions
d_tcp_irregular.c File Reference

Handle the irregular chain of the TCP decompression profile. More...

#include "d_tcp_irregular.h"
#include "d_tcp_defines.h"
#include "d_tcp_opts_list.h"
#include "rohc_utils.h"
#include <string.h>
Include dependency graph for d_tcp_irregular.c:

Functions

static int tcp_parse_irregular_ip (const struct rohc_decomp_ctxt *const context, const ip_context_t *const ip_context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, const tcp_ip_id_behavior_t ip_id_behavior, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits)
 Decode the irregular IP header of the rohc packet. More...
 
static int tcp_parse_irregular_ipv4 (const struct rohc_decomp_ctxt *const context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, const tcp_ip_id_behavior_t ip_id_behavior, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits)
 Decode the irregular IPv4 header of the rohc packet. More...
 
static int tcp_parse_irregular_ipv6 (const struct rohc_decomp_ctxt *const context, const uint8_t *rohc_data, const size_t rohc_data_len, const bool is_innermost, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_bits)
 Decode the irregular IPv6 header of the rohc packet. More...
 
static int tcp_parse_irregular_tcp (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_data, const size_t rohc_data_len, struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_extr_ip_bits *const ip_inner_bits)
 Decode the irregular TCP header of the rohc packet. More...
 
static bool d_tcp_is_ecn_used (const struct d_tcp_context tcp_ctxt, const struct rohc_tcp_extr_bits bits)
 Determine whether the TCP ECN flags are used or not. More...
 
bool tcp_parse_irreg_chain (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const tcp_ip_id_behavior_t innermost_ip_id_behavior, struct rohc_tcp_extr_bits *const bits, size_t *const parsed_len)
 Parse the irregular chain of the ROHC packet. More...
 

Detailed Description

Handle the irregular chain of the TCP decompression profile.

Author
FWX rohc_.nosp@m.team.nosp@m.@dial.nosp@m.ine..nosp@m.fr
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com

Function Documentation

static bool d_tcp_is_ecn_used ( const struct d_tcp_context  tcp_ctxt,
const struct rohc_tcp_extr_bits  bits 
)
inlinestatic

Determine whether the TCP ECN flags are used or not.

The bits extracted from the current ROHC packet are used if present. The value recorded in the decompression context is used as fallback otherwise.

Parameters
tcp_ctxtThe TCP decompression context
bitsThe bits extracted from the ROHC packet
Returns
true if the TCP ECN flags are used by the compressed TCP packet or not, false if they are not
bool tcp_parse_irreg_chain ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_packet,
const size_t  rohc_length,
const tcp_ip_id_behavior_t  innermost_ip_id_behavior,
struct rohc_tcp_extr_bits *const  bits,
size_t *const  parsed_len 
)

Parse the irregular chain of the ROHC packet.

Parameters
contextThe decompression context
rohc_packetThe remaining part of the ROHC packet
rohc_lengthThe remaining length (in bytes) of ROHC packet
innermost_ip_id_behaviorThe behavior of the innermost IP-ID
[out]bitsThe bits extracted from the irregular chain in case of success
[out]parsed_lenThe length (in bytes) of irregular chain in case of success
Returns
true in the irregular chain was successfully parsed, false if the ROHC packet was malformed
static int tcp_parse_irregular_ip ( const struct rohc_decomp_ctxt *const  context,
const ip_context_t *const  ip_context,
const uint8_t *  rohc_data,
const size_t  rohc_data_len,
const bool  is_innermost,
const tcp_ip_id_behavior_t  ip_id_behavior,
struct rohc_tcp_extr_bits *const  bits,
struct rohc_tcp_extr_ip_bits *const  ip_bits 
)
static

Decode the irregular IP header of the rohc packet.

Parameters
contextThe decompression context
ip_contextThe specific IP decompression context
rohc_dataThe remaining part of the ROHC packet
rohc_data_lenThe length of remaining part of the ROHC packet
is_innermostTrue if the IP header is the innermost of the packet
ip_id_behaviorThe IP-ID behavior of the IP header (may be different from the context)
[out]bitsThe bits extracted from the irregular chain in case of success
[out]ip_bitsThe bits extracted from the irregular chain for the current IPv6 header in case of success
Returns
The number of ROHC bytes parsed, -1 if packet is malformed
static int tcp_parse_irregular_ipv4 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  rohc_data,
const size_t  rohc_data_len,
const bool  is_innermost,
const tcp_ip_id_behavior_t  ip_id_behavior,
struct rohc_tcp_extr_bits *const  bits,
struct rohc_tcp_extr_ip_bits *const  ip_bits 
)
static

Decode the irregular IPv4 header of the rohc packet.

Parameters
contextThe decompression context
rohc_dataThe remaining part of the ROHC packet
rohc_data_lenThe length of remaining part of the ROHC packet
is_innermostTrue if the IP header is the innermost of the packet
ip_id_behaviorThe IP-ID behavior of the IP header (may be different from the context)
[out]bitsThe bits extracted from the irregular chain in case of success
[out]ip_bitsThe bits extracted from the irregular chain for the current IPv6 header in case of success
Returns
The number of ROHC bytes parsed, -1 if packet is malformed
static int tcp_parse_irregular_ipv6 ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *  rohc_data,
const size_t  rohc_data_len,
const bool  is_innermost,
struct rohc_tcp_extr_bits *const  bits,
struct rohc_tcp_extr_ip_bits *const  ip_bits 
)
static

Decode the irregular IPv6 header of the rohc packet.

Parameters
contextThe decompression context
rohc_dataThe remaining part of the ROHC packet
rohc_data_lenThe length of remaining part of the ROHC packet
is_innermostTrue if the IP header is the innermost of the packet
[out]bitsThe bits extracted from the irregular chain in case of success
[out]ip_bitsThe bits extracted from the irregular chain for the current IPv6 header in case of success
Returns
The number of ROHC bytes parsed, -1 if packet is malformed
static int tcp_parse_irregular_tcp ( const struct rohc_decomp_ctxt *const  context,
const uint8_t *const  rohc_data,
const size_t  rohc_data_len,
struct rohc_tcp_extr_bits *const  bits,
struct rohc_tcp_extr_ip_bits *const  ip_inner_bits 
)
static

Decode the irregular TCP header of the rohc packet.

See RFC4996 page 75

Parameters
contextThe decompression context
rohc_dataThe remain data of the rohc packet
rohc_data_lenThe length of the remain data of the rohc packet
[out]bitsThe bits extracted from the TCP part of the irregular chain
[out]ip_inner_bitsThe bits extracted from the innermost IP part of the irregular chain
Returns
The number of ROHC bytes parsed, -1 if packet is malformed