c_tcp_opts_list.h File Reference

Handle the list of TCP options for the TCP ompression profile. More...

#include "rohc_comp_internals.h"
#include "protocols/tcp.h"
#include <stdint.h>
#include <stddef.h>
Include dependency graph for c_tcp_opts_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  c_tcp_opt_ctxt
 The compression context for one TCP option. More...
struct  c_tcp_opts_ctxt_tmp
struct  c_tcp_opts_ctxt

Defines

#define MAX_TCP_OPT_SIZE   40U

Functions

bool rohc_comp_tcp_are_options_acceptable (const struct rohc_comp *const comp, const uint8_t *const opts, const size_t data_offset)
 Whether TCP options are acceptable for TCP profile or not.
bool tcp_detect_options_changes (struct rohc_comp_ctxt *const context, const struct tcphdr *const tcp, struct c_tcp_opts_ctxt *const opts_ctxt, size_t *const opts_len)
 Parse the uncompressed TCP options for changes.
int c_tcp_code_tcp_opts_list_item (const struct rohc_comp_ctxt *const context, const struct tcphdr *const tcp, const uint16_t msn, const bool is_dynamic_chain, struct c_tcp_opts_ctxt *const opts_ctxt, uint8_t *const comp_opts, const size_t comp_opts_max_len)
 Build the list of TCP options items.
int c_tcp_code_tcp_opts_irreg (const struct rohc_comp_ctxt *const context, const struct tcphdr *const tcp, const uint16_t msn, struct c_tcp_opts_ctxt *const opts_ctxt, uint8_t *const comp_opts, const size_t comp_opts_max_len)
 Build the list of TCP options for the irregular chain.

Detailed Description

Handle the list of TCP options for the TCP ompression profile.

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

Define Documentation

#define MAX_TCP_OPT_SIZE   40U

The maximum size (in bytes) of one TCP option


Function Documentation

int c_tcp_code_tcp_opts_irreg ( const struct rohc_comp_ctxt *const   context,
const struct tcphdr *const   tcp,
const uint16_t  msn,
struct c_tcp_opts_ctxt *const   opts_ctxt,
uint8_t *const   comp_opts,
const size_t  comp_opts_max_len 
)

Build the list of TCP options for the irregular chain.

All the CO packets contains an irregular chain.

Parameters:
context The compression context
tcp The TCP header
msn The Master Sequence Number (MSN) of the packet to compress
[in,out] opts_ctxt The compression context for TCP options
[out] comp_opts The compressed TCP options
comp_opts_max_len The max remaining length in the ROHC buffer
Returns:
The length (in bytes) of compressed TCP options in case of success, -1 in case of failure
Todo:
TODO: defines 'options profiles' the same way as for decompressor
int c_tcp_code_tcp_opts_list_item ( const struct rohc_comp_ctxt *const   context,
const struct tcphdr *const   tcp,
const uint16_t  msn,
const bool  is_dynamic_chain,
struct c_tcp_opts_ctxt *const   opts_ctxt,
uint8_t *const   comp_opts,
const size_t  comp_opts_max_len 
)

Build the list of TCP options items.

The list of TCP options is used in the dynamic chain of the IR and IR-DYN packets, but also at the end of the rnd_8, seq_8, and co_common packets.

Parameters:
context The compression context
tcp The TCP header
msn The Master Sequence Number (MSN) of the packet to compress
is_dynamic_chain Whether the list of items is for the dynamic chain or not
[in,out] opts_ctxt The compression context for TCP options
[out] comp_opts The compressed TCP options
comp_opts_max_len The max remaining length in the ROHC buffer
Returns:
The length (in bytes) of compressed TCP options in case of success, -1 in case of failure
bool rohc_comp_tcp_are_options_acceptable ( const struct rohc_comp *const   comp,
const uint8_t *const   opts,
const size_t  data_offset 
)

Whether TCP options are acceptable for TCP profile or not.

TCP options are acceptable for the TCP profile if:

  • the last TCP option is not truncated,
  • well-known TCP options got the expected length (see below),
  • no more than ROHC_TCP_OPTS_MAX options are present,
  • each TCP options is present only once (except EOL and NOP).

The following well-known TCP options shall have expected lengthes:

  • MSS shall be TCP_OLEN_MSS long,
  • WS shall be TCP_OLEN_WS long,
  • SACK Permitted shall be TCP_OLEN_SACK_PERM long,
  • SACK shall be 2 + N * 8 with N in range [1, 4]
  • TS shall be TCP_OLEN_TS long.
Parameters:
comp The ROHC compressor
opts The beginning of the TCP options
data_offset The length (in 32-bit words) of the full TCP header
Returns:
true if the TCP options are acceptable, false if they are not
See also:
ROHC_TCP_OPTS_MAX
bool tcp_detect_options_changes ( struct rohc_comp_ctxt *const   context,
const struct tcphdr *const   tcp,
struct c_tcp_opts_ctxt *const   opts_ctxt,
size_t *const   opts_len 
)

Parse the uncompressed TCP options for changes.

Parameters:
context The compression context
tcp The TCP header
[in,out] opts_ctxt The compression context for TCP options
[out] opts_len The length (in bytes) of the TCP options
Returns:
true if the TCP options were successfully parsed and can be compressed, false otherwise

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