![]() |
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
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 |
| #define | TCP_MAX_GSO_SZ 65536 |
| #define | seq_lt(_s1, _s2) ((i32)((_s1)-(_s2)) < 0) |
| #define | seq_leq(_s1, _s2) ((i32)((_s1)-(_s2)) <= 0) |
| #define | seq_gt(_s1, _s2) ((i32)((_s1)-(_s2)) > 0) |
| #define | seq_geq(_s1, _s2) ((i32)((_s1)-(_s2)) >= 0) |
| #define | seq_max(_s1, _s2) (seq_gt((_s1), (_s2)) ? (_s1) : (_s2)) |
| #define | timestamp_lt(_t1, _t2) ((i32)((_t1)-(_t2)) < 0) |
| #define | timestamp_leq(_t1, _t2) ((i32)((_t1)-(_t2)) <= 0) |
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) |
| static int | tcp_options_parse (tcp_header_t *th, tcp_options_t *to, u8 is_syn) |
| Parse TCP header options. More... | |
| static u32 | tcp_options_write (u8 *data, tcp_options_t *opts) |
| Write TCP options to segment. More... | |
| #define foreach_tcp_flag |
Sender reduced congestion window.
Definition at line 22 of file tcp_packet.h.
| #define foreach_tcp_options_flag |
SACK present.
Definition at line 115 of file tcp_packet.h.
| #define seq_geq | ( | _s1, | |
| _s2 | |||
| ) | ((i32)((_s1)-(_s2)) >= 0) |
Definition at line 181 of file tcp_packet.h.
| #define seq_gt | ( | _s1, | |
| _s2 | |||
| ) | ((i32)((_s1)-(_s2)) > 0) |
Definition at line 180 of file tcp_packet.h.
| #define seq_leq | ( | _s1, | |
| _s2 | |||
| ) | ((i32)((_s1)-(_s2)) <= 0) |
Definition at line 179 of file tcp_packet.h.
| #define seq_lt | ( | _s1, | |
| _s2 | |||
| ) | ((i32)((_s1)-(_s2)) < 0) |
Definition at line 178 of file tcp_packet.h.
| #define seq_max | ( | _s1, | |
| _s2 | |||
| ) | (seq_gt((_s1), (_s2)) ? (_s1) : (_s2)) |
Definition at line 182 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 170 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_GSO_SZ 65536 |
Definition at line 175 of file tcp_packet.h.
| #define TCP_MAX_WND_SCALE 14 /* See RFC 1323 */ |
Definition at line 172 of file tcp_packet.h.
| #define TCP_OPTION_LEN_EOL 1 |
Definition at line 162 of file tcp_packet.h.
| #define TCP_OPTION_LEN_MSS 4 |
Definition at line 164 of file tcp_packet.h.
| #define TCP_OPTION_LEN_NOOP 1 |
Definition at line 163 of file tcp_packet.h.
| #define TCP_OPTION_LEN_SACK_BLOCK 8 |
Definition at line 168 of file tcp_packet.h.
| #define TCP_OPTION_LEN_SACK_PERMITTED 2 |
Definition at line 166 of file tcp_packet.h.
| #define TCP_OPTION_LEN_TIMESTAMP 10 |
Definition at line 167 of file tcp_packet.h.
| #define TCP_OPTION_LEN_WINDOW_SCALE 3 |
Definition at line 165 of file tcp_packet.h.
| #define TCP_OPTS_ALIGN 4 |
Definition at line 173 of file tcp_packet.h.
| #define TCP_OPTS_MAX_SACK_BLOCKS 3 |
Definition at line 174 of file tcp_packet.h.
| #define tcp_opts_mss | ( | _to | ) | ((_to)->flags & TCP_OPTS_FLAG_MSS) |
Definition at line 155 of file tcp_packet.h.
| #define tcp_opts_sack | ( | _to | ) | ((_to)->flags & TCP_OPTS_FLAG_SACK) |
Definition at line 158 of file tcp_packet.h.
| #define tcp_opts_sack_permitted | ( | _to | ) | ((_to)->flags & TCP_OPTS_FLAG_SACK_PERMITTED) |
Definition at line 159 of file tcp_packet.h.
| #define tcp_opts_tstamp | ( | _to | ) | ((_to)->flags & TCP_OPTS_FLAG_TSTAMP) |
Definition at line 156 of file tcp_packet.h.
| #define tcp_opts_wscale | ( | _to | ) | ((_to)->flags & TCP_OPTS_FLAG_WSCALE) |
Definition at line 157 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 171 of file tcp_packet.h.
| #define timestamp_leq | ( | _t1, | |
| _t2 | |||
| ) | ((i32)((_t1)-(_t2)) <= 0) |
Definition at line 186 of file tcp_packet.h.
| #define timestamp_lt | ( | _t1, | |
| _t2 | |||
| ) | ((i32)((_t1)-(_t2)) < 0) |
Definition at line 185 of file tcp_packet.h.
| typedef struct _sack_block sack_block_t |
| typedef struct _tcp_header tcp_header_t |
| typedef enum tcp_option_type tcp_option_type_t |
| 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.
| enum tcp_option_type |
Definition at line 102 of file tcp_packet.h.
|
inlinestatic |
|
inlinestatic |
Parse TCP header options.
| th | TCP header |
| to | TCP options data structure to be populated |
| is_syn | set if packet is syn |
Definition at line 197 of file tcp_packet.h.
Here is the caller graph for this function:
|
inlinestatic |
Write TCP options to segment.
| data | buffer where to write the options |
| opts | options to write |
Definition at line 309 of file tcp_packet.h.
Here is the call graph for this function:
Here is the caller graph for this function: