FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
tcp_packet.h File Reference
+ Include dependency graph for tcp_packet.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcp_options_t
 

Macros

#define foreach_tcp_flag
 Sender reduced congestion window. More...
 
#define tcp_doff(_th)   ((_th)->data_offset_and_reserved >> 4)
 
#define tcp_fin(_th)   ((_th)->flags & TCP_FLAG_FIN)
 
#define tcp_syn(_th)   ((_th)->flags & TCP_FLAG_SYN)
 
#define tcp_rst(_th)   ((_th)->flags & TCP_FLAG_RST)
 
#define tcp_psh(_th)   ((_th)->flags & TCP_FLAG_PSH)
 
#define tcp_ack(_th)   ((_th)->flags & TCP_FLAG_ACK)
 
#define tcp_urg(_th)   ((_th)->flags & TCP_FLAG_URG)
 
#define tcp_ece(_th)   ((_th)->flags & TCP_FLAG_ECE)
 
#define tcp_cwr(_th)   ((_th)->flags & TCP_FLAG_CWR)
 
#define tcp_is_syn(_th)   !!((_th)->flags & TCP_FLAG_SYN)
 
#define tcp_is_fin(_th)   !!((_th)->flags & TCP_FLAG_FIN)
 
#define foreach_tcp_options_flag
 SACK present. More...
 
#define tcp_opts_mss(_to)   ((_to)->flags & TCP_OPTS_FLAG_MSS)
 
#define tcp_opts_tstamp(_to)   ((_to)->flags & TCP_OPTS_FLAG_TSTAMP)
 
#define tcp_opts_wscale(_to)   ((_to)->flags & TCP_OPTS_FLAG_WSCALE)
 
#define tcp_opts_sack(_to)   ((_to)->flags & TCP_OPTS_FLAG_SACK)
 
#define tcp_opts_sack_permitted(_to)   ((_to)->flags & TCP_OPTS_FLAG_SACK_PERMITTED)
 
#define TCP_OPTION_LEN_EOL   1
 
#define TCP_OPTION_LEN_NOOP   1
 
#define TCP_OPTION_LEN_MSS   4
 
#define TCP_OPTION_LEN_WINDOW_SCALE   3
 
#define TCP_OPTION_LEN_SACK_PERMITTED   2
 
#define TCP_OPTION_LEN_TIMESTAMP   10
 
#define TCP_OPTION_LEN_SACK_BLOCK   8
 
#define TCP_HDR_LEN_MAX   60
 
#define TCP_WND_MAX   65535U
 
#define TCP_MAX_WND_SCALE   14 /* See RFC 1323 */
 
#define TCP_OPTS_ALIGN   4
 
#define TCP_OPTS_MAX_SACK_BLOCKS   3
 

Typedefs

typedef struct _tcp_header tcp_header_t
 
typedef enum tcp_option_type tcp_option_type_t
 
typedef struct _sack_block sack_block_t
 

Enumerations

enum  { TCP_N_FLAG_BITS }
 
enum  { foreach_tcp_flag }
 
enum  tcp_option_type {
  TCP_OPTION_EOL = 0, TCP_OPTION_NOOP = 1, TCP_OPTION_MSS = 2, TCP_OPTION_WINDOW_SCALE = 3,
  TCP_OPTION_SACK_PERMITTED = 4, TCP_OPTION_SACK_BLOCK = 5, TCP_OPTION_TIMESTAMP = 8, TCP_OPTION_UTO = 28,
  TCP_OPTION_AO = 29
}
 
enum  { TCP_OPTIONS_N_FLAG_BITS }
 
enum  { foreach_tcp_options_flag }
 

Functions

static int tcp_header_bytes (tcp_header_t *t)
 

Macro Definition Documentation

#define foreach_tcp_flag
Value:
_ (FIN) /**< No more data from sender. */ \
_ (SYN) /**< Synchronize sequence numbers. */ \
_ (RST) /**< Reset the connection. */ \
_ (PSH) /**< Push function. */ \
_ (ACK) /**< Ack field significant. */ \
_ (URG) /**< Urgent pointer field significant. */ \
_ (ECE) /**< ECN-echo. Receiver got CE packet */ \
_ (CWR)

Sender reduced congestion window.

Definition at line 22 of file tcp_packet.h.

#define foreach_tcp_options_flag
Value:
_ (MSS) /**< MSS advertised in SYN */ \
_ (TSTAMP) /**< Timestamp capability advertised in SYN */ \
_ (WSCALE) /**< Wnd scale capability advertised in SYN */ \
_ (SACK_PERMITTED) /**< SACK capability advertised in SYN */ \
_ (SACK)

SACK present.

Definition at line 115 of file tcp_packet.h.

#define tcp_ack (   _th)    ((_th)->flags & TCP_FLAG_ACK)

Definition at line 83 of file tcp_packet.h.

#define tcp_cwr (   _th)    ((_th)->flags & TCP_FLAG_CWR)

Definition at line 86 of file tcp_packet.h.

#define tcp_doff (   _th)    ((_th)->data_offset_and_reserved >> 4)

Definition at line 78 of file tcp_packet.h.

#define tcp_ece (   _th)    ((_th)->flags & TCP_FLAG_ECE)

Definition at line 85 of file tcp_packet.h.

#define tcp_fin (   _th)    ((_th)->flags & TCP_FLAG_FIN)

Definition at line 79 of file tcp_packet.h.

#define TCP_HDR_LEN_MAX   60

Definition at line 171 of file tcp_packet.h.

#define tcp_is_fin (   _th)    !!((_th)->flags & TCP_FLAG_FIN)

Definition at line 90 of file tcp_packet.h.

#define tcp_is_syn (   _th)    !!((_th)->flags & TCP_FLAG_SYN)

Definition at line 89 of file tcp_packet.h.

#define TCP_MAX_WND_SCALE   14 /* See RFC 1323 */

Definition at line 173 of file tcp_packet.h.

#define TCP_OPTION_LEN_EOL   1

Definition at line 163 of file tcp_packet.h.

#define TCP_OPTION_LEN_MSS   4

Definition at line 165 of file tcp_packet.h.

#define TCP_OPTION_LEN_NOOP   1

Definition at line 164 of file tcp_packet.h.

#define TCP_OPTION_LEN_SACK_BLOCK   8

Definition at line 169 of file tcp_packet.h.

#define TCP_OPTION_LEN_SACK_PERMITTED   2

Definition at line 167 of file tcp_packet.h.

#define TCP_OPTION_LEN_TIMESTAMP   10

Definition at line 168 of file tcp_packet.h.

#define TCP_OPTION_LEN_WINDOW_SCALE   3

Definition at line 166 of file tcp_packet.h.

#define TCP_OPTS_ALIGN   4

Definition at line 174 of file tcp_packet.h.

#define TCP_OPTS_MAX_SACK_BLOCKS   3

Definition at line 175 of file tcp_packet.h.

#define tcp_opts_mss (   _to)    ((_to)->flags & TCP_OPTS_FLAG_MSS)

Definition at line 156 of file tcp_packet.h.

#define tcp_opts_sack (   _to)    ((_to)->flags & TCP_OPTS_FLAG_SACK)

Definition at line 159 of file tcp_packet.h.

#define tcp_opts_sack_permitted (   _to)    ((_to)->flags & TCP_OPTS_FLAG_SACK_PERMITTED)

Definition at line 160 of file tcp_packet.h.

#define tcp_opts_tstamp (   _to)    ((_to)->flags & TCP_OPTS_FLAG_TSTAMP)

Definition at line 157 of file tcp_packet.h.

#define tcp_opts_wscale (   _to)    ((_to)->flags & TCP_OPTS_FLAG_WSCALE)

Definition at line 158 of file tcp_packet.h.

#define tcp_psh (   _th)    ((_th)->flags & TCP_FLAG_PSH)

Definition at line 82 of file tcp_packet.h.

#define tcp_rst (   _th)    ((_th)->flags & TCP_FLAG_RST)

Definition at line 81 of file tcp_packet.h.

#define tcp_syn (   _th)    ((_th)->flags & TCP_FLAG_SYN)

Definition at line 80 of file tcp_packet.h.

#define tcp_urg (   _th)    ((_th)->flags & TCP_FLAG_URG)

Definition at line 84 of file tcp_packet.h.

#define TCP_WND_MAX   65535U

Definition at line 172 of file tcp_packet.h.

Typedef Documentation

typedef struct _sack_block sack_block_t
typedef struct _tcp_header tcp_header_t

Enumeration Type Documentation

anonymous enum
Enumerator
TCP_N_FLAG_BITS 

Definition at line 32 of file tcp_packet.h.

anonymous enum
Enumerator
foreach_tcp_flag 

Definition at line 40 of file tcp_packet.h.

anonymous enum
Enumerator
TCP_OPTIONS_N_FLAG_BITS 

Definition at line 122 of file tcp_packet.h.

anonymous enum
Enumerator
foreach_tcp_options_flag 

Definition at line 130 of file tcp_packet.h.

Enumerator
TCP_OPTION_EOL 

End of options.

TCP_OPTION_NOOP 

No operation.

TCP_OPTION_MSS 

Limit MSS.

TCP_OPTION_WINDOW_SCALE 

Window scale.

TCP_OPTION_SACK_PERMITTED 

Selective Ack permitted.

TCP_OPTION_SACK_BLOCK 

Selective Ack block.

TCP_OPTION_TIMESTAMP 

Timestamps.

TCP_OPTION_UTO 

User timeout.

TCP_OPTION_AO 

Authentication Option.

Definition at line 102 of file tcp_packet.h.

Function Documentation

static int tcp_header_bytes ( tcp_header_t t)
inlinestatic

Definition at line 93 of file tcp_packet.h.

+ Here is the caller graph for this function: