d_tcp.c File Reference

ROHC decompression context for the TCP profile. More...

#include "d_tcp_defines.h"
#include "d_tcp_static.h"
#include "d_tcp_dynamic.h"
#include "d_tcp_irregular.h"
#include "d_tcp_opts_list.h"
#include "rohc_decomp.h"
#include "rohc_decomp_internals.h"
#include "rohc_packets.h"
#include "rohc_bit_ops.h"
#include "rohc_traces_internal.h"
#include "rohc_utils.h"
#include "rohc_debug.h"
#include "schemes/rfc4996.h"
#include "schemes/decomp_wlsb.h"
#include "schemes/tcp_sack.h"
#include "schemes/tcp_ts.h"
#include "protocols/tcp.h"
#include "protocols/ip_numbers.h"
#include "crc.h"
#include "config.h"
#include <string.h>
#include <stdint.h>
Include dependency graph for d_tcp.c:

Functions

static bool d_tcp_create (const struct rohc_decomp_ctxt *const context, struct d_tcp_context **const persist_ctxt, struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Create the TCP decompression context.
static void d_tcp_destroy (struct d_tcp_context *const tcp_context, const struct rohc_decomp_volat_ctxt *const volat_ctxt)
 Destroy the context.
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 uint32_t d_tcp_get_msn (const struct rohc_decomp_ctxt *const context)
 Get the reference MSN value of the context.
static bool d_tcp_parse_packet (const struct rohc_decomp_ctxt *const context, const struct rohc_buf rohc_packet, const size_t large_cid_len, rohc_packet_t *const packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const extr_bits, size_t *const rohc_hdr_len)
 Parse the given ROHC packet for the TCP profile.
static bool d_tcp_parse_ir (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse the given IR packet for the TCP profile.
static bool d_tcp_parse_irdyn (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse othe given IR-DYN packet for the TCP profile.
static bool d_tcp_parse_CO (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, const size_t large_cid_len, const rohc_packet_t packet_type, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len)
 Parse the given CO packet for the TCP profile.
static bool d_tcp_parse_rnd_1 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_1 packet for the TCP profile.
static bool d_tcp_parse_rnd_2 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_2 packet for the TCP profile.
static bool d_tcp_parse_rnd_3 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_3 packet for the TCP profile.
static bool d_tcp_parse_rnd_4 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_4 packet for the TCP profile.
static bool d_tcp_parse_rnd_5 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_5 packet for the TCP profile.
static bool d_tcp_parse_rnd_6 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_6 packet for the TCP profile.
static bool d_tcp_parse_rnd_7 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_7 packet for the TCP profile.
static bool d_tcp_parse_rnd_8 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given rnd_8 packet for the TCP profile.
static bool d_tcp_parse_seq_1 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_1 packet for the TCP profile.
static bool d_tcp_parse_seq_2 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_2 packet for the TCP profile.
static bool d_tcp_parse_seq_3 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_3 packet for the TCP profile.
static bool d_tcp_parse_seq_4 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_4 packet for the TCP profile.
static bool d_tcp_parse_seq_5 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_5 packet for the TCP profile.
static bool d_tcp_parse_seq_6 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_6 packet for the TCP profile.
static bool d_tcp_parse_seq_7 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_7 packet for the TCP profile.
static bool d_tcp_parse_seq_8 (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given seq_8 packet for the TCP profile.
static bool d_tcp_parse_co_common (const struct rohc_decomp_ctxt *const context, const uint8_t *const rohc_packet, const size_t rohc_length, struct rohc_decomp_crc *const extr_crc, struct rohc_tcp_extr_bits *const bits, size_t *const rohc_hdr_len, bool *const has_opts_list)
 Parse the given co_common packet for the TCP profile.
static void d_tcp_reset_extr_bits (const struct rohc_decomp_ctxt *const context, struct rohc_tcp_extr_bits *const bits)
 Reset the extracted bits for next parsing.
static bool d_tcp_decode_bits (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_bits *const bits, const size_t payload_len, struct rohc_tcp_decoded_values *const decoded)
 Decode values from extracted bits.
static bool d_tcp_decode_bits_ip_hdrs (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_decoded_values *const decoded)
 Decode values for all IP headers from extracted bits.
static bool d_tcp_decode_bits_ip_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_ip_bits *const ip_bits, const ip_context_t *const ip_context, const uint16_t decoded_msn, struct rohc_tcp_decoded_ip_values *const ip_decoded)
 Decode values for one IP header from extracted bits.
static bool d_tcp_decode_bits_tcp_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_bits *const bits, const size_t payload_len, struct rohc_tcp_decoded_values *const decoded)
 Decode values for the TCP header from extracted bits.
static void d_tcp_decode_bits_tcp_flags (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_decoded_values *const decoded)
 Decode values for the TCP header flags from extracted bits.
static bool d_tcp_decode_bits_tcp_opts (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_extr_bits *const bits, struct rohc_tcp_decoded_values *const decoded)
 Decode values for the TCP options from extracted bits.
static bool d_tcp_decode_opt_ts_field (const struct rohc_decomp_ctxt *const context, const char *const descr, const struct rohc_lsb_decode *const lsb_ctxt, const struct rohc_lsb_field32 ts, uint32_t *const ts_decoded)
 Decode the given TS field of the TCP TimeStamp (TS) option.
static void d_tcp_decode_opt_sack (const struct rohc_decomp_ctxt *const context, const uint32_t ack_num, const struct d_tcp_opt_sack bits, struct d_tcp_opt_sack *const decoded)
 Decode the TCP SACK option.
static bool d_tcp_build_ipv4_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_ip_values *const decoded, struct rohc_buf *const uncomp_packet, size_t *const ip_hdr_len)
 Build one single uncompressed IPv4 header.
static bool d_tcp_build_ipv6_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_ip_values *const decoded, struct rohc_buf *const uncomp_packet, size_t *const ip_hdr_len)
 Build one single uncompressed IPv6 header.
