FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
pppoe.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2017 Intel and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17 #include <stdint.h>
18 #include <net/if.h>
19 #include <sys/ioctl.h>
20 #include <inttypes.h>
21 
22 #include <vlib/vlib.h>
23 #include <vlib/unix/unix.h>
24 #include <vnet/ethernet/ethernet.h>
25 #include <vnet/fib/fib_entry.h>
26 #include <vnet/fib/fib_table.h>
28 #include <vnet/plugin/plugin.h>
29 #include <vpp/app/version.h>
30 #include <vnet/ppp/packet.h>
31 #include <pppoe/pppoe.h>
32 #include <vnet/adj/adj_midchain.h>
33 #include <vnet/adj/adj_mcast.h>
34 
35 #include <vppinfra/hash.h>
37 
39 
41 
42 u8 *
43 format_pppoe_session (u8 * s, va_list * args)
44 {
45  pppoe_session_t *t = va_arg (*args, pppoe_session_t *);
46  pppoe_main_t *pem = &pppoe_main;
47 
48  s = format (s, "[%d] sw-if-index %d client-ip %U session-id %d ",
49  t - pem->sessions, t->sw_if_index,
51  t->session_id);
52 
53  s = format (s, "encap-if-index %d decap-fib-index %d\n",
55 
56  s = format (s, " local-mac %U client-mac %U",
59 
60  return s;
61 }
62 
63 static u8 *
64 format_pppoe_name (u8 * s, va_list * args)
65 {
66  u32 dev_instance = va_arg (*args, u32);
67  return format (s, "pppoe_session%d", dev_instance);
68 }
69 
70 static clib_error_t *
72 {
75  vnet_hw_interface_set_flags (vnm, hw_if_index, hw_flags);
76 
77  return /* no error */ 0;
78 }
79 
80 /* *INDENT-OFF* */
81 VNET_DEVICE_CLASS (pppoe_device_class,static) = {
82  .name = "PPPoE",
83  .format_device_name = format_pppoe_name,
84  .admin_up_down_function = pppoe_interface_admin_up_down,
85 };
86 /* *INDENT-ON* */
87 
88 static u8 *
89 format_pppoe_header_with_length (u8 * s, va_list * args)
90 {
91  u32 dev_instance = va_arg (*args, u32);
92  s = format (s, "unimplemented dev %u", dev_instance);
93  return s;
94 }
95 
96 static u8 *
99  vnet_link_t link_type, const void *dst_address)
100 {
101  pppoe_main_t *pem = &pppoe_main;
102  pppoe_session_t *t;
105  pppoe_header_t *pppoe;
106  u32 session_id;
107  u8 *rw = 0;
108 
111 
112  int len = sizeof (pppoe_header_t) + sizeof (ethernet_header_t);
115  {
116  if (si->sub.eth.flags.one_tag == 1)
117  {
118  len += sizeof (ethernet_vlan_header_t);
119  }
120  }
121 
123 
124  ethernet_header_t *eth_hdr = (ethernet_header_t *) rw;
125  eth_hdr->type = clib_host_to_net_u16 (ETHERNET_TYPE_PPPOE_SESSION);
126  pppoe = (pppoe_header_t *) (eth_hdr + 1);
127 
129  {
130  if (si->sub.eth.flags.one_tag == 1)
131  {
132  eth_hdr->type = clib_host_to_net_u16 (ETHERNET_TYPE_VLAN);
133  ethernet_vlan_header_t *vlan =
134  (ethernet_vlan_header_t *) (eth_hdr + 1);
135  vlan->type = clib_host_to_net_u16 (ETHERNET_TYPE_PPPOE_SESSION);
136  vlan->priority_cfi_and_id =
137  clib_host_to_net_u16 (si->sub.eth.outer_vlan_id);
138  pppoe = (pppoe_header_t *) (vlan + 1);
139  }
141  }
142 
143  // set the right mac addresses
145  clib_memcpy (eth_hdr->src_address, hi->hw_address, 6);
146  clib_memcpy (eth_hdr->dst_address, t->client_mac, 6);
147 
148  pppoe->ver_type = PPPOE_VER_TYPE;
149  pppoe->code = 0;
150  pppoe->session_id = clib_host_to_net_u16 (t->session_id);
151  pppoe->length = 0; /* To be filled in at run-time */
152 
153  switch (link_type)
154  {
155  case VNET_LINK_IP4:
156  pppoe->ppp_proto = clib_host_to_net_u16 (PPP_PROTOCOL_ip4);
157  break;
158  case VNET_LINK_IP6:
159  pppoe->ppp_proto = clib_host_to_net_u16 (PPP_PROTOCOL_ip6);
160  break;
161  default:
162  break;
163  }
164 
165  return rw;
166 }
167 
168 /**
169  * @brief Fixup the adj rewrite post encap. Insert the packet's length
170  */
171 static void
173  const ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data)
174 {
175  //const pppoe_session_t *t;
176  pppoe_header_t *pppoe0;
177  uword len = (uword) data;
178 
179  /* update the rewrite string */
180  pppoe0 = vlib_buffer_get_current (b0) + len;
181 
182  pppoe0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0)
183  - sizeof (pppoe_header_t)
184  + sizeof (pppoe0->ppp_proto) - len);
185 }
186 
187 static void
189 {
190  pppoe_main_t *pem = &pppoe_main;
191  dpo_id_t dpo = DPO_INVALID;
192  ip_adjacency_t *adj;
193  pppoe_session_t *t;
195  u32 session_id;
196 
197  ASSERT (ADJ_INDEX_INVALID != ai);
198 
199  adj = adj_get (ai);
202 
203  uword len = sizeof (ethernet_header_t);
204 
207  {
208  if (si->sub.eth.flags.one_tag == 1)
209  {
210  len += sizeof (ethernet_vlan_header_t);
211  }
212  }
213 
214  switch (adj->lookup_next_index)
215  {
216  case IP_LOOKUP_NEXT_ARP:
221  pppoe_build_rewrite (vnm,
222  sw_if_index,
223  adj->ia_link,
224  NULL));
225  break;
227  /*
228  * Construct a partial rewrite from the known ethernet mcast dest MAC
229  * There's no MAC fixup, so the last 2 parameters are 0
230  */
233  pppoe_build_rewrite (vnm,
234  sw_if_index,
235  adj->ia_link,
236  NULL), 0, 0);
237  break;
238 
239  case IP_LOOKUP_NEXT_DROP:
240  case IP_LOOKUP_NEXT_PUNT:
246  case IP_LOOKUP_N_NEXT:
247  ASSERT (0);
248  break;
249  }
250 
252  t->encap_if_index, &dpo);
253 
254  adj_nbr_midchain_stack (ai, &dpo);
255 
256  dpo_reset (&dpo);
257 }
258 
259 /* *INDENT-OFF* */
260 VNET_HW_INTERFACE_CLASS (pppoe_hw_class) =
261 {
262  .name = "PPPoE",
263  .format_header = format_pppoe_header_with_length,
264  .build_rewrite = pppoe_build_rewrite,
265  .update_adjacency = pppoe_update_adj,
267 };
268 /* *INDENT-ON* */
269 
270 #define foreach_copy_field \
271 _(session_id) \
272 _(encap_if_index) \
273 _(decap_fib_index) \
274 _(client_ip)
275 
276 static bool
278  u32 decap_fib_index)
279 {
280  vlib_main_t *vm = pem->vlib_main;
281  u32 input_idx = (!is_ip6) ? ip4_input_node.index : ip6_input_node.index;
283 
284  return decap_fib_index < r->n_next_nodes;
285 }
286 
289 {
290  pppoe_main_t *pem = &pppoe_main;
291  pppoe_session_t *t = 0;
292  vnet_main_t *vnm = pem->vnet_main;
293  u32 hw_if_index = ~0;
294  u32 sw_if_index = ~0;
295  u32 is_ip6 = a->is_ip6;
296  pppoe_entry_key_t cached_key;
297  pppoe_entry_result_t cached_result;
298  u32 bucket;
300  pppoe_entry_result_t result;
303  fib_prefix_t pfx;
304 
305  cached_key.raw = ~0;
306  cached_result.raw = ~0; /* warning be gone */
307  clib_memset (&pfx, 0, sizeof (pfx));
308 
309  if (!is_ip6)
310  {
311  pfx.fp_addr.ip4.as_u32 = a->client_ip.ip4.as_u32;
312  pfx.fp_len = 32;
314  }
315  else
316  {
317  pfx.fp_addr.ip6.as_u64[0] = a->client_ip.ip6.as_u64[0];
318  pfx.fp_addr.ip6.as_u64[1] = a->client_ip.ip6.as_u64[1];
319  pfx.fp_len = 128;
321  }
322 
323  /* Get encap_if_index and local mac address from link_table */
324  pppoe_lookup_1 (&pem->link_table, &cached_key, &cached_result,
325  a->client_mac, 0, &key, &bucket, &result);
326  a->encap_if_index = result.fields.sw_if_index;
327 
328  if (a->encap_if_index == ~0)
329  return VNET_API_ERROR_INVALID_SW_IF_INDEX;
330 
331  si = vnet_get_sw_interface (vnm, a->encap_if_index);
333 
334  /* lookup session_table */
335  pppoe_lookup_1 (&pem->session_table, &cached_key, &cached_result,
336  a->client_mac, clib_host_to_net_u16 (a->session_id),
337  &key, &bucket, &result);
338 
339  /* learn client session */
340  pppoe_learn_process (&pem->session_table, a->encap_if_index,
341  &key, &cached_key, &bucket, &result);
342 
343  if (a->is_add)
344  {
345  /* adding a session: session must not already exist */
346  if (result.fields.session_index != ~0)
347  return VNET_API_ERROR_TUNNEL_EXIST;
348 
349  /*if not set explicitly, default to ip4 */
350  if (!pppoe_decap_next_is_valid (pem, is_ip6, a->decap_fib_index))
351  return VNET_API_ERROR_INVALID_DECAP_NEXT;
352 
354  clib_memset (t, 0, sizeof (*t));
355 
356  clib_memcpy (t->local_mac, hi->hw_address, 6);
357 
358  /* copy from arg structure */
359 #define _(x) t->x = a->x;
361 #undef _
362 
363  clib_memcpy (t->client_mac, a->client_mac, 6);
364 
365  /* update pppoe fib with session_index */
366  result.fields.session_index = t - pem->sessions;
367  pppoe_update_1 (&pem->session_table,
368  a->client_mac, clib_host_to_net_u16 (a->session_id),
369  &key, &bucket, &result);
370 
373  {
375  hw_if_index = pem->free_pppoe_session_hw_if_indices
377  _vec_len (pem->free_pppoe_session_hw_if_indices) -= 1;
378 
379  hi = vnet_get_hw_interface (vnm, hw_if_index);
380  hi->dev_instance = t - pem->sessions;
381  hi->hw_instance = hi->dev_instance;
382 
383  /* clear old stats of freed session before reuse */
384  sw_if_index = hi->sw_if_index;
388  sw_if_index);
391  sw_if_index);
394  sw_if_index);
396  }
397  else
398  {
399  hw_if_index = vnet_register_interface
400  (vnm, pppoe_device_class.index, t - pem->sessions,
401  pppoe_hw_class.index, t - pem->sessions);
402  hi = vnet_get_hw_interface (vnm, hw_if_index);
403  }
404 
405  t->hw_if_index = hw_if_index;
406  t->sw_if_index = sw_if_index = hi->sw_if_index;
407 
409  ~0);
411 
416 
417  /* add reverse route for client ip */
418  fib_table_entry_path_add (a->decap_fib_index, &pfx,
421  &pfx.fp_addr, sw_if_index, ~0,
422  1, NULL, FIB_ROUTE_PATH_FLAG_NONE);
423 
424  }
425  else
426  {
427  /* deleting a session: session must exist */
428  if (result.fields.session_index == ~0)
429  return VNET_API_ERROR_NO_SUCH_ENTRY;
430 
431  t = pool_elt_at_index (pem->sessions, result.fields.session_index);
433 
434  vnet_sw_interface_set_flags (vnm, t->sw_if_index, 0 /* down */ );
437 
439 
441 
442  /* update pppoe fib with session_inde=~0x */
443  result.fields.session_index = ~0;
444  pppoe_update_1 (&pem->session_table,
445  a->client_mac, clib_host_to_net_u16 (a->session_id),
446  &key, &bucket, &result);
447 
448 
449  /* delete reverse route for client ip */
450  fib_table_entry_path_remove (a->decap_fib_index, &pfx,
453  &pfx.fp_addr,
454  sw_if_index, ~0, 1,
456 
457  pool_put (pem->sessions, t);
458  }
459 
460  if (sw_if_indexp)
461  *sw_if_indexp = sw_if_index;
462 
463  return 0;
464 }
465 
466 static clib_error_t *
468  unformat_input_t * input,
469  vlib_cli_command_t * cmd)
470 {
471  unformat_input_t _line_input, *line_input = &_line_input;
472  u16 session_id = 0;
473  ip46_address_t client_ip;
474  u8 is_add = 1;
475  u8 client_ip_set = 0;
476  u8 ipv4_set = 0;
477  u8 ipv6_set = 0;
478  u32 encap_if_index = 0;
479  u32 decap_fib_index = 0;
480  u8 client_mac[6] = { 0 };
481  u8 client_mac_set = 0;
482  int rv;
483  u32 tmp;
485  u32 session_sw_if_index;
486  clib_error_t *error = NULL;
487 
488  /* Cant "universally zero init" (={0}) due to GCC bug 53119 */
489  clib_memset (&client_ip, 0, sizeof client_ip);
490 
491  /* Get a line of input. */
492  if (!unformat_user (input, unformat_line_input, line_input))
493  return 0;
494 
495  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
496  {
497  if (unformat (line_input, "del"))
498  {
499  is_add = 0;
500  }
501  else if (unformat (line_input, "session-id %d", &session_id))
502  ;
503  else if (unformat (line_input, "client-ip %U",
504  unformat_ip4_address, &client_ip.ip4))
505  {
506  client_ip_set = 1;
507  ipv4_set = 1;
508  }
509  else if (unformat (line_input, "client-ip %U",
510  unformat_ip6_address, &client_ip.ip6))
511  {
512  client_ip_set = 1;
513  ipv6_set = 1;
514  }
515  else if (unformat (line_input, "decap-vrf-id %d", &tmp))
516  {
517  if (ipv6_set)
518  decap_fib_index = fib_table_find (FIB_PROTOCOL_IP6, tmp);
519  else
520  decap_fib_index = fib_table_find (FIB_PROTOCOL_IP4, tmp);
521 
522  if (decap_fib_index == ~0)
523  {
524  error =
525  clib_error_return (0, "nonexistent decap fib id %d", tmp);
526  goto done;
527  }
528  }
529  else
530  if (unformat
531  (line_input, "client-mac %U", unformat_ethernet_address,
532  client_mac))
533  client_mac_set = 1;
534  else
535  {
536  error = clib_error_return (0, "parse error: '%U'",
537  format_unformat_error, line_input);
538  goto done;
539  }
540  }
541 
542  if (client_ip_set == 0)
543  {
544  error =
545  clib_error_return (0, "session client ip address not specified");
546  goto done;
547  }
548 
549  if (ipv4_set && ipv6_set)
550  {
551  error = clib_error_return (0, "both IPv4 and IPv6 addresses specified");
552  goto done;
553  }
554 
555  if (client_mac_set == 0)
556  {
557  error = clib_error_return (0, "session client mac not specified");
558  goto done;
559  }
560 
561  clib_memset (a, 0, sizeof (*a));
562 
563  a->is_add = is_add;
564  a->is_ip6 = ipv6_set;
565 
566 #define _(x) a->x = x;
568 #undef _
569 
570  clib_memcpy (a->client_mac, client_mac, 6);
571 
572  rv = vnet_pppoe_add_del_session (a, &session_sw_if_index);
573 
574  switch (rv)
575  {
576  case 0:
577  if (is_add)
579  vnet_get_main (), session_sw_if_index);
580  break;
581 
582  case VNET_API_ERROR_TUNNEL_EXIST:
583  error = clib_error_return (0, "session already exists...");
584  goto done;
585 
586  case VNET_API_ERROR_NO_SUCH_ENTRY:
587  error = clib_error_return (0, "session does not exist...");
588  goto done;
589 
590  default:
592  (0, "vnet_pppoe_add_del_session returned %d", rv);
593  goto done;
594  }
595 
596 done:
597  unformat_free (line_input);
598 
599  return error;
600 }
601 
602 /*?
603  * Add or delete a PPPoE Session.
604  *
605  * @cliexpar
606  * Example of how to create a PPPoE Session:
607  * @cliexcmd{create pppoe session client-ip 10.0.3.1 session-id 13
608  * client-mac 00:01:02:03:04:05 }
609  * Example of how to delete a PPPoE Session:
610  * @cliexcmd{create pppoe session client-ip 10.0.3.1 session-id 13
611  * client-mac 00:01:02:03:04:05 del }
612  ?*/
613 /* *INDENT-OFF* */
615  .path = "create pppoe session",
616  .short_help =
617  "create pppoe session client-ip <client-ip> session-id <nn>"
618  " client-mac <client-mac> [decap-vrf-id <nn>] [del]",
620 };
621 /* *INDENT-ON* */
622 
623 /* *INDENT-OFF* */
624 static clib_error_t *
626  unformat_input_t * input,
627  vlib_cli_command_t * cmd)
628 {
629  pppoe_main_t *pem = &pppoe_main;
630  pppoe_session_t *t;
631 
632  if (pool_elts (pem->sessions) == 0)
633  vlib_cli_output (vm, "No pppoe sessions configured...");
634 
635  pool_foreach (t, pem->sessions)
636  {
638  }
639 
640  return 0;
641 }
642 /* *INDENT-ON* */
643 
644 /*?
645  * Display all the PPPoE Session entries.
646  *
647  * @cliexpar
648  * Example of how to display the PPPoE Session entries:
649  * @cliexstart{show pppoe session}
650  * [0] client-ip 10.0.3.1 session_id 13 encap-if-index 0 decap-vrf-id 13 sw_if_index 5
651  * local-mac a0:b0:c0:d0:e0:f0 client-mac 00:01:02:03:04:05
652  * @cliexend
653  ?*/
654 /* *INDENT-OFF* */
656  .path = "show pppoe session",
657  .short_help = "show pppoe session",
658  .function = show_pppoe_session_command_fn,
659 };
660 /* *INDENT-ON* */
661 
663 {
668 
669 static int
670 pppoe_show_walk_cb (BVT (clib_bihash_kv) * kvp, void *arg)
671 {
672  pppoe_show_walk_ctx_t *ctx = arg;
673  pppoe_entry_result_t result;
675 
676  if (ctx->first_entry)
677  {
678  ctx->first_entry = 0;
679  vlib_cli_output (ctx->vm,
680  "%=19s%=12s%=13s%=14s",
681  "Mac-Address", "session_id", "sw_if_index",
682  "session_index");
683  }
684 
685  key.raw = kvp->key;
686  result.raw = kvp->value;
687 
688  vlib_cli_output (ctx->vm,
689  "%=19U%=12d%=13d%=14d",
690  format_ethernet_address, key.fields.mac,
691  clib_net_to_host_u16 (key.fields.session_id),
692  result.fields.sw_if_index == ~0
693  ? -1 : result.fields.sw_if_index,
694  result.fields.session_index == ~0
695  ? -1 : result.fields.session_index);
696  ctx->total_entries++;
697 
698  return (BIHASH_WALK_CONTINUE);
699 }
700 
701 /** Display the contents of the PPPoE Fib. */
702 static clib_error_t *
704  unformat_input_t * input, vlib_cli_command_t * cmd)
705 {
706  pppoe_main_t *pem = &pppoe_main;
708  .first_entry = 1,
709  .vm = vm,
710  };
711 
713  (&pem->session_table, pppoe_show_walk_cb, &ctx);
714 
715  if (ctx.total_entries == 0)
716  vlib_cli_output (vm, "no pppoe fib entries");
717  else
718  vlib_cli_output (vm, "%lld pppoe fib entries", ctx.total_entries);
719 
720  return 0;
721 }
722 
723 /*?
724  * This command dispays the MAC Address entries of the PPPoE FIB table.
725  * Output can be filtered to just get the number of MAC Addresses or display
726  * each MAC Address.
727  *
728  * @cliexpar
729  * Example of how to display the number of MAC Address entries in the PPPoE
730  * FIB table:
731  * @cliexstart{show pppoe fib}
732  * Mac Address session_id Interface sw_if_index session_index
733  * 52:54:00:53:18:33 1 GigabitEthernet0/8/0 2 0
734  * 52:54:00:53:18:55 2 GigabitEthernet0/8/1 3 1
735  * @cliexend
736 ?*/
737 /* *INDENT-OFF* */
739  .path = "show pppoe fib",
740  .short_help = "show pppoe fib",
741  .function = show_pppoe_fib_command_fn,
742 };
743 /* *INDENT-ON* */
744 
745 clib_error_t *
747 {
748  pppoe_main_t *pem = &pppoe_main;
749 
750  pem->vnet_main = vnet_get_main ();
751  pem->vlib_main = vm;
752 
753  /* Create the hash table */
754  BV (clib_bihash_init) (&pem->link_table, "pppoe link table",
756 
757  BV (clib_bihash_init) (&pem->session_table, "pppoe session table",
759 
760  ethernet_register_input_type (vm, ETHERNET_TYPE_PPPOE_SESSION,
761  pppoe_input_node.index);
762 
763  ethernet_register_input_type (vm, ETHERNET_TYPE_PPPOE_DISCOVERY,
764  pppoe_cp_dispatch_node.index);
765 
769 
770  return 0;
771 }
772 
774 
775 /* *INDENT-OFF* */
777  .version = VPP_BUILD_VER,
778  .description = "PPP over Ethernet (PPPoE)",
779 };
780 /* *INDENT-ON* */
781 
782 /*
783  * fd.io coding-style-patch-verification: ON
784  *
785  * Local Variables:
786  * eval: (c-set-style "gnu")
787  * End:
788  */
vlib.h
pppoe_session_t::decap_fib_index
u32 decap_fib_index
FIB indices - inner IP packet lookup here.
Definition: pppoe.h:64
tmp
u32 * tmp
Definition: interface_output.c:1096
fib_table_entry_path_add
fib_node_index_t fib_table_entry_path_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Add one path to an entry (aka route) in the FIB.
Definition: fib_table.c:563
pppoe_session_t::local_mac
u8 local_mac[6]
Definition: pppoe.h:66
im
vnet_interface_main_t * im
Definition: interface_output.c:415
adj_midchain.h
fib_entry.h
unformat_ethernet_address
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
Definition: format.c:233
vnet_sw_interface_set_flags
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
Definition: interface.c:523
DPO_INVALID
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
Definition: dpo.h:204
vnet_sub_interface_t::eth
struct vnet_sub_interface_t::@374 eth
interface_tx_dpo_add_or_lock
void interface_tx_dpo_add_or_lock(dpo_proto_t proto, u32 sw_if_index, dpo_id_t *dpo)
The data-path object representing transmitting the packet on a n interface.
Definition: interface_tx_dpo.c:39
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
unformat_user
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
bihash_template.c
VNET_DEVICE_CLASS
VNET_DEVICE_CLASS(pppoe_device_class, static)
pppoe_header_t::ppp_proto
u16 ppp_proto
Definition: pppoe.h:43
vnet_sw_interface_t::type
vnet_sw_interface_type_t type
Definition: interface.h:871
pppoe_session_t::hw_if_index
u32 hw_if_index
Definition: pppoe.h:71
pppoe_show_walk_ctx_t_::first_entry
u8 first_entry
Definition: pppoe.c:665
vnet_sw_interface_t
Definition: interface.h:869
vnet_sub_interface_t::flags
struct vnet_sub_interface_t::@374::@375::@377 flags
pppoe_fib_src
static fib_source_t pppoe_fib_src
Definition: pppoe.c:40
pppoe_header_t::ver_type
u8 ver_type
Definition: pppoe.h:39
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
pppoe_build_rewrite
static u8 * pppoe_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
Definition: pppoe.c:97
VNET_INTERFACE_COUNTER_TX
@ VNET_INTERFACE_COUNTER_TX
Definition: interface.h:919
vnet_sub_interface_t::outer_vlan_id
u16 outer_vlan_id
Definition: interface.h:783
pppoe_add_del_session_command_fn
static clib_error_t * pppoe_add_del_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: pppoe.c:467
pppoe_entry_result_t
Definition: pppoe.h:136
ethernet_vlan_header_t
Definition: packet.h:128
unformat_line_input
unformat_function_t unformat_line_input
Definition: format.h:275
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
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:549
vnet_pppoe_add_del_session
int vnet_pppoe_add_del_session(vnet_pppoe_add_del_session_args_t *a, u32 *sw_if_indexp)
Definition: pppoe.c:288
format_ethernet_address
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
ethernet_header_t::dst_address
u8 dst_address[6]
Definition: packet.h:55
pool_get_aligned
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
Definition: pool.h:249
ethernet_header_t::src_address
u8 src_address[6]
Definition: packet.h:56
create_pppoe_session_command
static vlib_cli_command_t create_pppoe_session_command
(constructor) VLIB_CLI_COMMAND (create_pppoe_session_command)
Definition: pppoe.c:614
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
pppoe_update_adj
static void pppoe_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
Definition: pppoe.c:188
VNET_SW_INTERFACE_TYPE_SUB
@ VNET_SW_INTERFACE_TYPE_SUB
Definition: interface.h:767
adj_mcast.h
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
show_pppoe_session_command
static vlib_cli_command_t show_pppoe_session_command
(constructor) VLIB_CLI_COMMAND (show_pppoe_session_command)
Definition: pppoe.c:655
pppoe_show_walk_ctx_t_::total_entries
u32 total_entries
Definition: pppoe.c:666
vlib_cli_command_t::path
char * path
Definition: cli.h:96
vnet_interface_main_t
Definition: interface.h:990
fib_table.h
pppoe_main_t::vnet_main
vnet_main_t * vnet_main
Definition: pppoe.h:177
IP_LOOKUP_NEXT_LOCAL
@ IP_LOOKUP_NEXT_LOCAL
This packet is for one of our own IP addresses.
Definition: adj.h:58
pppoe_show_walk_ctx_t_
Definition: pppoe.c:662
u16
unsigned short u16
Definition: types.h:57
VNET_HW_INTERFACE_CLASS
VNET_HW_INTERFACE_CLASS(pppoe_hw_class)
fib_prefix_t_::fp_len
u16 fp_len
The mask length.
Definition: fib_types.h:206
VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
Definition: interface.h:844
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
IP_LOOKUP_NEXT_MIDCHAIN
@ IP_LOOKUP_NEXT_MIDCHAIN
This packets follow a mid-chain adjacency.
Definition: adj.h:76
ethernet_header_t::type
u16 type
Definition: packet.h:59
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vnet_get_sw_interface
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
Definition: interface_funcs.h:58
VNET_HW_INTERFACE_FLAG_LINK_UP
@ VNET_HW_INTERFACE_FLAG_LINK_UP
Definition: interface.h:509
pppoe_show_walk_ctx_t_::vm
vlib_main_t * vm
Definition: pppoe.c:664
vnet_interface_main_t::sw_if_counters
vlib_simple_counter_main_t * sw_if_counters
Definition: interface.h:1023
hi
vl_api_ip4_address_t hi
Definition: arp.api:37
adj_mcast_midchain_update_rewrite
void adj_mcast_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite, u8 offset, u32 mask)
adj_mcast_midchain_update_rewrite
Definition: adj_mcast.c:139
format_pppoe_session
u8 * format_pppoe_session(u8 *s, va_list *args)
Definition: pppoe.c:43
pppoe_learn_process
static_always_inline void pppoe_learn_process(BVT(clib_bihash) *table, u32 sw_if_index0, pppoe_entry_key_t *key0, pppoe_entry_key_t *cached_key, u32 *bucket0, pppoe_entry_result_t *result0)
Perform learning on one packet based on the mac table lookup result.
Definition: pppoe.h:242
unformat_input_t
struct _unformat_input_t unformat_input_t
format_pppoe_name
static u8 * format_pppoe_name(u8 *s, va_list *args)
Definition: pppoe.c:64
ip_adjacency_t_::ia_link
vnet_link_t ia_link
link/ether-type 1 bytes
Definition: adj.h:343
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1089
vlib_buffer_length_in_chain
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
Definition: buffer_funcs.h:433
PPPOE_VER_TYPE
#define PPPOE_VER_TYPE
Definition: pppoe.h:46
ethernet.h
error
Definition: cJSON.c:88
pppoe_fixup
static void pppoe_fixup(vlib_main_t *vm, const ip_adjacency_t *adj, vlib_buffer_t *b0, const void *data)
Fixup the adj rewrite post encap.
Definition: pppoe.c:172
pppoe_input_node
vlib_node_registration_t pppoe_input_node
(constructor) VLIB_REGISTER_NODE (pppoe_input_node)
Definition: pppoe_decap.c:470
key
typedef key
Definition: ipsec_types.api:91
pppoe_header_t::length
u16 length
Definition: pppoe.h:42
pppoe_show_walk_cb
static int pppoe_show_walk_cb(BVT(clib_bihash_kv) *kvp, void *arg)
Definition: pppoe.c:670
vnet_sw_interface_t::flags
vnet_sw_interface_flags_t flags
Definition: interface.h:873
pppoe_session_t::client_ip
ip46_address_t client_ip
Definition: pppoe.h:58
vnet_link_to_dpo_proto
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
Definition: dpo.c:98
format_pppoe_header_with_length
static u8 * format_pppoe_header_with_length(u8 *s, va_list *args)
Definition: pppoe.c:89
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
pppoe_main_t::vlib_main
vlib_main_t * vlib_main
Definition: pppoe.h:176
pppoe_session_t::encap_if_index
u32 encap_if_index
Definition: pppoe.h:61
vnet_pppoe_add_del_session_args_t
Definition: pppoe.h:186
pppoe_main_t
Definition: pppoe.h:152
IP_LOOKUP_NEXT_MCAST_MIDCHAIN
@ IP_LOOKUP_NEXT_MCAST_MIDCHAIN
Multicast Midchain Adjacency.
Definition: adj.h:89
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
hash.h
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
unformat_free
static void unformat_free(unformat_input_t *i)
Definition: format.h:155
IP_LOOKUP_NEXT_DROP
@ IP_LOOKUP_NEXT_DROP
Adjacency to drop this packet.
Definition: adj.h:53
len
u8 len
Definition: ip_types.api:103
pppoe_init
clib_error_t * pppoe_init(vlib_main_t *vm)
Definition: pppoe.c:746
vnet_sw_interface_t::sub
vnet_sub_interface_t sub
Definition: interface.h:893
clib_bihash_init
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
VNET_LINK_IP4
@ VNET_LINK_IP4
Definition: interface.h:344
PPPOE_NUM_BUCKETS
#define PPPOE_NUM_BUCKETS
Definition: pppoe.h:106
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
fib_table_entry_path_remove
void fib_table_entry_path_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_route_path_flags_t path_flags)
remove one path to an entry (aka route) in the FIB.
Definition: fib_table.c:736
ip_adjacency_t_::lookup_next_index
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
Definition: adj.h:337
vnet_get_hw_interface
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
Definition: interface_funcs.h:44
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
vec_validate_aligned
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
Definition: vec.h:534
FIB_ENTRY_FLAG_NONE
@ FIB_ENTRY_FLAG_NONE
Definition: fib_entry.h:112
pppoe_session_t::client_mac
u8 client_mac[6]
Definition: pppoe.h:67
uword
u64 uword
Definition: types.h:112
vlib_zero_combined_counter
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
Definition: counter.h:298
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
BVT
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
Definition: l2_fib.c:1065
pppoe_header_t::session_id
u16 session_id
Definition: pppoe.h:41
session_id
u32 session_id
Definition: flow_types.api:131
IP_LOOKUP_NEXT_PUNT
@ IP_LOOKUP_NEXT_PUNT
Adjacency to punt this packet.
Definition: adj.h:55
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
pppoe_entry_result_t::raw
u64 raw
Definition: pppoe.h:147
IP_LOOKUP_NEXT_BCAST
@ IP_LOOKUP_NEXT_BCAST
Broadcast Adjacency.
Definition: adj.h:85
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
VNET_INTERFACE_COUNTER_RX
@ VNET_INTERFACE_COUNTER_RX
Definition: interface.h:915
FIB_PROTOCOL_IP4
@ FIB_PROTOCOL_IP4
Definition: fib_types.h:36
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:58
pppoe_header_t::code
u8 code
Definition: pppoe.h:40
vlib_cli_output
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:716
vnet_interface_main_t::combined_sw_if_counters
vlib_combined_counter_main_t * combined_sw_if_counters
Definition: interface.h:1024
fib_source_allocate
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
Definition: fib_source.c:118
fib_proto_to_dpo
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
Definition: fib_types.c:343
fib_prefix_t_::fp_addr
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:225
pppoe_decap_next_is_valid
static bool pppoe_decap_next_is_valid(pppoe_main_t *pem, u32 is_ip6, u32 decap_fib_index)
Definition: pppoe.c:277
ADJ_FLAG_NONE
@ ADJ_FLAG_NONE
Definition: adj.h:215
pppoe_lookup_1
static_always_inline void pppoe_lookup_1(BVT(clib_bihash) *table, pppoe_entry_key_t *cached_key, pppoe_entry_result_t *cached_result, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
Definition: pppoe.h:277
plugin.h
pppoe_session_t
Definition: pppoe.h:49
FIB_SOURCE_BH_API
@ FIB_SOURCE_BH_API
add paths with [mpls] path extensions
Definition: fib_source.h:208
ethernet_vlan_header_t::priority_cfi_and_id
u16 priority_cfi_and_id
Definition: packet.h:131
FIB_SOURCE_PRIORITY_HI
#define FIB_SOURCE_PRIORITY_HI
Some priority values that plugins might use when they are not to concerned where in the list they'll ...
Definition: fib_source.h:284
IP_LOOKUP_NEXT_ICMP_ERROR
@ IP_LOOKUP_NEXT_ICMP_ERROR
This packets needs to go to ICMP error.
Definition: adj.h:79
data
u8 data[128]
Definition: ipsec_types.api:95
pppoe_update_1
static_always_inline void pppoe_update_1(BVT(clib_bihash) *table, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
Definition: pppoe.h:311
adj_nbr_midchain_stack
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
Definition: adj_midchain.c:429
is_ip6
bool is_ip6
Definition: ip.api:43
vnet_hw_interface_t
Definition: interface.h:638
vnet_main_t
Definition: vnet.h:76
vnet_sw_interface_t::sup_sw_if_index
u32 sup_sw_if_index
Definition: interface.h:881
ip6_input_node
vlib_node_registration_t ip6_input_node
(constructor) VLIB_REGISTER_NODE (ip6_input_node)
Definition: ip6_input.c:231
vnet_interface_counter_unlock
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
Definition: interface.h:1058
pppoe_session_t::session_id
u16 session_id
Definition: pppoe.h:55
adj_nbr_midchain_update_rewrite
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
Definition: adj_midchain.c:213
pppoe_entry_key_t::raw
u64 raw
Definition: pppoe.h:127
format_vnet_sw_if_index_name
format_function_t format_vnet_sw_if_index_name
Definition: interface_funcs.h:458
VLIB_PLUGIN_REGISTER
VLIB_PLUGIN_REGISTER()
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
pppoe_entry_result_t::fields
struct pppoe_entry_result_t::@776::@778 fields
vlib_zero_simple_counter
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
Definition: counter.h:154
vec_validate_init_empty
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
Definition: vec.h:570
format_ip46_address
format_function_t format_ip46_address
Definition: ip46_address.h:50
FIB_ROUTE_PATH_FLAG_NONE
@ FIB_ROUTE_PATH_FLAG_NONE
Definition: fib_types.h:332
pppoe_main_t::session_index_by_sw_if_index
u32 * session_index_by_sw_if_index
Definition: pppoe.h:167
pppoe_header_t
Definition: pppoe.h:37
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
show_pppoe_fib_command
static vlib_cli_command_t show_pppoe_fib_command
(constructor) VLIB_CLI_COMMAND (show_pppoe_fib_command)
Definition: pppoe.c:738
FIB_PROTOCOL_IP6
@ FIB_PROTOCOL_IP6
Definition: fib_types.h:37
interface_tx_dpo.h
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
si
vnet_sw_interface_t * si
Definition: interface_output.c:418
packet.h
pool_elts
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:127
pppoe_interface_admin_up_down
static clib_error_t * pppoe_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Definition: pppoe.c:71
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
fib_prefix_t_::fp_proto
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:211
PPPOE_MEMORY_SIZE
#define PPPOE_MEMORY_SIZE
Definition: pppoe.h:107
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
VNET_SW_INTERFACE_FLAG_HIDDEN
@ VNET_SW_INTERFACE_FLAG_HIDDEN
Definition: interface.h:856
vnet_link_t
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
show_pppoe_session_command_fn
static clib_error_t * show_pppoe_session_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: pppoe.c:625
IP_LOOKUP_N_NEXT
@ IP_LOOKUP_N_NEXT
Definition: adj.h:91
clib_bihash_foreach_key_value_pair
void clib_bihash_foreach_key_value_pair(clib_bihash *h, clib_bihash_foreach_key_value_pair_cb *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vnet_hw_interface_set_flags
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
Definition: interface.c:513
a
a
Definition: bitmap.h:525
unix.h
VNET_LINK_IP6
@ VNET_LINK_IP6
Definition: interface.h:348
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_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
ip4_input_node
vlib_node_registration_t ip4_input_node
Global ip4 input node.
Definition: ip4_input.c:386
IP_LOOKUP_NEXT_MCAST
@ IP_LOOKUP_NEXT_MCAST
Multicast Adjacency.
Definition: adj.h:82
ethernet_vlan_header_t::type
u16 type
Definition: packet.h:136
pppoe_main_t::free_pppoe_session_hw_if_indices
u32 * free_pppoe_session_hw_if_indices
Definition: pppoe.h:164
show_pppoe_fib_command_fn
static clib_error_t * show_pppoe_fib_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Display the contents of the PPPoE Fib.
Definition: pppoe.c:703
VNET_HW_INTERFACE_CLASS_FLAG_P2P
@ VNET_HW_INTERFACE_CLASS_FLAG_P2P
a point 2 point interface
Definition: interface.h:394
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
fib_source_t
enum fib_source_t_ fib_source_t
The different sources that can create a route.
unformat_ip6_address
unformat_function_t unformat_ip6_address
Definition: format.h:89
vnet_sw_interface_t::hw_if_index
u32 hw_if_index
Definition: interface.h:887
rv
int __clib_unused rv
Definition: application.c:491
IP46_TYPE_ANY
@ IP46_TYPE_ANY
Definition: ip46_address.h:24
unformat_ip4_address
unformat_function_t unformat_ip4_address
Definition: format.h:68
vlib_node_runtime_t
Definition: node.h:454
vlib_cli_command_t
Definition: cli.h:92
pppoe_main_t::sessions
pppoe_session_t * sessions
Definition: pppoe.h:155
fib_table_find
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
Definition: fib_table.c:1111
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
pppoe_show_walk_ctx_t
struct pppoe_show_walk_ctx_t_ pppoe_show_walk_ctx_t
pppoe_cp_dispatch_node
vlib_node_registration_t pppoe_cp_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_cp_dispatch_node)
Definition: pppoe_cp_node.c:238
dpo_reset
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Definition: dpo.c:234
pppoe_main
pppoe_main_t pppoe_main
Definition: pppoe.c:38
vnet_interface_counter_lock
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
Definition: interface.h:1051
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
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
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_INTERFACE_COUNTER_DROP
@ VNET_INTERFACE_COUNTER_DROP
Definition: interface.h:904
vnet_register_interface
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
Definition: interface.c:812
vnet_main_t::interface_main
vnet_interface_main_t interface_main
Definition: vnet.h:81
pppoe.h
foreach_copy_field
#define foreach_copy_field
Definition: pppoe.c:270
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
pppoe_entry_key_t
Definition: pppoe.h:113
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105
pppoe_session_t::sw_if_index
u32 sw_if_index
Definition: pppoe.h:70