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

TCP header description. More...

#include <stdint.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
 

Macros

#define RSF_RST_ONLY   0x04
 
#define RSF_SYN_ONLY   0x02
 
#define RSF_FIN_ONLY   0x01
 
#define RSF_NONE   0x00
 
#define ROHC_TCP_OPTS_LEN_MAX_PROTO   (15U * 4U - (uint8_t) sizeof(struct tcphdr))
 The maximum length of TCP options supported by the TCP protocol. More...
 
#define ROHC_TCP_OPTS_MAX_PROTO   ROHC_TCP_OPTS_LEN_MAX_PROTO
 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 ROHC_TCP_OPT_HDR_LEN   2U
 
#define ROHC_TCP_OPT_MAX_LEN_PROTO   0xffU
 
#define TCP_OLEN_MSS   4U
 
#define TCP_OLEN_WS   3U
 
#define TCP_OLEN_SACK_PERM   2U
 
#define TCP_OLEN_TS   10U
 
#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
}
 

Functions

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

◆ ROHC_TCP_OPT_HDR_LEN

#define ROHC_TCP_OPT_HDR_LEN   2U

The length of the header of one TCP option

◆ ROHC_TCP_OPT_MAX_LEN_PROTO

#define ROHC_TCP_OPT_MAX_LEN_PROTO   0xffU

The maximum length of TCP options supported by the TCP protocol

◆ ROHC_TCP_OPTS_LEN_MAX_PROTO

#define ROHC_TCP_OPTS_LEN_MAX_PROTO   (15U * 4U - (uint8_t) sizeof(struct tcphdr))

The maximum length of TCP options supported by the TCP protocol.

The TCP data offset is coded on 32-bit words on 4 bits, so the whole TCP header may be up to 15*4=60 bytes. The base TCP header is 20-byte long.

◆ ROHC_TCP_OPTS_MAX

#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

◆ ROHC_TCP_OPTS_MAX_PROTO

#define ROHC_TCP_OPTS_MAX_PROTO   ROHC_TCP_OPTS_LEN_MAX_PROTO

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

◆ RSF_FIN_ONLY

#define RSF_FIN_ONLY   0x01

◆ RSF_NONE

#define RSF_NONE   0x00

◆ RSF_RST_ONLY

#define RSF_RST_ONLY   0x04

◆ RSF_SYN_ONLY

#define RSF_SYN_ONLY   0x02

◆ TCP_OLEN_MSS

#define TCP_OLEN_MSS   4U

◆ TCP_OLEN_SACK_PERM

#define TCP_OLEN_SACK_PERM   2U

◆ TCP_OLEN_TS

#define TCP_OLEN_TS   10U

◆ TCP_OLEN_WS

#define TCP_OLEN_WS   3U

◆ TCP_SACK_BLOCKS_MAX_NR

#define TCP_SACK_BLOCKS_MAX_NR   4U

The maximum number of SACK blocks in the TCP SACK option

Enumeration Type Documentation

◆ rohc_tcp_option_type_t

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

Function Documentation

◆ tcp_opt_get_descr()

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