static bool d_tcp_build_ip_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_ip_values *const decoded, struct rohc_buf *const uncomp_packet, size_t *const ip_hdr_len)
 Build one single uncompressed IP header.
static bool d_tcp_build_ip_hdrs (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_values *const decoded, struct rohc_buf *const uncomp_packet, size_t *const ip_hdrs_len)
 Build all of the uncompressed IP headers.
static bool d_tcp_build_tcp_hdr (const struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_values *const decoded, struct rohc_buf *const uncomp_packet, size_t *const tcp_full_len)
 Build the uncompressed TCP header.
static rohc_status_t d_tcp_build_hdrs (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const rohc_packet_t packet_type, const struct rohc_decomp_crc *const extr_crc, const struct rohc_tcp_decoded_values *const decoded, const size_t payload_len, struct rohc_buf *const uncomp_hdrs, size_t *const uncomp_hdrs_len)
 Build the uncompressed headers.
static bool d_tcp_check_uncomp_crc (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, struct rohc_buf *const uncomp_hdrs, const rohc_crc_type_t crc_type, const uint8_t crc_packet)
 Check whether the CRC on uncompressed header is correct or not.
static bool d_tcp_attempt_repair (const struct rohc_decomp *const decomp, const struct rohc_decomp_ctxt *const context, const struct rohc_ts pkt_arrival_time, struct rohc_decomp_crc_corr_ctxt *const crc_corr, struct rohc_tcp_extr_bits *const bits)
 Attempt a packet/context repair upon CRC failure.
static void d_tcp_update_ctxt (struct rohc_decomp_ctxt *const context, const struct rohc_tcp_decoded_values *const decoded, const size_t payload_len, bool *const do_change_mode)
 Update the decompression context with the infos of current packet.

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>

Function Documentation

static bool d_tcp_attempt_repair ( const struct rohc_decomp *const   decomp,
const struct rohc_decomp_ctxt *const   context,
const struct rohc_ts  pkt_arrival_time,
struct rohc_decomp_crc_corr_ctxt *const   crc_corr,
struct rohc_tcp_extr_bits *const   bits 
) [static]

Attempt a packet/context repair upon CRC failure.

