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.
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.
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.
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.
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.
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.

Detailed Description

Handle the irregular chain of the TCP decompression profile.

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

Function Documentation

static bool d_tcp_is_ecn_used ( const struct d_tcp_context  tcp_ctxt,
const struct rohc_tcp_extr_bits  bits 
) [inline, static]

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_ctxt The TCP decompression context
bits The 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:
context The decompression context
rohc_packet The remaining part of the ROHC packet
rohc_length The remaining length (in bytes) of ROHC packet
innermost_ip_id_behavior The behavior of the innermost IP-ID
[out] bits The bits extracted from the irregular chain in case of success
[out] parsed_len The 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:
context The decompression context
ip_context The specific IP decompression context
rohc_data The remaining part of the ROHC packet
rohc_data_len The length of remaining part of the ROHC packet
is_innermost True if the IP header is the innermost of the packet
ip_id_behavior The IP-ID behavior of the IP header (may be different from the context)
[out] bits The bits extracted from the irregular chain in case of success
[out] ip_bits The 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:
context The decompression context
rohc_data The remaining part of the ROHC packet
rohc_data_len The length of remaining part of the ROHC packet
is_innermost True if the IP header is the innermost of the packet
ip_id_behavior The IP-ID behavior of the IP header (may be different from the context)
[out] bits The bits extracted from the irregular chain in case of success
[out] ip_bits The 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:
context The decompression context
rohc_data The remaining part of the ROHC packet
rohc_data_len The length of remaining part of the ROHC packet
is_innermost True if the IP header is the innermost of the packet
[out] bits The bits extracted from the irregular chain in case of success
[out] ip_bits The 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:
context The decompression context
rohc_data The remain data of the rohc packet
rohc_data_len The length of the remain data of the rohc packet
[out] bits The bits extracted from the TCP part of the irregular chain
[out] ip_inner_bits The bits extracted from the innermost IP part of the irregular chain
Returns:
The number of ROHC bytes parsed, -1 if packet is malformed

Generated on 4 Jul 2018 for ROHC compression/decompression library by  doxygen 1.6.1