FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
tcp_inlines.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef SRC_VNET_TCP_TCP_INLINES_H_
17 #define SRC_VNET_TCP_TCP_INLINES_H_
18 
19 #include <vnet/tcp/tcp.h>
20 
23 {
24  ASSERT ((signed) b->current_data >= (signed) -VLIB_BUFFER_PRE_DATA_SIZE);
25  return (tcp_header_t *) (b->data + b->current_data
26  + vnet_buffer (b)->tcp.hdr_offset);
27 }
28 
31 {
33  if (PREDICT_FALSE (pool_is_free_index (wrk->connections, conn_index)))
34  return 0;
35  return pool_elt_at_index (wrk->connections, conn_index);
36 }
37 
40 {
42  if (thread_index >= vec_len (tcp_main.wrk_ctx))
43  return 0;
45  if (pool_is_free_index (wrk->connections, conn_index))
46  return 0;
47  return pool_elt_at_index (wrk->connections, conn_index);
48 }
49 
50 always_inline void
52 {
53  tc->state = state;
54  TCP_EVT (TCP_EVT_STATE_CHANGE, tc);
55 }
56 
59 {
60  tcp_connection_t *tc = 0;
61  if (!pool_is_free_index (tcp_main.listener_pool, tli))
62  tc = pool_elt_at_index (tcp_main.listener_pool, tli);
63  return tc;
64 }
65 
68 {
69  tcp_connection_t *tc = 0;
70  if (!pool_is_free_index (tcp_main.half_open_connections, conn_index))
71  tc = pool_elt_at_index (tcp_main.half_open_connections, conn_index);
72  return tc;
73 }
74 
75 /**
76  * Our estimate of the number of bytes that have left the network
77  */
80 {
81  if (tcp_opts_sack_permitted (&tc->rcv_opts))
82  return tc->sack_sb.sacked_bytes + tc->sack_sb.lost_bytes;
83  else
84  return clib_min (tc->rcv_dupacks * tc->snd_mss,
85  tc->snd_nxt - tc->snd_una);
86 }
87 
88 /**
89  * Our estimate of the number of bytes in flight (pipe size)
90  */
93 {
94  int flight_size;
95 
96  flight_size = (int) (tc->snd_nxt - tc->snd_una) - tcp_bytes_out (tc)
97  + tc->snd_rxt_bytes - tc->rxt_delivered;
98 
99  ASSERT (flight_size >= 0);
100 
101  return flight_size;
102 }
103 
104 /**
105  * Initial cwnd as per RFC5681
106  */
109 {
110  if (tcp_cfg.initial_cwnd_multiplier > 0)
111  return tcp_cfg.initial_cwnd_multiplier * tc->snd_mss;
112 
113  if (tc->snd_mss > 2190)
114  return 2 * tc->snd_mss;
115  else if (tc->snd_mss > 1095)
116  return 3 * tc->snd_mss;
117  else
118  return 4 * tc->snd_mss;
119 }
120 
121 /*
122  * Accumulate acked bytes for cwnd increase
123  *
124  * Once threshold bytes are accumulated, snd_mss bytes are added
125  * to the cwnd.
126  */
127 always_inline void
129 {
130  tc->cwnd_acc_bytes += bytes;
131  if (tc->cwnd_acc_bytes >= thresh)
132  {
133  u32 inc = tc->cwnd_acc_bytes / thresh;
134  tc->cwnd_acc_bytes -= inc * thresh;
135  tc->cwnd += inc * tc->snd_mss;
136  tc->cwnd = clib_min (tc->cwnd, tc->tx_fifo_size);
137  }
138 }
139 
142 {
143  /* Whatever we have in flight + the packet we're about to send */
144  return tcp_flight_size (tc) + tc->snd_mss;
145 }
146 
149 {
150  return clib_min (tc->cwnd, tc->snd_wnd);
151 }
152 
155 {
156  u32 available_wnd = tcp_available_snd_wnd (tc);
157  int flight_size = (int) (tc->snd_nxt - tc->snd_una);
158 
159  if (available_wnd <= flight_size)
160  return 0;
161 
162  return available_wnd - flight_size;
163 }
164 
165 /**
166  * Estimate of how many bytes we can still push into the network
167  */
170 {
171  u32 available_wnd = tcp_available_snd_wnd (tc);
172  u32 flight_size = tcp_flight_size (tc);
173 
174  if (available_wnd <= flight_size)
175  return 0;
176 
177  return available_wnd - flight_size;
178 }
179 
182 {
183  if ((tc->flags & TCP_CONN_FINSNT) && (tc->snd_nxt - tc->snd_una == 1))
184  return 1;
185  return 0;
186 }
187 
188 /**
189  * Time used to generate timestamps, not the timestamp
190  */
193 {
194  return tcp_main.wrk_ctx[thread_index].time_tstamp;
195 }
196 
197 /**
198  * Generate timestamp for tcp connection
199  */
202 {
203  return (tcp_main.wrk_ctx[tc->c_thread_index].time_tstamp -
204  tc->timestamp_delta);
205 }
206 
209 {
210  return tcp_main.wrk_ctx[thread_index].time_us;
211 }
212 
213 always_inline void
215 {
216  /* TCP internal cache of time reference. Could use @ref transport_time_now
217  * but because @ref tcp_time_now_us is used per packet, caching might
218  * slightly improve efficiency. */
219  wrk->time_us = now;
220  wrk->time_tstamp = (u64) (now * TCP_TSTP_HZ);
221 }
222 
223 always_inline void
225 {
226  f64 now = vlib_time_now (wrk->vm);
227 
228  /* Both pacer and tcp us time need to be updated */
231 }
232 
235  u8 is_ip4, u8 is_nolookup)
236 {
237  u32 fib_index = vnet_buffer (b)->ip.fib_index;
238  int n_advance_bytes, n_data_bytes;
240  tcp_header_t *tcp;
241  u8 result = 0;
242 
243  if (is_ip4)
244  {
246  int ip_hdr_bytes = ip4_header_bytes (ip4);
247  if (PREDICT_FALSE (b->current_length < ip_hdr_bytes + sizeof (*tcp)))
248  {
249  *error = TCP_ERROR_LENGTH;
250  return 0;
251  }
252  tcp = ip4_next_header (ip4);
253  vnet_buffer (b)->tcp.hdr_offset = (u8 *) tcp - (u8 *) ip4;
254  n_advance_bytes = (ip_hdr_bytes + tcp_header_bytes (tcp));
255  n_data_bytes = clib_net_to_host_u16 (ip4->length) - n_advance_bytes;
256 
257  /* Length check. Checksum computed by ipx_local no need to compute again */
258  if (PREDICT_FALSE (n_data_bytes < 0))
259  {
260  *error = TCP_ERROR_LENGTH;
261  return 0;
262  }
263 
264  if (!is_nolookup)
265  tc = session_lookup_connection_wt4 (fib_index, &ip4->dst_address,
266  &ip4->src_address, tcp->dst_port,
267  tcp->src_port,
268  TRANSPORT_PROTO_TCP, thread_index,
269  &result);
270  }
271  else
272  {
274  if (PREDICT_FALSE (b->current_length < sizeof (*ip6) + sizeof (*tcp)))
275  {
276  *error = TCP_ERROR_LENGTH;
277  return 0;
278  }
279  tcp = ip6_next_header (ip6);
280  vnet_buffer (b)->tcp.hdr_offset = (u8 *) tcp - (u8 *) ip6;
281  n_advance_bytes = tcp_header_bytes (tcp);
282  n_data_bytes = clib_net_to_host_u16 (ip6->payload_length)
283  - n_advance_bytes;
284  n_advance_bytes += sizeof (ip6[0]);
285 
286  if (PREDICT_FALSE (n_data_bytes < 0))
287  {
288  *error = TCP_ERROR_LENGTH;
289  return 0;
290  }
291 
292  if (!is_nolookup)
293  {
294  if (PREDICT_FALSE
295  (ip6_address_is_link_local_unicast (&ip6->dst_address)))
296  {
297  ip6_main_t *im = &ip6_main;
298  fib_index = vec_elt (im->fib_index_by_sw_if_index,
300  }
301 
302  tc = session_lookup_connection_wt6 (fib_index, &ip6->dst_address,
303  &ip6->src_address,
304  tcp->dst_port, tcp->src_port,
305  TRANSPORT_PROTO_TCP,
306  thread_index, &result);
307  }
308  }
309 
310  if (is_nolookup)
311  tc =
313  tcp.connection_index,
314  thread_index);
315 
316  vnet_buffer (b)->tcp.seq_number = clib_net_to_host_u32 (tcp->seq_number);
317  vnet_buffer (b)->tcp.ack_number = clib_net_to_host_u32 (tcp->ack_number);
318  vnet_buffer (b)->tcp.data_offset = n_advance_bytes;
319  vnet_buffer (b)->tcp.data_len = n_data_bytes;
320  vnet_buffer (b)->tcp.seq_end = vnet_buffer (b)->tcp.seq_number
321  + n_data_bytes;
322 
323  *error = result ? TCP_ERROR_NONE + result : *error;
324 
326 }
327 
328 /**
329  * Initialize connection by gleaning network and rcv params from buffer
330  *
331  * @param tc connection to initialize
332  * @param b buffer whose current data is pointing at ip
333  * @param is_ip4 flag set to 1 if using ip4
334  */
335 always_inline void
337 {
338  tcp_header_t *th = tcp_buffer_hdr (b);
339 
340  tc->c_lcl_port = th->dst_port;
341  tc->c_rmt_port = th->src_port;
342  tc->c_is_ip4 = is_ip4;
343 
344  if (is_ip4)
345  {
347  tc->c_lcl_ip4.as_u32 = ip4->dst_address.as_u32;
348  tc->c_rmt_ip4.as_u32 = ip4->src_address.as_u32;
349  }
350  else
351  {
353  clib_memcpy_fast (&tc->c_lcl_ip6, &ip6->dst_address,
354  sizeof (ip6_address_t));
355  clib_memcpy_fast (&tc->c_rmt_ip6, &ip6->src_address,
356  sizeof (ip6_address_t));
357  }
358 
359  tc->irs = vnet_buffer (b)->tcp.seq_number;
360  tc->rcv_nxt = vnet_buffer (b)->tcp.seq_number + 1;
361  tc->rcv_las = tc->rcv_nxt;
362  tc->sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_RX];
363  tc->snd_wl1 = vnet_buffer (b)->tcp.seq_number;
364  tc->snd_wl2 = vnet_buffer (b)->tcp.ack_number;
365 
366  /* RFC1323: TSval timestamps sent on {SYN} and {SYN,ACK}
367  * segments are used to initialize PAWS. */
368  if (tcp_opts_tstamp (&tc->rcv_opts))
369  {
370  tc->tsval_recent = tc->rcv_opts.tsval;
371  tc->tsval_recent_age = tcp_time_tstamp (tc->c_thread_index);
372  }
373 
374  if (tcp_opts_wscale (&tc->rcv_opts))
375  tc->snd_wscale = tc->rcv_opts.wscale;
376 
377  tc->snd_wnd = clib_net_to_host_u16 (th->window) << tc->snd_wscale;
378 }
379 
380 always_inline void
382 {
383  tc->rto = clib_min (tc->srtt + (tc->rttvar << 2), TCP_RTO_MAX);
384  tc->rto = clib_max (tc->rto, TCP_RTO_MIN);
385 }
386 
389 {
390  return (transport_connection_is_descheduled (&tc->connection) ? 1 : 0);
391 }
392 
393 /**
394  * Push TCP header to buffer
395  *
396  * @param vm - vlib_main
397  * @param b - buffer to write the header to
398  * @param sp_net - source port net order
399  * @param dp_net - destination port net order
400  * @param seq - sequence number net order
401  * @param ack - ack number net order
402  * @param tcp_hdr_opts_len - header and options length in bytes
403  * @param flags - header flags
404  * @param wnd - window size
405  *
406  * @return - pointer to start of TCP header
407  */
408 always_inline void *
410  u32 ack, u8 tcp_hdr_opts_len, u8 flags,
411  u16 wnd)
412 {
413  tcp_header_t *th;
414 
415  th = vlib_buffer_push_uninit (b, tcp_hdr_opts_len);
416 
417  th->src_port = sp;
418  th->dst_port = dp;
419  th->seq_number = seq;
420  th->ack_number = ack;
421  th->data_offset_and_reserved = (tcp_hdr_opts_len >> 2) << 4;
422  th->flags = flags;
423  th->window = wnd;
424  th->checksum = 0;
425  th->urgent_pointer = 0;
426  vnet_buffer (b)->l4_hdr_offset = (u8 *) th - b->data;
427  b->flags |= VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
428  return th;
429 }
430 
431 /**
432  * Push TCP header to buffer
433  *
434  * @param b - buffer to write the header to
435  * @param sp_net - source port net order
436  * @param dp_net - destination port net order
437  * @param seq - sequence number host order
438  * @param ack - ack number host order
439  * @param tcp_hdr_opts_len - header and options length in bytes
440  * @param flags - header flags
441  * @param wnd - window size
442  *
443  * @return - pointer to start of TCP header
444  */
445 always_inline void *
446 vlib_buffer_push_tcp (vlib_buffer_t * b, u16 sp_net, u16 dp_net, u32 seq,
447  u32 ack, u8 tcp_hdr_opts_len, u8 flags, u16 wnd)
448 {
449  return vlib_buffer_push_tcp_net_order (b, sp_net, dp_net,
450  clib_host_to_net_u32 (seq),
451  clib_host_to_net_u32 (ack),
452  tcp_hdr_opts_len, flags,
453  clib_host_to_net_u16 (wnd));
454 }
455 
456 #endif /* SRC_VNET_TCP_TCP_INLINES_H_ */
457 
458 /*
459  * fd.io coding-style-patch-verification: ON
460  *
461  * Local Variables:
462  * eval: (c-set-style "gnu")
463  * End:
464  */
ip6_address_is_link_local_unicast
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
Definition: ip6_packet.h:253
im
vnet_interface_main_t * im
Definition: interface_output.c:395
tcp_header_bytes
static int tcp_header_bytes(tcp_header_t *t)
Definition: tcp_packet.h:93
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
tcp_half_open_connection_get
static tcp_connection_t * tcp_half_open_connection_get(u32 conn_index)
Definition: tcp_inlines.h:67
tcp_opts_tstamp
#define tcp_opts_tstamp(_to)
Definition: tcp_packet.h:156
session_lookup_connection_wt4
transport_connection_t * session_lookup_connection_wt4(u32 fib_index, ip4_address_t *lcl, ip4_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto, u32 thread_index, u8 *result)
Lookup connection with ip4 and transport layer information.
Definition: session_lookup.c:897
ip4
vl_api_ip4_address_t ip4
Definition: one.api:376
clib_max
#define clib_max(x, y)
Definition: clib.h:335
TCP_RTO_MAX
#define TCP_RTO_MAX
Definition: tcp_types.h:85
tcp_set_time_now
static void tcp_set_time_now(tcp_worker_ctx_t *wrk, f64 now)
Definition: tcp_inlines.h:214
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
tcp_initial_cwnd
static u32 tcp_initial_cwnd(const tcp_connection_t *tc)
Initial cwnd as per RFC5681.
Definition: tcp_inlines.h:108
tcp_header_t
struct _tcp_header tcp_header_t
tcp_available_output_snd_space
static u32 tcp_available_output_snd_space(const tcp_connection_t *tc)
Definition: tcp_inlines.h:154
tcp_connection_t
struct _tcp_connection tcp_connection_t
tcp_listener_get
static tcp_connection_t * tcp_listener_get(u32 tli)
Definition: tcp_inlines.h:58
wrk
session_worker_t * wrk
Definition: application.c:490
u16
unsigned short u16
Definition: types.h:57
tcp_get_worker
static tcp_worker_ctx_t * tcp_get_worker(u32 thread_index)
Definition: tcp.h:283
tcp_bytes_out
static u32 tcp_bytes_out(const tcp_connection_t *tc)
Our estimate of the number of bytes that have left the network.
Definition: tcp_inlines.h:79
tcp_time_tstamp
static u32 tcp_time_tstamp(u32 thread_index)
Time used to generate timestamps, not the timestamp.
Definition: tcp_inlines.h:192
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
state
vl_api_dhcp_client_state_t state
Definition: dhcp.api:201
tcp_is_lost_fin
static u8 tcp_is_lost_fin(tcp_connection_t *tc)
Definition: tcp_inlines.h:181
transport_connection_t
struct _transport_connection transport_connection_t
ip6_next_header
static void * ip6_next_header(ip6_header_t *i)
Definition: ip6_packet.h:407
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
tcp_loss_wnd
static u32 tcp_loss_wnd(const tcp_connection_t *tc)
Definition: tcp_inlines.h:141
ip4_header_t
Definition: ip4_packet.h:87
error
Definition: cJSON.c:88
tcp_input_lookup_buffer
static tcp_connection_t * tcp_input_lookup_buffer(vlib_buffer_t *b, u8 thread_index, u32 *error, u8 is_ip4, u8 is_nolookup)
Definition: tcp_inlines.h:234
pool_is_free_index
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:302
vec_elt
#define vec_elt(v, i)
Get vector value at index i.
Definition: vec_bootstrap.h:210
tcp_state_t
enum _tcp_state tcp_state_t
tcp_update_rto
static void tcp_update_rto(tcp_connection_t *tc)
Definition: tcp_inlines.h:381
vlib_buffer_t::current_data
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
Definition: buffer.h:119
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
TCP_TSTP_HZ
#define TCP_TSTP_HZ
Timestamp freq.
Definition: tcp_types.h:28
tcp_main
tcp_main_t tcp_main
Definition: tcp.c:28
tcp_opts_wscale
#define tcp_opts_wscale(_to)
Definition: tcp_packet.h:157
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
tcp_connection_get_if_valid
static tcp_connection_t * tcp_connection_get_if_valid(u32 conn_index, u32 thread_index)
Definition: tcp_inlines.h:39
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:213
tcp_connection_set_state
static void tcp_connection_set_state(tcp_connection_t *tc, tcp_state_t state)
Definition: tcp_inlines.h:51
tcp_available_snd_wnd
static u32 tcp_available_snd_wnd(const tcp_connection_t *tc)
Definition: tcp_inlines.h:148
f64
double f64
Definition: types.h:142
vlib_buffer_push_tcp_net_order
static void * vlib_buffer_push_tcp_net_order(vlib_buffer_t *b, u16 sp, u16 dp, u32 seq, u32 ack, u8 tcp_hdr_opts_len, u8 flags, u16 wnd)
Push TCP header to buffer.
Definition: tcp_inlines.h:409
tcp_opts_sack_permitted
#define tcp_opts_sack_permitted(_to)
Definition: tcp_packet.h:159
TCP_EVT
#define TCP_EVT(_evt, _args...)
Definition: tcp_debug.h:145
clib_min
#define clib_min(x, y)
Definition: clib.h:342
tcp_tstamp
static u32 tcp_tstamp(tcp_connection_t *tc)
Generate timestamp for tcp connection.
Definition: tcp_inlines.h:201
transport_update_pacer_time
void transport_update_pacer_time(u32 thread_index, clib_time_type_t now)
Request pacer time update.
Definition: transport.c:784
tcp_init_w_buffer
static void tcp_init_w_buffer(tcp_connection_t *tc, vlib_buffer_t *b, u8 is_ip4)
Initialize connection by gleaning network and rcv params from buffer.
Definition: tcp_inlines.h:336
vlib_buffer_t::current_length
u16 current_length
Nbytes between current data and the end of this buffer.
Definition: buffer.h:122
tcp_time_now_us
static f64 tcp_time_now_us(u32 thread_index)
Definition: tcp_inlines.h:208
ip6_main
ip6_main_t ip6_main
Definition: ip6_forward.c:2787
tcp_buffer_hdr
static tcp_header_t * tcp_buffer_hdr(vlib_buffer_t *b)
Definition: tcp_inlines.h:22
vlib_buffer_push_uninit
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
Definition: buffer.h:363
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
u64
unsigned long u64
Definition: types.h:89
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
session_lookup_connection_wt6
transport_connection_t * session_lookup_connection_wt6(u32 fib_index, ip6_address_t *lcl, ip6_address_t *rmt, u16 lcl_port, u16 rmt_port, u8 proto, u32 thread_index, u8 *result)
Lookup connection with ip6 and transport layer information.
Definition: session_lookup.c:1121
VLIB_BUFFER_PRE_DATA_SIZE
#define VLIB_BUFFER_PRE_DATA_SIZE
Definition: buffer.h:51
u32
unsigned int u32
Definition: types.h:88
tcp.h
ip6
vl_api_ip6_address_t ip6
Definition: one.api:424
tcp_connection_get
static tcp_connection_t * tcp_connection_get(u32 conn_index, u32 thread_index)
Definition: tcp_inlines.h:30
session_worker_::vm
vlib_main_t * vm
Convenience pointer to this worker's vlib_main.
Definition: session.h:104
tcp_cwnd_accumulate
static void tcp_cwnd_accumulate(tcp_connection_t *tc, u32 thresh, u32 bytes)
Definition: tcp_inlines.h:128
ip6_header_t
Definition: ip6_packet.h:294
ip6_main_t
Definition: ip6.h:110
tcp_update_time_now
static void tcp_update_time_now(tcp_worker_ctx_t *wrk)
Definition: tcp_inlines.h:224
transport_connection_is_descheduled
static u8 transport_connection_is_descheduled(transport_connection_t *tc)
Definition: transport.h:211
now
f64 now
Definition: nat44_ei_out2in.c:710
tcp_get_connection_from_transport
static tcp_connection_t * tcp_get_connection_from_transport(transport_connection_t *tconn)
Definition: tcp_types.h:442
TCP_RTO_MIN
#define TCP_RTO_MIN
Definition: tcp_types.h:86
tcp_flight_size
static u32 tcp_flight_size(const tcp_connection_t *tc)
Our estimate of the number of bytes in flight (pipe size)
Definition: tcp_inlines.h:92
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
vlib_buffer_t::data
u8 data[]
Packet data.
Definition: buffer.h:204
tcp_cfg
#define tcp_cfg
Definition: tcp.h:272
ip4_header_bytes
static int ip4_header_bytes(const ip4_header_t *i)
Definition: ip4_packet.h:190
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
tcp_worker_ctx_
Definition: tcp.h:75
vlib_buffer_push_tcp
static void * vlib_buffer_push_tcp(vlib_buffer_t *b, u16 sp_net, u16 dp_net, u32 seq, u32 ack, u8 tcp_hdr_opts_len, u8 flags, u16 wnd)
Push TCP header to buffer.
Definition: tcp_inlines.h:446
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
tcp_is_descheduled
static u8 tcp_is_descheduled(tcp_connection_t *tc)
Definition: tcp_inlines.h:388
ip4_next_header
static void * ip4_next_header(ip4_header_t *i)
Definition: ip4_packet.h:196
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
tcp_available_cc_snd_space
static u32 tcp_available_cc_snd_space(const tcp_connection_t *tc)
Estimate of how many bytes we can still push into the network.
Definition: tcp_inlines.h:169
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105