Parameters:
decomp The ROHC decompressor
context The decompression context
pkt_arrival_time The arrival time of the ROHC packet that caused the CRC failure
[in,out] crc_corr The context for corrections upon CRC failures
[in,out] bits The bits extracted from the ROHC header
Returns:
true if repair is possible, false if not
static rohc_status_t d_tcp_build_hdrs ( const struct rohc_decomp *const   decomp,
const struct rohc_decomp_ctxt *const   context,
const rohc_packet_t  packet_type,
const struct rohc_decomp_crc *const   extr_crc,
const struct rohc_tcp_decoded_values *const   decoded,
const size_t  payload_len,
struct rohc_buf *const   uncomp_hdrs,
size_t *const   uncomp_hdrs_len 
) [static]

Build the uncompressed headers.

Build all the uncompressed IP headers, TCP headers from the context and packet informations.

Parameters:
decomp The ROHC decompressor
context The decompression context
packet_type The type of ROHC packet
extr_crc The CRC bits extracted from the ROHC header
decoded The values decoded from ROHC header
payload_len The length of the packet payload (in bytes)
[out] uncomp_hdrs The uncompressed headers being built
[out] uncomp_hdrs_len The length of the uncompressed headers written into the buffer
Returns:
Possible values:
  • ROHC_STATUS_OK if headers are built successfully,
  • ROHC_STATUS_BAD_CRC if headers do not match CRC,
  • ROHC_STATUS_OUTPUT_TOO_SMALL if uncomp_packet is too small
static bool d_tcp_build_ip_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_ip_values *const   decoded,
struct rohc_buf *const   uncomp_packet,
size_t *const   ip_hdr_len 
) [static]

Build one single uncompressed IP header.

Build one single uncompressed IP header - IPv4 or IPv6 - from the context and packet informations.

Parameters:
context The decompression context
decoded The values decoded from the ROHC packet
[out] uncomp_packet The uncompressed packet being built
[out] ip_hdr_len The length of the IP header (in bytes)
Returns:
true if IP header was successfully built, false if the output uncomp_packet was not large enough
static bool d_tcp_build_ip_hdrs ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_values *const   decoded,
struct rohc_buf *const   uncomp_packet,
size_t *const   ip_hdrs_len 
) [static]

Build all of the uncompressed IP headers.

Build all of the uncompressed IP headers - IPv4 or IPv6 - from the context and packet informations.

Parameters:
context The decompression context
decoded The values decoded from the ROHC packet
[out] uncomp_packet The uncompressed packet being built
[out] ip_hdrs_len The length of all the IP headers (in bytes)
Returns:
true if IP headers were successfully built, false if the output uncomp_packet was not large enough
static bool d_tcp_build_ipv4_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_ip_values *const   decoded,
struct rohc_buf *const   uncomp_packet,
size_t *const   ip_hdr_len 
) [static]

Build one single uncompressed IPv4 header.

Build one single uncompressed IPv4 header from the context and packet informations.

Parameters:
context The decompression context
decoded The values decoded from the ROHC packet
[out] uncomp_packet The uncompressed packet being built
[out] ip_hdr_len The length of the IPv4 header (in bytes)
Returns:
true if IPv4 header was successfully built, false if the output uncomp_packet was not large enough
static bool d_tcp_build_ipv6_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_ip_values *const   decoded,
struct rohc_buf *const   uncomp_packet,
size_t *const   ip_hdr_len 
) [static]

Build one single uncompressed IPv6 header.

Build one single uncompressed IPv6 header - including IPv6 extension headers - from the context and packet informations.

Parameters:
context The decompression context
decoded The values decoded from the ROHC packet
[out] uncomp_packet The uncompressed packet being built
[out] ip_hdr_len The length of the IPv6 header (in bytes)
Returns:
true if IPv6 header was successfully built, false if the output uncomp_packet was not large enough
static bool d_tcp_build_tcp_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_values *const   decoded,
struct rohc_buf *const   uncomp_packet,
size_t *const   tcp_full_len 
) [static]

Build the uncompressed TCP header.

Build the uncompressed TCP header - including the TCP options - from the context and packet informations.

