FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip4_neighbor.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_forward.c: IP v4 forwarding
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 
41 #include <vnet/ethernet/ethernet.h>
42 #include <vnet/util/throttle.h>
43 #include <vnet/fib/fib_sas.h>
44 
45 /** ARP throttling */
47 
48 VLIB_REGISTER_LOG_CLASS (ip4_neighbor_log, static) = {
49  .class_name = "ip4",
50  .subclass_name = "neighbor",
51 };
52 
53 #define log_debug(fmt, ...) \
54  vlib_log_debug (ip4_neighbor_log.class, fmt, __VA_ARGS__)
55 
56 void
58 {
60  adj_index_t ai;
61 
62  /* any glean will do, it's just for the rewrite */
64 
67  vnet_get_main (), adj_get (ai), &src, dst);
68 }
69 
70 void
72  vnet_main_t * vnm,
74 {
76  ip4_main_t *i4m = &ip4_main;
77  u8 *rewrite, rewrite_len;
79 
80  if (NULL == addr)
81  {
82  fib_sas4_get (sw_if_index, NULL, &tmp);
83  addr = &tmp;
84  }
85 
86  if (addr)
87  {
88  log_debug ("Sending GARP for IP4 address %U on sw_if_idex %d",
90 
91  /* Form GARP packet for output - Gratuitous ARP is an ARP request packet
92  where the interface IP/MAC pair is used for both source and request
93  MAC/IP pairs in the request */
94  u32 bi = 0;
96  (vm, &i4m->ip4_arp_request_packet_template, &bi);
97 
98  if (!h)
99  return;
100 
101  mac_address_from_bytes (&h->ip4_over_ethernet[0].mac, hi->hw_address);
102  mac_address_from_bytes (&h->ip4_over_ethernet[1].mac, hi->hw_address);
103  h->ip4_over_ethernet[0].ip4 = addr[0];
104  h->ip4_over_ethernet[1].ip4 = addr[0];
105 
106  /* Setup MAC header with ARP Etype and broadcast DMAC */
108  rewrite =
111  rewrite_len = vec_len (rewrite);
112  vlib_buffer_advance (b, -rewrite_len);
114  clib_memcpy_fast (e->dst_address, rewrite, rewrite_len);
115  vec_free (rewrite);
116 
117  /* Send GARP packet out the specified interface */
118  vnet_buffer (b)->sw_if_index[VLIB_RX] =
119  vnet_buffer (b)->sw_if_index[VLIB_TX] = sw_if_index;
120  vlib_frame_t *f = vlib_get_frame_to_node (vm, hi->output_node_index);
121  u32 *to_next = vlib_frame_vector_args (f);
122  to_next[0] = bi;
123  f->n_vectors = 1;
124  vlib_put_frame_to_node (vm, hi->output_node_index, f);
125  }
126 }
127 
131  vlib_frame_t * frame, int is_glean)
132 {
133  vnet_main_t *vnm = vnet_get_main ();
134  u32 *from, *to_next_drop;
135  uword n_left_from, n_left_to_next_drop, next_index;
137  u64 seed;
138 
139  if (node->flags & VLIB_NODE_FLAG_TRACE)
141 
143 
145  n_left_from = frame->n_vectors;
146  next_index = node->cached_next_index;
148  next_index = IP4_ARP_N_NEXT; /* point to first interface */
149 
150  while (n_left_from > 0)
151  {
153  to_next_drop, n_left_to_next_drop);
154 
155  while (n_left_from > 0 && n_left_to_next_drop > 0)
156  {
157  u32 pi0, adj_index0, sw_if_index0;
158  ip4_address_t resolve0, src0;
159  vlib_buffer_t *p0, *b0;
160  ip_adjacency_t *adj0;
161  u64 r0;
162 
163  pi0 = from[0];
164  p0 = vlib_get_buffer (vm, pi0);
165 
166  from += 1;
167  n_left_from -= 1;
168  to_next_drop[0] = pi0;
169  to_next_drop += 1;
170  n_left_to_next_drop -= 1;
171 
172  adj_index0 = vnet_buffer (p0)->ip.adj_index[VLIB_TX];
173  adj0 = adj_get (adj_index0);
174  sw_if_index0 = adj0->rewrite_header.sw_if_index;
175 
176  if (is_glean)
177  {
178  /* resolve the packet's destination */
180  resolve0 = ip0->dst_address;
181  src0 = adj0->sub_type.glean.rx_pfx.fp_addr.ip4;
182  }
183  else
184  {
185  /* resolve the incomplete adj */
186  resolve0 = adj0->sub_type.nbr.next_hop.ip4;
187  /* Src IP address in ARP header. */
188  if (!fib_sas4_get (sw_if_index0, &resolve0, &src0))
189  {
190  /* No source address available */
192  continue;
193  }
194  }
195 
196  /* combine the address and interface for the hash key */
197  r0 = (u64) resolve0.data_u32 << 32;
198  r0 |= sw_if_index0;
199 
201  {
202  p0->error = node->errors[IP4_ARP_ERROR_THROTTLED];
203  continue;
204  }
205 
206  /*
207  * the adj has been updated to a rewrite but the node the DPO that got
208  * us here hasn't - yet. no big deal. we'll drop while we wait.
209  */
211  {
212  p0->error = node->errors[IP4_ARP_ERROR_RESOLVED];
213  continue;
214  }
215 
216  /*
217  * Can happen if the control-plane is programming tables
218  * with traffic flowing; at least that's today's lame excuse.
219  */
220  if ((is_glean && adj0->lookup_next_index != IP_LOOKUP_NEXT_GLEAN)
221  || (!is_glean && adj0->lookup_next_index != IP_LOOKUP_NEXT_ARP))
222  {
223  p0->error = node->errors[IP4_ARP_ERROR_NON_ARP_ADJ];
224  continue;
225  }
226 
227  /* Send ARP request. */
228  b0 = ip4_neighbor_probe (vm, vnm, adj0, &src0, &resolve0);
229 
230  if (PREDICT_TRUE (NULL != b0))
231  {
232  /* copy the persistent fields from the original */
233  clib_memcpy_fast (b0->opaque2, p0->opaque2,
234  sizeof (p0->opaque2));
235  p0->error = node->errors[IP4_ARP_ERROR_REQUEST_SENT];
236  }
237  else
238  {
239  p0->error = node->errors[IP4_ARP_ERROR_NO_BUFFERS];
240  continue;
241  }
242  }
243 
244  vlib_put_next_frame (vm, node, IP4_ARP_NEXT_DROP, n_left_to_next_drop);
245  }
246 
247  return frame->n_vectors;
248 }
249 
252 {
253  return (ip4_arp_inline (vm, node, frame, 0));
254 }
255 
258 {
259  return (ip4_arp_inline (vm, node, frame, 1));
260 }
261 
262 static char *ip4_arp_error_strings[] = {
263  [IP4_ARP_ERROR_THROTTLED] = "ARP requests throttled",
264  [IP4_ARP_ERROR_RESOLVED] = "ARP requests resolved",
265  [IP4_ARP_ERROR_NO_BUFFERS] = "ARP requests out of buffer",
266  [IP4_ARP_ERROR_REQUEST_SENT] = "ARP requests sent",
267  [IP4_ARP_ERROR_NON_ARP_ADJ] = "ARPs to non-ARP adjacencies",
268  [IP4_ARP_ERROR_NO_SOURCE_ADDRESS] = "no source address for ARP request",
269 };
270 
271 /* *INDENT-OFF* */
273 {
274  .name = "ip4-arp",
275  .vector_size = sizeof (u32),
276  .format_trace = format_ip4_forward_next_trace,
277  .n_errors = ARRAY_LEN (ip4_arp_error_strings),
278  .error_strings = ip4_arp_error_strings,
279  .n_next_nodes = IP4_ARP_N_NEXT,
280  .next_nodes = {
281  [IP4_ARP_NEXT_DROP] = "ip4-drop",
282  },
283 };
284 
286 {
287  .name = "ip4-glean",
288  .vector_size = sizeof (u32),
289  .format_trace = format_ip4_forward_next_trace,
290  .n_errors = ARRAY_LEN (ip4_arp_error_strings),
291  .error_strings = ip4_arp_error_strings,
292  .n_next_nodes = IP4_ARP_N_NEXT,
293  .next_nodes = {
294  [IP4_ARP_NEXT_DROP] = "ip4-drop",
295  },
296 };
297 /* *INDENT-ON* */
298 
299 #define foreach_notrace_ip4_arp_error \
300 _(THROTTLED) \
301 _(RESOLVED) \
302 _(NO_BUFFERS) \
303 _(REQUEST_SENT) \
304 _(NON_ARP_ADJ) \
305 _(NO_SOURCE_ADDRESS)
306 
307 static clib_error_t *
309 {
311 
312  /* don't trace ARP request packets */
313 #define _(a) \
314  vnet_pcap_drop_trace_filter_add_del \
315  (rt->errors[IP4_ARP_ERROR_##a], \
316  1 /* is_add */);
318 #undef _
319  return 0;
320 }
321 
323 
324 static clib_error_t *
326 {
328  u32 n_vlib_mains = tm->n_vlib_mains;
329 
330  throttle_init (&arp_throttle, n_vlib_mains, 1e-3);
331 
332  return (NULL);
333 }
334 
336 
337 
338 /*
339  * fd.io coding-style-patch-verification: ON
340  *
341  * Local Variables:
342  * eval: (c-set-style "gnu")
343  * End:
344  */
tmp
u32 * tmp
Definition: interface_output.c:1078
throttle_init
void throttle_init(throttle_t *t, u32 n_threads, f64 time)
Definition: throttle.c:19
vlib_frame_t::n_vectors
u16 n_vectors
Definition: node.h:387
IP_LOOKUP_NEXT_ARP
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
Definition: adj.h:63
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
Definition: rewrite.h:241
ethernet_build_rewrite
u8 * ethernet_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
build a rewrite string to use for sending packets of type 'link_type' to 'dst_address'
Definition: interface.c:83
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
ip4_neighbor.h
format_ip4_address
format_function_t format_ip4_address
Definition: format.h:73
ip4_forward_next_trace
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
Definition: ip4_forward.c:1240
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
arp_throttle
static throttle_t arp_throttle
ARP throttling.
Definition: ip4_neighbor.c:46
ip4_main
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1105
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
f
vlib_frame_t * f
Definition: interface_output.c:1080
ADJ_INDEX_INVALID
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
Definition: adj_types.h:36
ethernet_header_t::dst_address
u8 dst_address[6]
Definition: packet.h:55
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
IP_LOOKUP_NEXT_GLEAN
@ IP_LOOKUP_NEXT_GLEAN
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
Definition: adj.h:68
adj_glean_get
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
Get an existing glean.
Definition: adj_glean.c:231
IP4_ARP_ERROR_NON_ARP_ADJ
@ IP4_ARP_ERROR_NON_ARP_ADJ
Definition: arp_packet.h:119
IP4_ARP_N_NEXT
@ IP4_ARP_N_NEXT
Definition: arp_packet.h:110
ip4_main_t::ip4_arp_request_packet_template
vlib_packet_template_t ip4_arp_request_packet_template
Template used to generate IP4 ARP packets.
Definition: ip4.h:151
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_LINK_ARP
@ VNET_LINK_ARP
Definition: interface.h:351
IP4_ARP_ERROR_THROTTLED
@ IP4_ARP_ERROR_THROTTLED
Definition: arp_packet.h:115
hi
vl_api_ip4_address_t hi
Definition: arp.api:37
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
vlib_frame_t
Definition: node.h:372
vlib_get_frame_to_node
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
Definition: main.c:184
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
ip4_header_t
Definition: ip4_packet.h:87
ethernet.h
h
h
Definition: flowhash_template.h:372
format_ip4_forward_next_trace
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
Definition: ip4_forward.c:1190
ethernet_arp_header_t
Definition: arp_packet.h:133
vlib_put_frame_to_node
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
Definition: main.c:218
vlib_buffer_t::opaque2
u32 opaque2[14]
Definition: buffer.h:179
vlib_thread_main_t::n_vlib_mains
u32 n_vlib_mains
Definition: threads.h:283
vlib_buffer_advance
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:276
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
ip_adjacency_t_::lookup_next_index
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
Definition: adj.h:337
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
IP4_ARP_ERROR_REQUEST_SENT
@ IP4_ARP_ERROR_REQUEST_SENT
Definition: arp_packet.h:118
VLIB_REGISTER_LOG_CLASS
VLIB_REGISTER_LOG_CLASS(ip4_neighbor_log, static)
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
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
ip4_arp_inline
static uword ip4_arp_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_glean)
Definition: ip4_neighbor.c:129
uword
u64 uword
Definition: types.h:112
if
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
vlib_thread_main
vlib_thread_main_t vlib_thread_main
Definition: threads.c:36
ethernet_header_t
Definition: packet.h:52
IP_LOOKUP_NEXT_REWRITE
@ IP_LOOKUP_NEXT_REWRITE
This packet is to be rewritten and forwarded to the next processing node.
Definition: adj.h:73
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:213
ip4_neighbor_probe_dst
void ip4_neighbor_probe_dst(u32 sw_if_index, const ip4_address_t *dst)
Definition: ip4_neighbor.c:57
IP4_ARP_NEXT_DROP
@ IP4_ARP_NEXT_DROP
Definition: arp_packet.h:109
arp_notrace_init
static clib_error_t * arp_notrace_init(vlib_main_t *vm)
Definition: ip4_neighbor.c:308
src
vl_api_address_t src
Definition: gre.api:54
throttle_seed
static u64 throttle_seed(throttle_t *t, u32 thread_index, f64 time_now)
Definition: throttle.h:41
throttle_t_
A throttle Used in the data plane to decide if a given hash should be throttled, i....
Definition: throttle.h:28
ip4_neighbor_main_loop_enter
static clib_error_t * ip4_neighbor_main_loop_enter(vlib_main_t *vm)
Definition: ip4_neighbor.c:325
ip4_address_t
Definition: ip4_packet.h:50
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
FIB_PROTOCOL_IP4
@ FIB_PROTOCOL_IP4
Definition: fib_types.h:36
ip4_neighbor_advertise
void ip4_neighbor_advertise(vlib_main_t *vm, vnet_main_t *vnm, u32 sw_if_index, const ip4_address_t *addr)
Definition: ip4_neighbor.c:71
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
ip4_header_t::dst_address
ip4_address_t dst_address
Definition: ip4_packet.h:125
ip4_neighbor_probe
static vlib_buffer_t * ip4_neighbor_probe(vlib_main_t *vm, vnet_main_t *vnm, const ip_adjacency_t *adj0, const ip4_address_t *src, const ip4_address_t *dst)
Definition: ip4_neighbor.h:30
log_debug
#define log_debug(fmt,...)
Definition: ip4_neighbor.c:53
ip_adjacency_t_::glean
struct ip_adjacency_t_::@144::@147 glean
IP_LOOKUP_NEXT_GLEAN.
vnet_hw_interface_t
Definition: interface.h:638
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
ip_adjacency_t_::sub_type
union ip_adjacency_t_::@144 sub_type
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
fib_sas.h
vlib_packet_template_get_packet
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
Definition: buffer.c:377
fib_sas4_get
bool fib_sas4_get(u32 sw_if_index, const ip4_address_t *dst, ip4_address_t *src)
Get an IPv4 Source address to use in a packet being sent out an interface.
Definition: fib_sas.c:50
u64
unsigned long u64
Definition: types.h:89
throttle.h
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
throttle_check
static int throttle_check(throttle_t *t, u32 thread_index, u64 hash, u64 seed)
Definition: throttle.h:54
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
vnet_get_sup_hw_interface
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:92
vlib_thread_main_t
Definition: threads.h:264
ip4_address_t::data_u32
u32 data_u32
Definition: ip4_packet.h:53
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
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
IP4_ARP_ERROR_NO_BUFFERS
@ IP4_ARP_ERROR_NO_BUFFERS
Definition: arp_packet.h:117
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
vlib_main_t
Definition: main.h:102
foreach_notrace_ip4_arp_error
#define foreach_notrace_ip4_arp_error
Definition: ip4_neighbor.c:299
IP4_ARP_ERROR_RESOLVED
@ IP4_ARP_ERROR_RESOLVED
Definition: arp_packet.h:116
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
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
rt
vnet_interface_output_runtime_t * rt
Definition: interface_output.c:399
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
ip_adjacency_t_::nbr
struct ip_adjacency_t_::@144::@145 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
ip4_arp_node
vlib_node_registration_t ip4_arp_node
(constructor) VLIB_REGISTER_NODE (ip4_arp_node)
Definition: ip4_neighbor.c:272
ip4_arp_error_strings
static char * ip4_arp_error_strings[]
Definition: ip4_neighbor.c:262
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
ip4_glean_node
vlib_node_registration_t ip4_glean_node
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
Definition: ip4_neighbor.c:285
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
rewrite
rewrite
Definition: pnat.api:158
vlib_get_next_frame
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:395
VLIB_MAIN_LOOP_ENTER_FUNCTION
#define VLIB_MAIN_LOOP_ENTER_FUNCTION(x)
Definition: init.h:175
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
adj_get
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Definition: adj.h:470
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
IP4_ARP_ERROR_NO_SOURCE_ADDRESS
@ IP4_ARP_ERROR_NO_SOURCE_ADDRESS
Definition: arp_packet.h:120
mac_address_from_bytes
static_always_inline void mac_address_from_bytes(mac_address_t *mac, const u8 *bytes)
Definition: mac_address.h:92
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169