FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
ip4_input.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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  * ip/ip4_input.c: IP v4 input node
17  *
18  * Copyright (c) 2008 Eliot Dresselhaus
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining
21  * a copy of this software and associated documentation files (the
22  * "Software"), to deal in the Software without restriction, including
23  * without limitation the rights to use, copy, modify, merge, publish,
24  * distribute, sublicense, and/or sell copies of the Software, and to
25  * permit persons to whom the Software is furnished to do so, subject to
26  * the following conditions:
27  *
28  * The above copyright notice and this permission notice shall be
29  * included in all copies or substantial portions of the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  */
39 
40 #include <vnet/ip/ip4_input.h>
41 #include <vnet/ethernet/ethernet.h>
42 #include <vnet/pg/pg.h>
43 #include <vnet/ppp/ppp.h>
44 #include <vnet/hdlc/hdlc.h>
45 #include <vnet/util/throttle.h>
46 
47 typedef struct
48 {
49  u8 packet_data[64];
51 
52 static u8 *
53 format_ip4_input_trace (u8 * s, va_list * va)
54 {
55  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
56  CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
57  ip4_input_trace_t *t = va_arg (*va, ip4_input_trace_t *);
58 
59  s = format (s, "%U",
60  format_ip4_header, t->packet_data, sizeof (t->packet_data));
61 
62  return s;
63 }
64 
67 {
69  ip_lookup_main_t *lm = &im->lookup_main;
70  u32 next;
71  u8 arc;
72 
74 
75  if (PREDICT_FALSE (ip4_address_is_multicast (&ip->dst_address)))
76  {
79  }
80  else
81  {
84  }
85 
86  if (arc_enabled)
88 
89  return next;
90 }
91 
95  u32 * last_sw_if_index, u32 * cnt,
96  int *arc_enabled)
97 {
99  ip_lookup_main_t *lm = &im->lookup_main;
101  if (*last_sw_if_index == sw_if_index)
102  {
103  (*cnt)++;
104  return;
105  }
106 
108  if (*cnt)
109  vlib_increment_simple_counter (cm, thread_index, *last_sw_if_index, *cnt);
110  *cnt = 1;
111  *last_sw_if_index = sw_if_index;
112 
115  *arc_enabled = 1;
116  else
117  *arc_enabled = 0;
118 }
119 
120 /* Validate IP v4 packets and pass them either to forwarding code
121  or drop/punt exception packets. */
125  vlib_frame_t * frame, int verify_checksum)
126 {
127  vnet_main_t *vnm = vnet_get_main ();
128  u32 n_left_from, *from;
130  vlib_node_runtime_t *error_node =
134  ip4_header_t *ip[4];
136  u32 sw_if_index[4];
137  u32 last_sw_if_index = ~0;
138  u32 cnt = 0;
139  int arc_enabled = 0;
140 
142  n_left_from = frame->n_vectors;
143 
144  if (node->flags & VLIB_NODE_FLAG_TRACE)
146  /* stride */ 1,
147  sizeof (ip4_input_trace_t));
148 
151 
153  b = bufs;
154  next = nexts;
155 #if (CLIB_N_PREFETCHES >= 8)
156  while (n_left_from >= 4)
157  {
158  u32 x = 0;
159 
160  /* Prefetch next iteration. */
161  if (n_left_from >= 12)
162  {
163  vlib_prefetch_buffer_header (b[8], LOAD);
164  vlib_prefetch_buffer_header (b[9], LOAD);
165  vlib_prefetch_buffer_header (b[10], LOAD);
166  vlib_prefetch_buffer_header (b[11], LOAD);
167 
168  vlib_prefetch_buffer_data (b[4], LOAD);
169  vlib_prefetch_buffer_data (b[5], LOAD);
170  vlib_prefetch_buffer_data (b[6], LOAD);
171  vlib_prefetch_buffer_data (b[7], LOAD);
172  }
173 
174  vnet_buffer (b[0])->ip.adj_index[VLIB_RX] = ~0;
175  vnet_buffer (b[1])->ip.adj_index[VLIB_RX] = ~0;
176  vnet_buffer (b[2])->ip.adj_index[VLIB_RX] = ~0;
177  vnet_buffer (b[3])->ip.adj_index[VLIB_RX] = ~0;
178 
179  sw_if_index[0] = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
180  sw_if_index[1] = vnet_buffer (b[1])->sw_if_index[VLIB_RX];
181  sw_if_index[2] = vnet_buffer (b[2])->sw_if_index[VLIB_RX];
182  sw_if_index[3] = vnet_buffer (b[3])->sw_if_index[VLIB_RX];
183 
184  x |= sw_if_index[0] ^ last_sw_if_index;
185  x |= sw_if_index[1] ^ last_sw_if_index;
186  x |= sw_if_index[2] ^ last_sw_if_index;
187  x |= sw_if_index[3] ^ last_sw_if_index;
188 
189  if (PREDICT_TRUE (x == 0))
190  {
191  /* we deal with 4 more packets sharing the same sw_if_index
192  with the previous one, so we can optimize */
193  cnt += 4;
194  if (arc_enabled)
195  {
196  next[0] = ip4_input_set_next (sw_if_index[0], b[0], 1);
197  next[1] = ip4_input_set_next (sw_if_index[1], b[1], 1);
198  next[2] = ip4_input_set_next (sw_if_index[2], b[2], 1);
199  next[3] = ip4_input_set_next (sw_if_index[3], b[3], 1);
200  }
201  else
202  {
203  next[0] = ip4_input_set_next (sw_if_index[0], b[0], 0);
204  next[1] = ip4_input_set_next (sw_if_index[1], b[1], 0);
205  next[2] = ip4_input_set_next (sw_if_index[2], b[2], 0);
206  next[3] = ip4_input_set_next (sw_if_index[3], b[3], 0);
207  }
208  }
209  else
210  {
212  &last_sw_if_index, &cnt, &arc_enabled);
214  &last_sw_if_index, &cnt, &arc_enabled);
216  &last_sw_if_index, &cnt, &arc_enabled);
218  &last_sw_if_index, &cnt, &arc_enabled);
219 
220  next[0] = ip4_input_set_next (sw_if_index[0], b[0], 1);
221  next[1] = ip4_input_set_next (sw_if_index[1], b[1], 1);
222  next[2] = ip4_input_set_next (sw_if_index[2], b[2], 1);
223  next[3] = ip4_input_set_next (sw_if_index[3], b[3], 1);
224  }
225 
226  ip[0] = vlib_buffer_get_current (b[0]);
227  ip[1] = vlib_buffer_get_current (b[1]);
228  ip[2] = vlib_buffer_get_current (b[2]);
229  ip[3] = vlib_buffer_get_current (b[3]);
230 
231  ip4_input_check_x4 (vm, error_node, b, ip, next, verify_checksum);
232 
233  /* next */
234  b += 4;
235  next += 4;
236  n_left_from -= 4;
237  }
238 #elif (CLIB_N_PREFETCHES >= 4)
239  while (n_left_from >= 2)
240  {
241  u32 x = 0;
242  u32 next0, next1;
243 
244  /* Prefetch next iteration. */
245  if (n_left_from >= 6)
246  {
247  vlib_prefetch_buffer_header (b[4], LOAD);
248  vlib_prefetch_buffer_header (b[5], LOAD);
249 
250  vlib_prefetch_buffer_data (b[2], LOAD);
251  vlib_prefetch_buffer_data (b[3], LOAD);
252  }
253 
254  vnet_buffer (b[0])->ip.adj_index[VLIB_RX] = ~0;
255  vnet_buffer (b[1])->ip.adj_index[VLIB_RX] = ~0;
256 
257  sw_if_index[0] = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
258  sw_if_index[1] = vnet_buffer (b[1])->sw_if_index[VLIB_RX];
259 
260  x |= sw_if_index[0] ^ last_sw_if_index;
261  x |= sw_if_index[1] ^ last_sw_if_index;
262 
263  if (PREDICT_TRUE (x == 0))
264  {
265  /* we deal with 2 more packets sharing the same sw_if_index
266  with the previous one, so we can optimize */
267  cnt += 2;
268  if (arc_enabled)
269  {
270  next0 = ip4_input_set_next (sw_if_index[0], b[0], 1);
271  next1 = ip4_input_set_next (sw_if_index[1], b[1], 1);
272  }
273  else
274  {
275  next0 = ip4_input_set_next (sw_if_index[0], b[0], 0);
276  next1 = ip4_input_set_next (sw_if_index[1], b[1], 0);
277  }
278  }
279  else
280  {
282  &last_sw_if_index, &cnt, &arc_enabled);
284  &last_sw_if_index, &cnt, &arc_enabled);
285 
286  next0 = ip4_input_set_next (sw_if_index[0], b[0], 1);
287  next1 = ip4_input_set_next (sw_if_index[1], b[1], 1);
288  }
289 
290  ip[0] = vlib_buffer_get_current (b[0]);
291  ip[1] = vlib_buffer_get_current (b[1]);
292 
293  ip4_input_check_x2 (vm, error_node, b[0], b[1], ip[0], ip[1],
294  &next0, &next1, verify_checksum);
295  next[0] = (u16) next0;
296  next[1] = (u16) next1;
297 
298  /* next */
299  b += 2;
300  next += 2;
301  n_left_from -= 2;
302  }
303 #endif
304 
305  while (n_left_from)
306  {
307  u32 next0;
308  vnet_buffer (b[0])->ip.adj_index[VLIB_RX] = ~0;
309  sw_if_index[0] = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
310  ip4_input_check_sw_if_index (vm, cm, sw_if_index[0], &last_sw_if_index,
311  &cnt, &arc_enabled);
312  next0 = ip4_input_set_next (sw_if_index[0], b[0], arc_enabled);
313  ip[0] = vlib_buffer_get_current (b[0]);
314  ip4_input_check_x1 (vm, error_node, b[0], ip[0], &next0,
315  verify_checksum);
316  next[0] = next0;
317 
318  /* next */
319  b += 1;
320  next += 1;
321  n_left_from -= 1;
322  }
323 
324  vlib_increment_simple_counter (cm, thread_index, last_sw_if_index, cnt);
326  return frame->n_vectors;
327 }
328 
329 /** \brief IPv4 input node.
330  @node ip4-input
331 
332  This is the IPv4 input node: validates ip4 header checksums,
333  verifies ip header lengths, discards pkts with expired TTLs,
334  and sends pkts to the set of ip feature nodes configured on
335  the rx interface.
336 
337  @param vm vlib_main_t corresponding to the current thread
338  @param node vlib_node_runtime_t
339  @param frame vlib_frame_t whose contents should be dispatched
340 
341  @par Graph mechanics: buffer metadata, next index usage
342 
343  @em Uses:
344  - vnet_feature_config_main_t cm corresponding to each pkt's dst address unicast /
345  multicast status.
346  - <code>b->current_config_index</code> corresponding to each pkt's
347  rx sw_if_index.
348  - This sets the per-packet graph trajectory, ensuring that
349  each packet visits the per-interface features in order.
350 
351  - <code>vnet_buffer(b)->sw_if_index[VLIB_RX]</code>
352  - Indicates the @c sw_if_index value of the interface that the
353  packet was received on.
354 
355  @em Sets:
356  - <code>vnet_buffer(b)->ip.adj_index[VLIB_TX]</code>
357  - The lookup result adjacency index.
358 
359  <em>Next Indices:</em>
360  - Dispatches pkts to the (first) feature node:
361  <code> vnet_get_config_data (... &next0 ...); </code>
362  or @c error-drop
363 */
366 {
367  return ip4_input_inline (vm, node, frame, /* verify_checksum */ 1);
368 }
369 
373 {
374  return ip4_input_inline (vm, node, frame, /* verify_checksum */ 0);
375 }
376 
377 #ifndef CLIB_MARCH_VARIANT
378 char *ip4_error_strings[] = {
379 #define _(sym,string) string,
381 #undef _
382 };
383 #endif
384 
385 /* *INDENT-OFF* */
387  .name = "ip4-input",
388  .vector_size = sizeof (u32),
389  .protocol_hint = VLIB_NODE_PROTO_HINT_IP4,
390 
391  .n_errors = IP4_N_ERROR,
392  .error_strings = ip4_error_strings,
393 
394  .n_next_nodes = IP4_INPUT_N_NEXT,
395  .next_nodes = {
396  [IP4_INPUT_NEXT_DROP] = "error-drop",
397  [IP4_INPUT_NEXT_PUNT] = "error-punt",
398  [IP4_INPUT_NEXT_OPTIONS] = "ip4-options",
399  [IP4_INPUT_NEXT_LOOKUP] = "ip4-lookup",
400  [IP4_INPUT_NEXT_LOOKUP_MULTICAST] = "ip4-mfib-forward-lookup",
401  [IP4_INPUT_NEXT_ICMP_ERROR] = "ip4-icmp-error",
402  [IP4_INPUT_NEXT_REASSEMBLY] = "ip4-full-reassembly",
403  },
404 
405  .format_buffer = format_ip4_header,
406  .format_trace = format_ip4_input_trace,
407 };
408 
410  .name = "ip4-input-no-checksum",
411  .vector_size = sizeof (u32),
412 
413  .sibling_of = "ip4-input",
414  .format_buffer = format_ip4_header,
415  .format_trace = format_ip4_input_trace,
416 };
417 /* *INDENT-ON* */
418 
419 static clib_error_t *
421 {
423 
424  ethernet_register_input_type (vm, ETHERNET_TYPE_IP4, ip4_input_node.index);
425  ppp_register_input_protocol (vm, PPP_PROTOCOL_ip4, ip4_input_node.index);
426  hdlc_register_input_protocol (vm, HDLC_PROTOCOL_ip4, ip4_input_node.index);
427 
428  {
430  pg_node_t *pn;
431  pn = pg_get_node (ip4_input_node.index);
435  }
436 
438  return error;
439 
442  return error;
443 
444  /* Set flow hash to something non-zero. */
445  ip4_main.flow_hash_seed = 0xdeadbeef;
446 
447  /* Default TTL for packets we generate. */
448  ip4_main.host_config.ttl = 64;
449 
450  return error;
451 }
452 
454 
455 /*
456  * fd.io coding-style-patch-verification: ON
457  *
458  * Local Variables:
459  * eval: (c-set-style "gnu")
460  * End:
461  */
ip4_main_t::ttl
u8 ttl
TTL to use for host generated packets.
Definition: ip4.h:157
im
vnet_interface_main_t * im
Definition: interface_output.c:415
vnet_have_features
static_always_inline int vnet_have_features(u8 arc, u32 sw_if_index)
Definition: feature.h:251
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:495
bufs
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
Definition: nat44_ei_out2in.c:717
vlib_prefetch_buffer_header
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:231
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
ip_lookup_main_t::ucast_feature_arc_index
u8 ucast_feature_arc_index
Definition: lookup.h:144
ip4_source_and_port_range_check_init
clib_error_t * ip4_source_and_port_range_check_init(vlib_main_t *vm)
Definition: ip4_source_and_port_range_check.c:856
ip4_main
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1104
pg.h
vlib_get_buffers
vlib_get_buffers(vm, from, b, n_left_from)
next
u16 * next
Definition: nat44_ei_out2in.c:718
vlib_trace_frame_buffers_only
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
Definition: trace.c:48
VLIB_FRAME_SIZE
#define VLIB_FRAME_SIZE
Definition: node.h:368
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
ip4_main_t::host_config
struct ip4_main_t::@378 host_config
Template information for VPP generated packets.
hdlc.h
u16
unsigned short u16
Definition: types.h:57
VLIB_NODE_PROTO_HINT_IP4
@ VLIB_NODE_PROTO_HINT_IP4
Definition: node.h:62
vlib_call_init_function
#define vlib_call_init_function(vm, x)
Definition: init.h:259
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
vnet_interface_main_t::sw_if_counters
vlib_simple_counter_main_t * sw_if_counters
Definition: interface.h:1023
ip4_input_check_x4
static void ip4_input_check_x4(vlib_main_t *vm, vlib_node_runtime_t *error_node, vlib_buffer_t **p, ip4_header_t **ip, u16 *next, int verify_checksum)
Definition: ip4_input.h:79
vlib_buffer_enqueue_to_next
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
IP4_INPUT_NEXT_LOOKUP_MULTICAST
@ IP4_INPUT_NEXT_LOOKUP_MULTICAST
Definition: ip4_input.h:52
vlib_frame_t
Definition: node.h:372
IP4_INPUT_NEXT_LOOKUP
@ IP4_INPUT_NEXT_LOOKUP
Definition: ip4_input.h:51
hdlc_register_input_protocol
void hdlc_register_input_protocol(vlib_main_t *vm, hdlc_protocol_t protocol, u32 node_index)
Definition: node.c:358
ip4_header_t
Definition: ip4_packet.h:87
ethernet.h
error
Definition: cJSON.c:88
ip4_input_check_x2
static void ip4_input_check_x2(vlib_main_t *vm, vlib_node_runtime_t *error_node, vlib_buffer_t *p0, vlib_buffer_t *p1, ip4_header_t *ip0, ip4_header_t *ip1, u32 *next0, u32 *next1, int verify_checksum)
Definition: ip4_input.h:203
pg_node_t
Definition: pg.h:332
IP4_N_ERROR
@ IP4_N_ERROR
Definition: ip4_error.h:97
vlib_increment_simple_counter
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 thread_index, u32 index, u64 increment)
Increment a simple counter.
Definition: counter.h:74
ip4_address_is_multicast
static uword ip4_address_is_multicast(const ip4_address_t *a)
Definition: ip4_packet.h:446
ip4_input_check_sw_if_index
static_always_inline void ip4_input_check_sw_if_index(vlib_main_t *vm, vlib_simple_counter_main_t *cm, u32 sw_if_index, u32 *last_sw_if_index, u32 *cnt, int *arc_enabled)
Definition: ip4_input.c:93
ip4_error_strings
char * ip4_error_strings[]
Definition: ip4_input.c:378
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
unformat_pg_ip4_header
unformat_function_t unformat_pg_ip4_header
Definition: format.h:86
pg_node_t::unformat_edit
unformat_function_t * unformat_edit
Definition: pg.h:335
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
vec_elt_at_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Definition: vec_bootstrap.h:203
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
ip_lookup_main_t::mcast_feature_arc_index
u8 mcast_feature_arc_index
Feature arc indices.
Definition: lookup.h:143
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
static_always_inline
#define static_always_inline
Definition: clib.h:112
uword
u64 uword
Definition: types.h:112
pg_get_node
static pg_node_t * pg_get_node(uword node_index)
Definition: pg.h:391
ip4_input_trace_t::packet_data
u8 packet_data[64]
Definition: ip4_input.c:49
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:215
cm
vnet_feature_config_main_t * cm
Definition: nat44_ei_hairpinning.c:594
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
IP4_INPUT_NEXT_ICMP_ERROR
@ IP4_INPUT_NEXT_ICMP_ERROR
Definition: ip4_input.h:53
ip4_input_node
vlib_node_registration_t ip4_input_node
(constructor) VLIB_REGISTER_NODE (ip4_input_node)
Definition: ip4_input.c:386
arc
u8 arc
Definition: interface_output.c:426
vnet_main_t
Definition: vnet.h:76
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
ip4_input_check_x1
static void ip4_input_check_x1(vlib_main_t *vm, vlib_node_runtime_t *error_node, vlib_buffer_t *p0, ip4_header_t *ip0, u32 *next0, int verify_checksum)
Definition: ip4_input.h:278
throttle.h
format
description fragment has unexpected format
Definition: map.api:433
u32
unsigned int u32
Definition: types.h:88
ip4_input_trace_t
Definition: ip4_input.c:47
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
ip4_input_set_next
static_always_inline u32 ip4_input_set_next(u32 sw_if_index, vlib_buffer_t *b, int arc_enabled)
Definition: ip4_input.c:66
IP4_INPUT_N_NEXT
@ IP4_INPUT_N_NEXT
Definition: ip4_input.h:55
ip4_cli_init
static clib_error_t * ip4_cli_init(vlib_main_t *vm)
Definition: ip46_cli.c:307
vlib_node_get_runtime
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
Definition: node_funcs.h:116
format_ip4_input_trace
static u8 * format_ip4_input_trace(u8 *s, va_list *va)
Definition: ip4_input.c:53
format_ip4_header
format_function_t format_ip4_header
Definition: format.h:81
ip_lookup_main_t
Definition: lookup.h:121
foreach_ip4_error
#define foreach_ip4_error
Definition: ip4_error.h:43
IP4_INPUT_NEXT_PUNT
@ IP4_INPUT_NEXT_PUNT
Definition: ip4_input.h:49
ip4_input.h
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
vlib_simple_counter_main_t
A collection of simple counters.
Definition: counter.h:57
ppp.h
b
vlib_buffer_t ** b
Definition: nat44_ei_out2in.c:717
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
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
ip
vl_api_address_t ip
Definition: l2.api:558
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
ip4_input_no_checksum_node
vlib_node_registration_t ip4_input_no_checksum_node
(constructor) VLIB_REGISTER_NODE (ip4_input_no_checksum_node)
Definition: ip4_input.c:409
ppp_register_input_protocol
void ppp_register_input_protocol(vlib_main_t *vm, ppp_protocol_t protocol, u32 node_index)
Definition: node.c:345
IP4_INPUT_NEXT_OPTIONS
@ IP4_INPUT_NEXT_OPTIONS
Definition: ip4_input.h:50
vnet_feature_arc_start
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
Definition: feature.h:302
IP4_INPUT_NEXT_REASSEMBLY
@ IP4_INPUT_NEXT_REASSEMBLY
Definition: ip4_input.h:54
nexts
u16 nexts[VLIB_FRAME_SIZE]
Definition: nat44_ei_out2in.c:718
ip4_main_t::flow_hash_seed
u32 flow_hash_seed
Seed for Jenkins hash used to compute ip4 flow hash.
Definition: ip4.h:151
ip4_init
static clib_error_t * ip4_init(vlib_main_t *vm)
Definition: ip4_input.c:420
VNET_INTERFACE_COUNTER_IP4
@ VNET_INTERFACE_COUNTER_IP4
Definition: interface.h:906
ip4_input_inline
static uword ip4_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int verify_checksum)
Definition: ip4_input.c:123
vlib_node_runtime_t
Definition: node.h:454
from
from
Definition: nat44_ei_hairpinning.c:415
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
ip4_main_t
IPv4 main type.
Definition: ip4.h:107
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
ethernet_register_input_type
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
Definition: node.c:2274
vnet_main_t::interface_main
vnet_interface_main_t interface_main
Definition: vnet.h:81
vlib_prefetch_buffer_data
#define vlib_prefetch_buffer_data(b, type)
Definition: buffer.h:232
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
IP4_INPUT_NEXT_DROP
@ IP4_INPUT_NEXT_DROP
Definition: ip4_input.h:48