Parameters:
context The decompression context
decoded The values decoded from ROHC header
[out] uncomp_packet The uncompressed packet being built
[out] tcp_full_len The length of the TCP header (in bytes)
Returns:
true if TCP header was successfully built, false if the output uncomp_packet was not large enough
static bool d_tcp_check_uncomp_crc ( const struct rohc_decomp *const   decomp,
const struct rohc_decomp_ctxt *const   context,
struct rohc_buf *const   uncomp_hdrs,
const rohc_crc_type_t  crc_type,
const uint8_t  crc_packet 
) [static]

Check whether the CRC on uncompressed header is correct or not.

Parameters:
decomp The ROHC decompressor
context The decompression context
uncomp_hdrs The uncompressed headers
crc_type The type of CRC
crc_packet The CRC extracted from the ROHC header
Returns:
true if the CRC is correct, false otherwise
static bool d_tcp_create ( const struct rohc_decomp_ctxt *const   context,
struct d_tcp_context **const   persist_ctxt,
struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [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:
context The main decompression context
[out] persist_ctxt The persistent part of the decompression context
[out] volat_ctxt The volatile part of the decompression context
Returns:
true if creation succeeded, false in case of problem
static bool d_tcp_decode_bits ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_bits *const   bits,
const size_t  payload_len,
struct rohc_tcp_decoded_values *const   decoded 
) [static]

Decode values from extracted bits.

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
payload_len The length of the packet payload (in bytes)
[out] decoded The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static bool d_tcp_decode_bits_ip_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_ip_bits *const   ip_bits,
const ip_context_t *const   ip_context,
const uint16_t  decoded_msn,
struct rohc_tcp_decoded_ip_values *const   ip_decoded 
) [static]

Decode values for one IP header from extracted bits.

Parameters:
context The decompression context
ip_bits The IP bits extracted from the ROHC packet
ip_context The IP values recorded in context
decoded_msn The decoded Master Sequence Number (MSN)
[out] ip_decoded The corresponding decoded IP values
Returns:
true if decoding is successful, false otherwise
static bool d_tcp_decode_bits_ip_hdrs ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_bits *const   bits,
struct rohc_tcp_decoded_values *const   decoded 
) [static]

Decode values for all IP headers from extracted bits.

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
[out] decoded The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static void d_tcp_decode_bits_tcp_flags ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_bits *const   bits,
struct rohc_tcp_decoded_values *const   decoded 
) [static]

Decode values for the TCP header flags from extracted bits.

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
[out] decoded The corresponding decoded values
static bool d_tcp_decode_bits_tcp_hdr ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_bits *const   bits,
const size_t  payload_len,
struct rohc_tcp_decoded_values *const   decoded 
) [static]

Decode values for the TCP header from extracted bits.

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
payload_len The length of the packet payload (in bytes)
[out] decoded The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static bool d_tcp_decode_bits_tcp_opts ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_extr_bits *const   bits,
struct rohc_tcp_decoded_values *const   decoded 
) [static]

Decode values for the TCP options from extracted bits.

Parameters:
context The decompression context
bits The bits extracted from the ROHC packet
[out] decoded The corresponding decoded values
Returns:
true if decoding is successful, false otherwise
static void d_tcp_decode_opt_sack ( const struct rohc_decomp_ctxt *const   context,
const uint32_t  ack_num,
const struct d_tcp_opt_sack  bits,
struct d_tcp_opt_sack *const   decoded 
) [static]

Decode the TCP SACK option.

Warning:
The available length in the opt_sack->uncomp_opt buffer shall have been checked before calling this function
Parameters:
context The decompression context
ack_num The TCP ACK number of the current packet
bits The bits of SACK option extracted from the packet
[out] decoded The values decoded from the ROHC packet
static bool d_tcp_decode_opt_ts_field ( const struct rohc_decomp_ctxt *const   context,
const char *const   descr,
const struct rohc_lsb_decode *const   lsb_ctxt,
const struct rohc_lsb_field32  ts,
uint32_t *const   ts_decoded 
) [static]

Decode the given TS field of the TCP TimeStamp (TS) option.

