ROHC compression/decompression library
Data Structures | Macros | Enumerations | Functions
tcp.h File Reference

TCP header description. More...

#include <stdint.h>
#include <assert.h>
#include "config.h"
Include dependency graph for tcp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcphdr
 The TCP base header without options. More...
 
struct  sack_block_t
 The Selective Acknowlegment TCP option. More...
 
struct  tcp_option_timestamp
 
struct  ipv4_static_t
 The IPv4 static part. More...
 
struct  ipv4_dynamic1_t
 The IPv4 dynamic part without IP-ID field. More...
 
struct  ipv4_dynamic2_t
 The IPv4 dynamic part with IP-ID field. More...
 
struct  ip_opt_static_t
 
struct  ip_dest_opt_static_t
 
struct  ip_hop_opt_static_t
 
struct  ip_rout_opt_static_t
 
struct  ipv6_static1_t
 The IPv6 static part, null flow_label encoded with 1 bit. More...
 
struct  ipv6_static2_t
 The IPv6 static part, flow_label encoded with 1+20 bits. More...
 
struct  ipv6_dynamic_t
 The IPv6 dynamic part. More...
 
struct  tcp_static_t
 The TCP static part. More...
 
struct  tcp_dynamic_t
 The TCP dynamic part. More...
 
struct  co_common_t
 The Common compressed packet format. More...
 
struct  rnd_1_t
 The rnd_1 compressed packet format. More...
 
struct  rnd_2_t
 The rnd_2 compressed packet format. More...
 
struct  rnd_3_t
 The rnd_3 compressed packet format. More...
 
struct  rnd_4_t
 The rnd_4 compressed packet format. More...
 
struct  rnd_5_t
 The rnd_5 compressed packet format. More...
 
struct  rnd_6_t
 The rnd_6 compressed packet format. More...
 
struct  rnd_7_t
 The rnd_7 compressed packet format. More...
 
struct  rnd_8_t
 The rnd_8 compressed packet format. More...
 
struct  seq_1_t
 The seq_1 compressed packet format. More...
 
struct  seq_2_t
 The seq_2 compressed packet format. More...
 
struct  seq_3_t
 The seq_3 compressed packet format. More...
 
struct  seq_4_t
 The seq_4 compressed packet format. More...
 
struct  seq_5_t
 The seq_5 compressed packet format. More...
 
struct  seq_6_t
 The seq_6 compressed packet format. More...
 
struct  seq_7_t
 The seq_7 compressed packet format. More...
 
struct  seq_8_t
 The seq_8 compressed packet format. More...
 

Macros

#define ROHC_PACKET_TYPE_IR   0xFD
 
#define ROHC_PACKET_TYPE_IR_DYN   0xF8
 
#define ROHC_TCP_MAX_IP_HDRS   10U
 The maximum number of IP headers supported by the TCP profile. More...
 
#define ROHC_TCP_MAX_IP_EXT_HDRS   20U
 The maximum number of IP extension header supported by the TCP profile. More...
 
#define MAX_TCP_OPTION_INDEX   15U
 The largest index that may be used to identify one TCP option. More...
 
#define ROHC_TCP_OPTS_MAX_PROTO   40U
 The maximum of TCP options supported by the TCP protocol. More...
 
#define ROHC_TCP_OPTS_MAX   15U
 The maximum of TCP options supported by the TCP profile. More...
 
#define RSF_RST_ONLY   0x04
 
#define RSF_SYN_ONLY   0x02
 
#define RSF_FIN_ONLY   0x01
 
#define RSF_NONE   0x00
 
#define TCP_OLEN_MSS   4U
 
#define TCP_OLEN_WS   3U
 
#define TCP_OLEN_SACK_PERM   2U
 
#define TCP_OLEN_TS   10U
 
#define TCP_INDEX_NOP   0U
 
#define TCP_INDEX_EOL   1U
 
#define TCP_INDEX_MSS   2U
 
#define TCP_INDEX_WS   3U
 
#define TCP_INDEX_TS   4U
 
#define TCP_INDEX_SACK_PERM   5U
 
#define TCP_INDEX_SACK   6U
 
#define TCP_INDEX_GENERIC7   7U
 
#define TCP_INDEX_GENERIC8   8U
 
#define TCP_INDEX_GENERIC9   9U
 
#define TCP_INDEX_GENERIC10   10U
 
#define TCP_INDEX_GENERIC11   11U
 
#define TCP_INDEX_GENERIC12   12U
 
#define TCP_INDEX_GENERIC13   13U
 
#define TCP_INDEX_GENERIC14   14U
 
#define TCP_INDEX_GENERIC15   15U
 
#define TCP_SACK_BLOCKS_MAX_NR   4U
 

Enumerations

enum  rohc_tcp_option_type_t {
  TCP_OPT_EOL = 0U, TCP_OPT_NOP = 1U, TCP_OPT_MSS = 2U, TCP_OPT_WS = 3U,
  TCP_OPT_SACK_PERM = 4U, TCP_OPT_SACK = 5U, TCP_OPT_TS = 8U, TCP_OPT_MAX = 255U
}
 
