FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
stn.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 #include <stn/stn.h>
17 
18 #include <vnet/plugin/plugin.h>
19 #include <vpp/app/version.h>
20 #include <vnet/ip/format.h>
21 #include <vnet/ethernet/packet.h>
22 #include <vnet/udp/udp.h>
23 #include <vnet/tcp/tcp.h>
24 
28 
29 static u8 stn_hw_addr_local[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
30 static u8 stn_hw_addr_dst[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
31 
32 static ethernet_header_t stn_ip4_ethernet_header = {};
33 static ethernet_header_t stn_ip6_ethernet_header = {};
34 
35 typedef struct {
38 
39 static u8 *
40 format_stn_rule (u8 * s, va_list * args)
41 {
42  stn_rule_t *r = va_arg (*args, stn_rule_t *);
43  stn_main_t *stn = &stn_main;
44  u32 indent = format_get_indent (s);
45  u32 node_index = ip46_address_is_ip4(&r->address)?stn_ip4_punt.index:stn_ip6_punt.index;
46  vlib_node_t *next_node = vlib_get_next_node(vlib_get_main(), node_index, r->next_node_index);
47  s = format (s, "rule_index: %d\n", r - stn->rules);
48  s = format (s, "%Uaddress: %U\n", format_white_space, indent,
50  s = format (s, "%Uiface: %U (%d)\n", format_white_space, indent,
52  r->sw_if_index);
53  s = format (s, "%Unext_node: %s (%d)", format_white_space, indent,
54  next_node->name, next_node->index);
55  return s;
56 }
57 
59 format_stn_ip46_punt_trace (u8 * s, va_list * args, u8 is_ipv4)
60 {
61  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
62  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
63  stn_ip46_punt_trace_t *t = va_arg (*args, stn_ip46_punt_trace_t *);
64  u32 indent = format_get_indent (s);
65 
66  format (s, "dst_address: %U\n", format_ip46_address,
67  (ip46_address_t *)&t->kv.key, IP46_TYPE_ANY);
68 
69  if (t->kv.value == ~(0L))
70  {
71  s = format (s, "%Urule: none", format_white_space, indent);
72  }
73  else
74  {
75  s = format (s, "%Urule:\n%U%U", format_white_space, indent,
76  format_white_space, indent + 2,
77  format_stn_rule, &stn_main.rules[t->kv.value]);
78  }
79  return s;
80 }
81 
82 static void
84  vlib_node_runtime_t * node, vlib_frame_t * frame)
85 {
86  u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
87  stn_main_t *stn = &stn_main;
88 
89  from = vlib_frame_vector_args (frame);
90  n_left_from = frame->n_vectors;
91  next_index = node->cached_next_index;
92 
93  while (n_left_from > 0)
94  {
95  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
96 
97  /* Single loop */
98  while (n_left_from > 0 && n_left_to_next > 0)
99  {
100  u32 pi0;
101  vlib_buffer_t *p0;
102  u32 next0;
103 
104  pi0 = to_next[0] = from[0];
105  from += 1;
106  n_left_from -= 1;
107  to_next += 1;
108  n_left_to_next -= 1;
109 
110  p0 = vlib_get_buffer (vm, pi0);
111 
112 /*
113  * We are not guaranteed any particular layer here.
114  * So we need to reparse from the beginning of the packet.
115  * which may not start from zero with some DPDK drivers.
116 
117  ip4_header_t *ip = vlib_buffer_get_current(p0);
118  if ((ip->ip_version_and_header_length & 0xf0) == 0x40)
119 *
120 */
121  int ethernet_header_offset = 0; /* to be filled by DPDK */
122  ethernet_header_t *eth = (ethernet_header_t *)(p0->data + ethernet_header_offset);
123  /* ensure the block current data starts at L3 boundary now for the subsequent nodes */
124  vlib_buffer_advance(p0, ethernet_header_offset + sizeof(ethernet_header_t) - p0->current_data);
125  if (clib_net_to_host_u16(eth->type) == ETHERNET_TYPE_IP4)
126  next0 = stn->punt_to_stn_ip4_next_index;
127  else
128  next0 = stn->punt_to_stn_ip6_next_index;
129 
130  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
131  n_left_to_next, pi0, next0);
132  }
133  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
134  }
135 }
136 
137 typedef enum
138 {
142 
145  vlib_node_runtime_t * node, vlib_frame_t * frame,
146  u8 is_ipv4)
147 {
148  u32 n_left_from, *from, next_index, *to_next, n_left_to_next;
149  stn_main_t *stn = &stn_main;
150 
151  from = vlib_frame_vector_args (frame);
152  n_left_from = frame->n_vectors;
153  next_index = node->cached_next_index;
154 
155  while (n_left_from > 0)
156  {
157  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
158 
159  /* Single loop */
160  while (n_left_from > 0 && n_left_to_next > 0)
161  {
162  u32 pi0;
163  vlib_buffer_t *p0;
165  u32 next0 = STN_IP_PUNT_DROP;
166 
167  pi0 = to_next[0] = from[0];
168  from += 1;
169  n_left_from -= 1;
170  to_next += 1;
171  n_left_to_next -= 1;
172 
173  p0 = vlib_get_buffer (vm, pi0);
174 
175  if (is_ipv4)
176  {
178  ip46_address_set_ip4((ip46_address_t *)kv.key, &hdr->dst_address);
179  }
180  else
181  {
183  kv.key[0] = hdr->dst_address.as_u64[0];
184  kv.key[1] = hdr->dst_address.as_u64[1];
185  }
186 
187  kv.value = ~(0L);
188  clib_bihash_search_inline_16_8 (&stn->rule_by_address_table, &kv);
189  if (kv.value != ~(0L))
190  {
191  ethernet_header_t *eth;
192  stn_rule_t *r = &stn->rules[kv.value];
193  vnet_buffer(p0)->sw_if_index[VLIB_TX] = r->sw_if_index;
194  next0 = r->next_node_index;
195  vlib_buffer_advance(p0, -sizeof(*eth));
197  if (is_ipv4)
198  clib_memcpy(eth, &stn_ip4_ethernet_header, sizeof(*eth));
199  else
200  clib_memcpy(eth, &stn_ip6_ethernet_header, sizeof(*eth));
201  }
202 
204  {
206  vlib_add_trace (vm, node, p0, sizeof (*tr));
207  tr->kv = kv;
208  }
209 
210  vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next,
211  n_left_to_next, pi0, next0);
212  }
213  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
214  }
215 
216  return frame->n_vectors;
217 }
218 
219 
220 #define foreach_stn_ip_punt_error \
221  _(NONE, "no error")
222 
223 typedef enum {
224 #define _(sym,str) STN_IP_punt_ERROR_##sym,
226 #undef _
228 } ila_error_t;
229 
230 static char *stn_ip_punt_error_strings[] = {
231 #define _(sym,string) string,
233 #undef _
234 };
235 
236 u8 *
237 format_stn_ip6_punt_trace (u8 * s, va_list * args)
238 {
239  return format_stn_ip46_punt_trace (s, args, 0);
240 }
241 
242 static uword
244  vlib_node_runtime_t * node, vlib_frame_t * frame)
245 {
246  return stn_ip46_punt_fn(vm, node, frame, 0);
247 }
248 
249 /** *INDENT-OFF* */
251 {
252  .function = stn_ip6_punt_fn,
253  .name = "stn-ip6-punt",
254  .vector_size = sizeof (u32),
255  .format_trace = format_stn_ip6_punt_trace,
256  .n_errors = STN_IP_PUNT_N_ERROR,
257  .error_strings = stn_ip_punt_error_strings,
258  .n_next_nodes = STN_IP_PUNT_N_NEXT,
259  .next_nodes =
260  {
261  [STN_IP_PUNT_DROP] = "error-drop"
262  },
263 };
264 /** *INDENT-ON* */
265 
266 u8 *
267 format_stn_ip4_punt_trace (u8 * s, va_list * args)
268 {
269  return format_stn_ip46_punt_trace (s, args, 1);
270 }
271 
272 static uword
274  vlib_node_runtime_t * node, vlib_frame_t * frame)
275 {
276  return stn_ip46_punt_fn(vm, node, frame, 1);
277 }
278 
279 /** *INDENT-OFF* */
281 {
282  .function = stn_ip4_punt_fn,
283  .name = "stn-ip4-punt",
284  .vector_size = sizeof (u32),
285  .format_trace = format_stn_ip4_punt_trace,
286  .n_errors = STN_IP_PUNT_N_ERROR,
287  .error_strings = stn_ip_punt_error_strings,
288  .n_next_nodes = STN_IP_PUNT_N_NEXT,
289  .next_nodes =
290  {
291  [STN_IP_PUNT_DROP] = "error-drop",
292  },
293 };
294 /** *INDENT-ON* */
295 
296 clib_error_t *
298 {
299  stn_main_t *stn = &stn_main;
300  stn->rules = 0;
301  clib_bihash_init_16_8(&stn->rule_by_address_table, "stn addresses",
302  1024, 1<<20);
303 
304  clib_memcpy(stn_ip4_ethernet_header.dst_address, stn_hw_addr_dst, 6);
305  clib_memcpy(stn_ip4_ethernet_header.src_address, stn_hw_addr_local, 6);
306  stn_ip4_ethernet_header.type = clib_host_to_net_u16(ETHERNET_TYPE_IP4);
307 
308  clib_memcpy(stn_ip6_ethernet_header.dst_address, stn_hw_addr_dst, 6);
309  clib_memcpy(stn_ip6_ethernet_header.src_address, stn_hw_addr_local, 6);
310  stn_ip6_ethernet_header.type = clib_host_to_net_u16(ETHERNET_TYPE_IP6);
311 
312  u32 punt_node_index = vlib_get_node_by_name(vm, (u8 *)"error-punt")->index;
314  vlib_node_add_next(vm, punt_node_index, stn_ip4_punt.index);
316  vlib_node_add_next(vm, punt_node_index, stn_ip6_punt.index);
317 
318  return stn_api_init (vm, stn);
319 
320  return NULL;
321 }
322 
324 
325 /* *INDENT-OFF* */
327  .version = VPP_BUILD_VER,
328  .description = "VPP Steals the NIC for Container integration",
329 };
330 /* *INDENT-ON* */
331 
333 {
334  vnet_main_t *vnm = vnet_get_main();
336  stn_main_t *stn = &stn_main;
337 
338  stn_rule_t *r = NULL;
340  kv.key[0] = args->address.as_u64[0];
341  kv.key[1] = args->address.as_u64[1];
342 
343  if (clib_bihash_search_inline_16_8 (&stn->rule_by_address_table, &kv) == 0)
344  {
345  r = &stn->rules[kv.value];
346  }
347  else if (!args->del)
348  {
349  pool_get(stn->rules, r);
350  kv.value = r - stn->rules;
351  clib_bihash_add_del_16_8(&stn->rule_by_address_table, &kv, 1);
352  r->address = args->address;
353 
354  stn->n_rules++;
355  if (stn->n_rules == 1)
356  {
358  this_vlib_main->os_punt_frame = stn_punt_fn;
359  });
360  udp_punt_unknown(vm, 0, 1);
361  udp_punt_unknown(vm, 1, 1);
362  tcp_punt_unknown(vm, 0, 1);
363  tcp_punt_unknown(vm, 1, 1);
364  }
365  }
366 
367  if (!args->del)
368  {
369  /* Getting output node and adding it as next */
370  u32 output_node_index =
372  u32 node_index = ip46_address_is_ip4(&args->address)?
373  stn_ip4_punt.index : stn_ip6_punt.index;
374 
375  r->sw_if_index = args->sw_if_index;
376  r->next_node_index =
377  vlib_node_add_next(vm, node_index, output_node_index);
378 
379  /* enabling forwarding on the output node (might not be done since
380  * it is unnumbered) */
381  vnet_feature_enable_disable("ip4-unicast", "ip4-lookup", args->sw_if_index,
382  1, 0, 0);
383  vnet_feature_enable_disable("ip6-unicast", "ip6-lookup", args->sw_if_index,
384  1, 0, 0);
385  vnet_feature_enable_disable("ip4-unicast", "ip4-drop", args->sw_if_index,
386  0, 0, 0);
387  vnet_feature_enable_disable("ip6-unicast", "ip6-drop", args->sw_if_index,
388  0, 0, 0);
389  }
390  else if (r)
391  {
392  clib_bihash_add_del_16_8(&stn->rule_by_address_table, &kv, 0);
393  pool_put(stn->rules, r);
394 
395  stn->n_rules--;
396  if (stn->n_rules == 0)
397  {
399  this_vlib_main->os_punt_frame = NULL;
400  });
401  }
402  }
403  else
404  {
405  return VNET_API_ERROR_NO_SUCH_ENTRY;
406  }
407 
408  return 0;
409 }
410 
411 static clib_error_t *
413  unformat_input_t * input, vlib_cli_command_t * cmd)
414 {
415  stn_main_t *stn = &stn_main;
416  u8 *s = 0;
417  stn_rule_t *rule;
418  pool_foreach(rule, stn->rules, {
419  s = format (s, "- %U\n", format_stn_rule, rule);
420  });
421 
422  vlib_cli_output(vm, "%v", s);
423 
424  vec_free(s);
425  return NULL;
426 }
427 
428 VLIB_CLI_COMMAND (show_stn_rules_command, static) =
429 {
430  .path = "show stn rules",
431  .short_help = "",
432  .function = show_stn_rules_fn,
433 };
434 
435 static clib_error_t *
437  unformat_input_t * input, vlib_cli_command_t * cmd)
438 {
439  unformat_input_t _line_input, *line_input = &_line_input;
440  clib_error_t *error = 0;
441  stn_rule_add_del_args_t args = {};
442  u8 got_addr = 0;
443  u8 got_iface = 0;
444  int ret;
445 
446  if (!unformat_user (input, unformat_line_input, line_input))
447  return 0;
448 
449  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
450  {
451  if (unformat (line_input, "address %U", unformat_ip46_address,
452  &args.address, IP46_TYPE_ANY))
453  got_addr = 1;
454  else if (unformat
455  (line_input, "interface %U", unformat_vnet_sw_interface,
456  vnet_get_main(), &args.sw_if_index))
457  got_iface = 1;
458  else if (unformat (line_input, "del"))
459  args.del = 1;
460  else
461  {
462  error = clib_error_return (0, "parse error: '%U'",
463  format_unformat_error, line_input);
464  goto done;
465  }
466  }
467 
468  if (!got_addr)
469  {
470  error = clib_error_return (0, "Missing address");
471  goto done;
472  }
473 
474  if (!got_iface)
475  {
476  error = clib_error_return (0, "Missing interface");
477  goto done;
478  }
479 
480  if ((ret = stn_rule_add_del (&args)))
481  {
482  error = clib_error_return (0, "stn_rule_add_del returned error %d", ret);
483  goto done;
484  }
485 
486 done:
487  unformat_free (line_input);
488  return error;
489 }
490 
491 VLIB_CLI_COMMAND (stn_rule_command, static) =
492 {
493  .path = "stn rule",
494  .short_help = "address <addr> interface <iface> [del]",
495  .function = stn_rule_fn,
496 };
static uword stn_ip4_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: stn.c:273
static u8 stn_hw_addr_local[6]
Definition: stn.c:29
VLIB_PLUGIN_REGISTER()
#define CLIB_UNUSED(x)
Definition: clib.h:79
stn_ip_punt_next_t
Definition: stn.c:137
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
clib_bihash_kv_16_8_t kv
Definition: stn.c:36
static char * stn_ip_punt_error_strings[]
Definition: stn.c:230
u64 as_u64[2]
Definition: ip6_packet.h:51
Definition: stn.h:24
#define NULL
Definition: clib.h:55
u32 index
Definition: node.h:237
u8 src_address[6]
Definition: packet.h:54
Definition: stn.h:30
u32 sw_if_index
TX interface to send packets to.
Definition: stn.h:50
struct _vlib_node_registration vlib_node_registration_t
static vlib_node_registration_t stn_ip6_punt
INDENT-OFF
Definition: stn.c:27
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:983
format_function_t format_ip46_address
Definition: format.h:61
static u32 format_get_indent(u8 *s)
Definition: format.h:72
int stn_rule_add_del(stn_rule_add_del_args_t *args)
Add or delete an stn rule.
Definition: stn.c:332
clib_bihash_16_8_t rule_by_address_table
Definition: stn.h:38
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
unformat_function_t unformat_vnet_sw_interface
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:225
stn_main_t stn_main
Definition: stn.c:25
format_function_t format_vnet_sw_if_index_name
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
Definition: node_funcs.h:1108
u32 n_rules
Definition: stn.h:35
static vlib_node_registration_t stn_ip4_punt
INDENT-OFF
Definition: stn.c:26
ip46_address_t address
Destination address of intercepted packets.
Definition: stn.h:48
stn_rule_t * rules
Definition: stn.h:32
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
Definition: buffer.h:68
#define static_always_inline
Definition: clib.h:93
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:438
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:111
static uword stn_ip6_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: stn.c:243
ip4_address_t dst_address
Definition: ip4_packet.h:164
u8 dst_address[6]
Definition: packet.h:53
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:113
#define clib_error_return(e, args...)
Definition: error.h:99
u8 del
Whether to delete the rule.
Definition: stn.h:52
static_always_inline uword stn_ip46_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_ipv4)
Definition: stn.c:144
#define foreach_stn_ip_punt_error
Definition: stn.c:220
unformat_function_t unformat_line_input
Definition: format.h:281
u8 * format_stn_ip6_punt_trace(u8 *s, va_list *args)
Definition: stn.c:237
static void stn_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: stn.c:83
clib_error_t * stn_api_init(vlib_main_t *vm, stn_main_t *sm)
Definition: stn_api.c:203
struct _unformat_input_t unformat_input_t
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:195
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:271
#define PREDICT_FALSE(x)
Definition: clib.h:105
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definition: buffer_node.h:218
#define foreach_vlib_main(body)
Definition: threads.h:244
#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:364
u32 punt_to_stn_ip4_next_index
Definition: stn.h:40
u8 * name
Definition: node.h:221
#define ip46_address_is_ip4(ip46)
Definition: ip6_packet.h:76
void udp_punt_unknown(vlib_main_t *vm, u8 is_ip4, u8 is_add)
Definition: udp_local.c:553
clib_error_t * stn_init(vlib_main_t *vm)
INDENT-ON
Definition: stn.c:297
#define UNFORMAT_END_OF_INPUT
Definition: format.h:143
static u8 stn_hw_addr_dst[6]
Definition: stn.c:30
u16 n_vectors
Definition: node.h:344
vlib_main_t * vm
Definition: buffer.c:283
ila_error_t
Definition: stn.c:223
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:336
#define VLIB_BUFFER_IS_TRACED
Definition: buffer.h:93
u32 vnet_tx_node_index_for_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
Definition: rewrite.c:96
#define clib_memcpy(a, b, c)
Definition: string.h:75
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
Definition: main.c:454
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
Definition: node.c:45
u32 next_node_index
Definition: stn.h:26
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
Definition: node.h:456
unsigned int u32
Definition: types.h:88
u32 punt_to_stn_ip6_next_index
Definition: stn.h:41
#define ip46_address_set_ip4(ip46, ip)
Definition: ip6_packet.h:78
static clib_error_t * stn_rule_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: stn.c:436
static_always_inline u8 * format_stn_ip46_punt_trace(u8 *s, va_list *args, u8 is_ipv4)
Definition: stn.c:59
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:208
unformat_function_t unformat_ip46_address
Definition: format.h:71
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23
u64 uword
Definition: types.h:112
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
void tcp_punt_unknown(vlib_main_t *vm, u8 is_ip4, u8 is_add)
Definition: tcp.c:1271
Definition: defs.h:47
static vlib_node_t * vlib_get_next_node(vlib_main_t *vm, u32 node_index, u32 next_index)
Get vlib node by graph arc (next) index.
Definition: node_funcs.h:72
u8 * format_stn_ip4_punt_trace(u8 *s, va_list *args)
INDENT-ON
Definition: stn.c:267
unsigned char u8
Definition: types.h:56
static void unformat_free(unformat_input_t *i)
Definition: format.h:161
u32 sw_if_index
Definition: stn.h:27
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:267
static u8 * format_stn_rule(u8 *s, va_list *args)
Definition: stn.c:40
#define vnet_buffer(b)
Definition: buffer.h:326
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
ip46_address_t address
Definition: stn.h:25
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:143
u8 data[0]
Packet data.
Definition: buffer.h:159
static clib_error_t * show_stn_rules_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: stn.c:412
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:75
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:680
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:57
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: feature.c:229
ip6_address_t dst_address
Definition: ip6_packet.h:341
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:169