Warning:
The available length in the opt_ts->uncomp_opt buffer shall have been checked before calling this function
Parameters:
context The decompression context
descr A description for the TS field being decoded
lsb_ctxt The LSB decoding context to use for decoding
ts The TS bits extracted from the ROHC packet
[out] ts_decoded The decoded TS field (in HBO)
Returns:
true if TS field was successfully decoded, false if a problem occurred during decoding
static void d_tcp_destroy ( struct d_tcp_context *const   tcp_context,
const struct rohc_decomp_volat_ctxt *const   volat_ctxt 
) [static]

Destroy the context.

This function is one of the functions that must exist in one profile for the framework to work.

Parameters:
tcp_context The persistent decompression context for the TCP profile
volat_ctxt The volatile decompression 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:
context The decompression context
Returns:
The reference MSN value
static bool d_tcp_parse_CO ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
const rohc_packet_t  packet_type,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len 
) [static]

Parse the given CO packet for the TCP profile.


  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:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
large_cid_len The length of the optional large CID field
packet_type The type of the ROHC packet to parse
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if parsing was successful, false if packet was malformed
Todo:
TODO: avoid malloc/free of packed_rohc_packet
static bool d_tcp_parse_co_common ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given co_common packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_ir ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len 
) [static]

Parse the given IR packet for the TCP profile.

Parameters:
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
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the IR packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_irdyn ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
const size_t  large_cid_len,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len 
) [static]

Parse othe given IR-DYN packet for the TCP profile.

Parameters:
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
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the IR-DYN packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_packet ( const struct rohc_decomp_ctxt *const   context,
const struct rohc_buf  rohc_packet,
const size_t  large_cid_len,
rohc_packet_t *const   packet_type,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   extr_bits,
size_t *const   rohc_hdr_len 
) [static]

Parse the given ROHC packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to parse
large_cid_len The length of the optional large CID field
[in,out] packet_type IN: The type of the ROHC packet to parse OUT: The type of the parsed ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] extr_bits The bits extracted from the ROHC packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_1 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_1 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_2 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_2 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_3 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_3 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_4 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_4 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_5 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_5 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_6 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_6 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_7 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_7 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_rnd_8 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given rnd_8 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_1 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_1 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_2 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_2 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_3 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_3 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_4 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_4 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_5 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_5 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_6 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_6 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_7 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_7 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static bool d_tcp_parse_seq_8 ( const struct rohc_decomp_ctxt *const   context,
const uint8_t *const   rohc_packet,
const size_t  rohc_length,
struct rohc_decomp_crc *const   extr_crc,
struct rohc_tcp_extr_bits *const   bits,
size_t *const   rohc_hdr_len,
bool *const   has_opts_list 
) [static]

Parse the given seq_8 packet for the TCP profile.

Parameters:
context The decompression context
rohc_packet The ROHC packet to decode
rohc_length The length of the ROHC packet
[out] extr_crc The CRC bits extracted from the ROHC header
[out] bits The bits extracted from the CO packet
[out] rohc_hdr_len The length of the ROHC header (in bytes)
[out] has_opts_list Whether the list TCP options is present after the CO packet
Returns:
true if parsing was successful, false if packet was malformed
static void d_tcp_reset_extr_bits ( const struct rohc_decomp_ctxt *const   context,
struct rohc_tcp_extr_bits *const   bits 
) [static]

Reset the extracted bits for next parsing.

Parameters:
context The decompression context
[out] bits The extracted bits to reset
static void d_tcp_update_ctxt ( struct rohc_decomp_ctxt *const   context,
const struct rohc_tcp_decoded_values *const   decoded,
const size_t  payload_len,
bool *const   do_change_mode 
) [static]

Update the decompression context with the infos of current packet.

Parameters:
context The decompression context
decoded The decoded values to update in the context
payload_len The length of the packet payload (in bytes)
[out] do_change_mode Whether the profile context wants to change its operational mode or not
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:
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
Returns:
The packet type

Variable Documentation

Initial value:

Define the decompression part of the TCP profile as described in the RFC 3095.


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