enum  tcp_ip_id_behavior_t { IP_ID_BEHAVIOR_SEQ = 0, IP_ID_BEHAVIOR_SEQ_SWAP = 1, IP_ID_BEHAVIOR_RAND = 2, IP_ID_BEHAVIOR_ZERO = 3 }
 

Functions

static char * tcp_ip_id_behavior_get_descr (const tcp_ip_id_behavior_t behavior)
 Get a string that describes the given IP-ID behavior. More...
 
static char * tcp_opt_get_descr (const uint8_t opt_type)
 Get a string that describes the given option type. More...
 

Detailed Description

TCP header description.

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

Macro Definition Documentation

#define MAX_TCP_OPTION_INDEX   15U

The largest index that may be used to identify one TCP option.

The ROHC standard defines that one TCP option is identified by an index. It also defines that index is in range [0 ; 15].

#define ROHC_PACKET_TYPE_IR   0xFD
#define ROHC_PACKET_TYPE_IR_DYN   0xF8
#define ROHC_TCP_MAX_IP_EXT_HDRS   20U

The maximum number of IP extension header supported by the TCP profile.

The limit value was chosen arbitrarily. It should handle most real-life case without hurting performances nor memory footprint.

#define ROHC_TCP_MAX_IP_HDRS   10U

The maximum number of IP headers supported by the TCP profile.

The limit value was chosen arbitrarily. It should handle most real-life case without hurting performances nor memory footprint.

#define ROHC_TCP_OPTS_MAX   15U

The maximum of TCP options supported by the TCP profile.

One TCP header may contain up to 40 bytes of options, so it may contain up 40 1-byte options, so the ROHC (de)compressors should expect such TCP packets. However the m field in the compressed list of TCP options (see RFC 6846, section 6.3.3 for more details) cannot be larger than 15, so restrict the number of TCP options that value. One TCP packet with more than 15 TCP options will be compressed with the IP-only profile.

See also
ROHC_TCP_OPTS_MAX_PROTO
#define ROHC_TCP_OPTS_MAX_PROTO   40U

The maximum of TCP options supported by the TCP protocol.

One TCP header may contain up to 40 bytes of options, so it may contain up 40 1-byte options.

See also
ROHC_TCP_OPTS_MAX
#define RSF_FIN_ONLY   0x01
#define RSF_NONE   0x00
#define RSF_RST_ONLY   0x04
#define RSF_SYN_ONLY   0x02
#define TCP_INDEX_EOL   1U
#define TCP_INDEX_GENERIC10   10U
#define TCP_INDEX_GENERIC11   11U
#define TCP_INDEX_GENERIC12   12U
#define TCP_INDEX_GENERIC13   13U
#define TCP_INDEX_GENERIC14   14U
#define TCP_INDEX_GENERIC15   15U
#define TCP_INDEX_GENERIC7   7U
#define TCP_INDEX_GENERIC8   8U
#define TCP_INDEX_GENERIC9   9U
#define TCP_INDEX_MSS   2U
#define TCP_INDEX_NOP   0U
#define TCP_INDEX_SACK   6U
#define TCP_INDEX_SACK_PERM   5U
#define TCP_INDEX_TS   4U
#define TCP_INDEX_WS   3U
#define TCP_OLEN_MSS   4U
#define TCP_OLEN_SACK_PERM   2U
#define TCP_OLEN_TS   10U
#define TCP_OLEN_WS   3U
#define TCP_SACK_BLOCKS_MAX_NR   4U

The maximum number of SACK blocks in the TCP SACK option

Enumeration Type Documentation

The different TCP options

Enumerator
TCP_OPT_EOL 

The End of Option List (EOL) TCP option

TCP_OPT_NOP 

The No OPeration (NOP) TCP option

TCP_OPT_MSS 

The Maximum Segment Size (MSS) TCP option

TCP_OPT_WS 

The Window Scale (WS) TCP option

TCP_OPT_SACK_PERM 

The SACK Permitted TCP option

TCP_OPT_SACK 

The Selective ACKnowledgement (SACK) TCP option

TCP_OPT_TS 

The TimeStamp (TS) TCP option

TCP_OPT_MAX 

The maximum TCP option

The different IP-ID behaviors

Enumerator
IP_ID_BEHAVIOR_SEQ 

IP-ID increases

IP_ID_BEHAVIOR_SEQ_SWAP 

IP-ID increases in little endian

IP_ID_BEHAVIOR_RAND 

IP-ID is random

IP_ID_BEHAVIOR_ZERO 

IP-ID is constant zero

Function Documentation

static char * tcp_ip_id_behavior_get_descr ( const tcp_ip_id_behavior_t  behavior)
inlinestatic

Get a string that describes the given IP-ID behavior.

Parameters
behaviorThe type of the option to get a description for
Returns
The description of the option
static char * tcp_opt_get_descr ( const uint8_t  opt_type)
inlinestatic

Get a string that describes the given option type.

Parameters
opt_typeThe type of the option to get a description for
Returns
The description of the option