FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
l2t.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 #include <vnet/vnet.h>
16 #include <vnet/ip/ip.h>
17 #include <vnet/ethernet/ethernet.h>
18 
19 #if DPDK == 0
20 #include <vnet/devices/pci/ixge.h>
21 #else
22 #include <vnet/devices/dpdk/dpdk.h>
23 #endif
24 
25 #include <vppinfra/error.h>
26 #include <vppinfra/hash.h>
27 #include <app/l2t.h>
28 
30 
31 /* $$$$ unused?
32  * get_interface_ethernet_address
33  * paints the ethernet address for a given interface
34  * into the supplied destination
35  */
36 void
37 get_interface_ethernet_address (l2t_main_t * lm, u8 * dst, u32 sw_if_index)
38 {
42 
43  hi = vnet_get_sup_hw_interface (lm->vnet_main, sw_if_index);
45  clib_memcpy (dst, ei->address, sizeof (ei->address));
46 }
47 
48 /* packet trace format function */
49 u8 *
50 format_l2t_trace (u8 * s, va_list * args)
51 {
52  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
53  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
54  l2t_trace_t *t = va_arg (*args, l2t_trace_t *);
55 
56  if (t->is_user_to_network)
57  s = format (s, "L2T: %U (client) -> %U (our) session %d",
60  else
61  s = format (s, "L2T: %U (our) -> %U (client) session %d)",
64  return s;
65 }
66 
67 u8 *
68 format_l2t_session (u8 * s, va_list * args)
69 {
70  l2t_session_t *session = va_arg (*args, l2t_session_t *);
71  l2t_main_t *lm = &l2t_main;
74 
75  s = format (s, "[%d] %U (our) %U (client) vlan-id %d rx_sw_if_index %d\n",
76  session - lm->sessions,
79  clib_net_to_host_u16 (session->vlan_id), session->sw_if_index);
80 
81  s = format (s, " local cookie %llx remote cookie %llx\n",
82  clib_net_to_host_u64 (session->local_cookie),
83  clib_net_to_host_u64 (session->remote_cookie));
84 
85  if (session->cookie_flags & L2TP_COOKIE_ROLLOVER_LOCAL)
86  {
87  s = format (s, " local rollover cookie %llx\n",
88  clib_net_to_host_u64 (session->lcl_ro_cookie));
89  }
90 
91  s = format (s, " local session-id %d remote session-id %d\n",
92  clib_net_to_host_u32 (session->local_session_id),
93  clib_net_to_host_u32 (session->remote_session_id));
94 
95  s = format (s, " l2 specific sublayer %s\n",
96  session->l2_sublayer_present ? "preset" : "absent");
97 
98  counter_index =
101 
102  vlib_get_combined_counter (&lm->counter_main, counter_index, &v);
103  if (v.packets != 0)
104  s = format (s, " user-to-net: %llu pkts %llu bytes\n",
105  v.packets, v.bytes);
106 
107  vlib_get_combined_counter (&lm->counter_main, counter_index + 1, &v);
108 
109  if (v.packets != 0)
110  s = format (s, " net-to-user: %llu pkts %llu bytes\n",
111  v.packets, v.bytes);
112  return s;
113 }
114 
115 static clib_error_t *
117  unformat_input_t * input,
118  vlib_cli_command_t * cmd)
119 {
120  l2t_main_t *lm = &l2t_main;
121 
122  vlib_cli_output (vm, "%d active sessions\n", pool_elts (lm->sessions));
123 
124  return 0;
125 }
126 
127 /* *INDENT-OFF* */
128 static VLIB_CLI_COMMAND (show_session_summary_command) = {
129  .path = "show session",
130  .short_help = "show session summary",
132 };
133 /* *INDENT-ON* */
134 
135 static clib_error_t *
137  unformat_input_t * input,
138  vlib_cli_command_t * cmd)
139 {
140  l2t_session_t *session;
141  l2t_main_t *lm = &l2t_main;
142 
143  /* *INDENT-OFF* */
144  pool_foreach (session, lm->sessions,
145  ({
146  vlib_cli_output (vm, "%U", format_l2t_session, session);
147  }));
148  /* *INDENT-ON* */
149 
150  return 0;
151 }
152 
153 /* *INDENT-OFF* */
154 static VLIB_CLI_COMMAND (show_session_detail_command) = {
155  .path = "show session detail",
156  .short_help = "show session table detail",
157  .function = show_session_detail_command_fn,
158 };
159 /* *INDENT-ON* */
160 
161 static clib_error_t *
163  unformat_input_t * input, vlib_cli_command_t * cmd)
164 {
165  l2t_session_t *session;
166  l2t_main_t *lm = &l2t_main;
167  u32 session_index;
169  u32 nincr = 0;
170 
171  /* *INDENT-OFF* */
172  pool_foreach (session, lm->sessions,
173  ({
174  session_index = session - lm->sessions;
175  counter_index =
176  session_index_to_counter_index (session_index,
177  SESSION_COUNTER_USER_TO_NETWORK);
178  vlib_increment_combined_counter (&lm->counter_main,
179  counter_index,
180  1/*pkt*/, 1111 /*bytes*/);
181  vlib_increment_combined_counter (&lm->counter_main,
182  counter_index+1,
183  1/*pkt*/, 2222 /*bytes*/);
184  nincr++;
185  }));
186  /* *INDENT-ON* */
187  vlib_cli_output (vm, "Incremented %d active counters\n", nincr);
188 
189  return 0;
190 }
191 
192 /* *INDENT-OFF* */
193 static VLIB_CLI_COMMAND (test_counters_command) = {
194  .path = "test counters",
195  .short_help = "increment all active counters",
196  .function = test_counters_command_fn,
197 };
198 /* *INDENT-ON* */
199 
200 static clib_error_t *
202  unformat_input_t * input, vlib_cli_command_t * cmd)
203 {
204  l2t_session_t *session;
205  l2t_main_t *lm = &l2t_main;
206  u32 session_index;
208  u32 nincr = 0;
209 
210  /* *INDENT-OFF* */
211  pool_foreach (session, lm->sessions,
212  ({
213  session_index = session - lm->sessions;
214  counter_index =
215  session_index_to_counter_index (session_index,
216  SESSION_COUNTER_USER_TO_NETWORK);
217  vlib_zero_combined_counter (&lm->counter_main, counter_index);
218  vlib_zero_combined_counter (&lm->counter_main, counter_index+1);
219  nincr++;
220  }));
221  /* *INDENT-ON* */
222  vlib_cli_output (vm, "Cleared %d active counters\n", nincr);
223 
224  return 0;
225 }
226 
227 /* *INDENT-OFF* */
228 static VLIB_CLI_COMMAND (clear_counters_command) = {
229  .path = "clear counters",
230  .short_help = "clear all active counters",
231  .function = clear_counters_command_fn,
232 };
233 /* *INDENT-ON* */
234 
235 static clib_error_t *
237  unformat_input_t * input,
238  vlib_cli_command_t * cmd)
239 {
240  ip6_address_t client_address, our_address;
241  ip6_address_t *dst_address_copy, *src_address_copy;
242  unformat_input_t _line_input, *line_input = &_line_input;
243  u32 vlan_id;
244  u32 sw_if_index = (u32) ~ 0;
245  l2t_main_t *lm = &l2t_main;
246  l2t_session_t *s;
247  uword *p;
250  u32 next_index;
251  uword vlan_and_sw_if_index_key;
253  u64 local_cookie = (u64) ~ 0, remote_cookie = (u64) ~ 0;
254  u32 local_session_id = 1, remote_session_id = 1;
255  int our_address_set = 0, client_address_set = 0;
256  int l2_sublayer_present = 0;
257 
258  /* Get a line of input. */
259  if (!unformat_user (input, unformat_line_input, line_input))
260  return 0;
261 
262  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
263  {
264  if (unformat (line_input, "client %U",
265  unformat_ip6_address, &client_address))
266  client_address_set = 1;
267  else if (unformat (line_input, "our %U",
268  unformat_ip6_address, &our_address))
269  our_address_set = 1;
270  else if (unformat (line_input, "vlan %d", &vlan_id))
271  ;
272  else if (unformat (line_input, "l2-interface %U",
274  vnet_get_main (), &sw_if_index))
275  ;
276  else if (unformat (line_input, "interface %U",
278  vnet_get_main (), &sw_if_index))
279  ;
280  else if (unformat (line_input, "local-cookie %llx", &local_cookie))
281  ;
282  else if (unformat (line_input, "remote-cookie %llx", &remote_cookie))
283  ;
284  else if (unformat (line_input, "local-session-id %d",
285  &local_session_id))
286  ;
287  else if (unformat (line_input, "remote-session-id %d",
288  &remote_session_id))
289  ;
290  else if (unformat (line_input, "l2-sublayer-present"))
291  l2_sublayer_present = 1;
292  else
293  return clib_error_return (0, "parse error: '%U'",
294  format_unformat_error, line_input);
295  }
296 
297  unformat_free (line_input);
298 
299  if (sw_if_index == (u32) ~ 0)
300  return clib_error_return (0, "l2-interface not specified");
301  if (our_address_set == 0)
302  return clib_error_return (0, "our address not specified");
303  if (client_address_set == 0)
304  return clib_error_return (0, "client address not specified");
305 
306  remote_session_id = clib_host_to_net_u32 (remote_session_id);
307  local_session_id = clib_host_to_net_u32 (local_session_id);
308 
309  switch (lm->lookup_type)
310  {
312  p = hash_get_mem (lm->session_by_src_address, &client_address);
313  if (p)
314  return clib_error_return
315  (0, "Session w/ client address %U already exists",
316  format_ip6_address, &client_address);
317  break;
318 
320  p = hash_get_mem (lm->session_by_dst_address, &our_address);
321  if (p)
322  return clib_error_return
323  (0, "Session w/ our address %U already exists",
324  format_ip6_address, &our_address);
325  break;
326 
328  p = hash_get (lm->session_by_session_id, local_session_id);
329  if (p)
330  return clib_error_return
331  (0,
332  "Session w/ local session id %d already exists",
333  clib_net_to_host_u32 (local_session_id));
334  break;
335 
336  default:
337  ASSERT (0);
338  }
339 
340  pool_get (lm->sessions, s);
341  memset (s, 0, sizeof (*s));
342  clib_memcpy (&s->our_address, &our_address, sizeof (s->our_address));
343  clib_memcpy (&s->client_address, &client_address,
344  sizeof (s->client_address));
345  s->sw_if_index = sw_if_index;
346  s->vlan_id = clib_host_to_net_u16 (vlan_id);
347  s->local_cookie = clib_host_to_net_u64 (local_cookie);
348  l2tp_session_set_remote_cookie (s, remote_cookie);
349  s->local_session_id = local_session_id;
350  s->remote_session_id = remote_session_id;
351  s->l2_sublayer_present = l2_sublayer_present;
352 
353  hi = vnet_get_sup_hw_interface (lm->vnet_main, sw_if_index);
354  si = vnet_get_sup_sw_interface (lm->vnet_main, sw_if_index);
355 
356  next_index = vlib_node_add_next (vm, l2t_ip6_node.index,
357  hi->output_node_index);
358  s->l2_output_next_index = next_index;
359  s->l2_output_sw_if_index = si->sw_if_index;
360 
361  /* Setup hash table entries */
362  switch (lm->lookup_type)
363  {
365  src_address_copy = clib_mem_alloc (sizeof (*src_address_copy));
366  clib_memcpy (src_address_copy, &client_address,
367  sizeof (*src_address_copy));
368  hash_set_mem (lm->session_by_src_address, src_address_copy,
369  s - lm->sessions);
370  break;
372  dst_address_copy = clib_mem_alloc (sizeof (*dst_address_copy));
373  clib_memcpy (dst_address_copy, &our_address,
374  sizeof (*dst_address_copy));
375  hash_set_mem (lm->session_by_dst_address, dst_address_copy,
376  s - lm->sessions);
377  break;
379  hash_set (lm->session_by_session_id, local_session_id,
380  s - lm->sessions);
381  break;
382 
383  default:
384  ASSERT (0);
385  }
386 
387  vlan_and_sw_if_index_key = ((uword) (s->vlan_id) << 32) | sw_if_index;
388  hash_set (lm->session_by_vlan_and_rx_sw_if_index,
389  vlan_and_sw_if_index_key, s - lm->sessions);
390 
391  /* validate counters */
392  counter_index =
395  vlib_validate_counter (&lm->counter_main, counter_index);
396  vlib_validate_counter (&lm->counter_main, counter_index + 1);
397 
398  /* Set promiscuous mode on the l2 interface */
402  l2t_l2_node.index);
403  return 0;
404 }
405 
406 /* *INDENT-OFF* */
407 static VLIB_CLI_COMMAND (l2tp_session_add_command) = {
408  .path = "l2tp session add",
409  .short_help =
410  "l2tp session add client <ip6> our <ip6> vlan <id> local-cookie <hex> remote-cookie <hex> local-session <dec> remote-session <dec> l2-interface <int>",
411  .function = l2tp_session_add_command_fn,
412 };
413 /* *INDENT-ON* */
414 
415 static clib_error_t *
417  unformat_input_t * input,
418  vlib_cli_command_t * cmd)
419 {
420  l2t_main_t *lm = &l2t_main;
421  u32 session_index;
422  l2t_session_t *s;
423  hash_pair_t *hp;
424  void *key;
425  uword vlan_and_sw_if_index_key;
426 
427  if (!unformat (input, "%d", &session_index))
428  return clib_error_return (0, "missing session index: '%U'",
429  format_unformat_error, input);
430 
431  if (pool_is_free_index (lm->sessions, session_index))
432  return clib_error_return (0, "session %d not in use", session_index);
433 
434  s = pool_elt_at_index (lm->sessions, session_index);
435 
436  switch (lm->lookup_type)
437  {
440  if (hp)
441  {
442  key = (void *) (hp->key);
444  clib_mem_free (key);
445  }
446  else
447  clib_warning ("session %d src address key %U AWOL",
448  s - lm->sessions,
450  break;
451 
454  if (hp)
455  {
456  key = (void *) (hp->key);
458  clib_mem_free (key);
459  }
460  else
461  clib_warning ("session %d dst address key %U AWOL",
462  s - lm->sessions, format_ip6_address, &s->our_address);
463  break;
464 
467  break;
468 
469  default:
470  ASSERT (0);
471  }
472 
473  vlan_and_sw_if_index_key = ((uword) (s->vlan_id) << 32) | s->sw_if_index;
474 
475  hash_unset (lm->session_by_vlan_and_rx_sw_if_index,
476  vlan_and_sw_if_index_key);
477 
478  pool_put (lm->sessions, s);
479  return 0;
480 }
481 
482 /* *INDENT-OFF* */
483 static VLIB_CLI_COMMAND (l2tp_session_del_command) = {
484  .path = "l2tp session delete",
485  .short_help =
486  "l2tp session delete <session-id>",
487  .function = l2tp_session_del_command_fn,
488 };
489 /* *INDENT-ON* */
490 
491 static clib_error_t *
493  unformat_input_t * input,
494  vlib_cli_command_t * cmd)
495 {
496  l2t_main_t *lm = &l2t_main;
497  u32 session_index;
498  l2t_session_t *s;
499  u64 lcl_ro_cookie = (u64) ~ 0, rem_ro_cookie = (u64) ~ 0;
500  u8 cookie_flags = 0;
501 
502  if (!unformat (input, "%d", &session_index))
503  return clib_error_return (0, "missing session index: '%U'",
504  format_unformat_error, input);
505 
506  if (pool_is_free_index (lm->sessions, session_index))
507  return clib_error_return (0, "session %d not in use", session_index);
508 
509  s = pool_elt_at_index (lm->sessions, session_index);
510 
511  if (unformat (input, "commit"))
512  {
513  if (!s->cookie_flags)
514  {
515  return clib_error_return (0, "no rollover cookie ready to commit");
516  }
517  else
518  {
519  l2tp_session_cookie_commit (s);
520  return 0;
521  }
522  }
523  if (!unformat (input, "rollover"))
524  return clib_error_return (0, "missing 'commit|rollover': '%U'",
525  format_unformat_error, input);
526  if (unformat (input, "local %llx", &lcl_ro_cookie))
527  {
528  cookie_flags |= L2TP_COOKIE_ROLLOVER_LOCAL;
529  l2tp_session_set_local_rollover_cookie (s, lcl_ro_cookie);
530  }
531  if (unformat (input, "remote %llx", &rem_ro_cookie))
532  {
533  cookie_flags |= L2TP_COOKIE_ROLLOVER_REMOTE;
534  l2tp_session_set_remote_cookie (s, rem_ro_cookie);
535  }
536  if (!cookie_flags)
537  return clib_error_return (0, "no rollover cookie specified");
538 
539  return 0;
540 }
541 
542 /* *INDENT-OFF* */
543 static VLIB_CLI_COMMAND (l2tp_session_cookie_command) = {
544  .path = "l2tp session cookie",
545  .short_help =
546  "l2tp session cookie <session id> commit|rollover [local <hex>] [remote <hex>]",
547  .function = l2tp_session_cookie_command_fn,
548 };
549 /* *INDENT-ON* */
550 
551 /*
552  * fd.io coding-style-patch-verification: ON
553  *
554  * Local Variables:
555  * eval: (c-set-style "gnu")
556  * End:
557  */
int is_user_to_network
Definition: l2tp.h:88
u8 cookie_flags
Definition: l2tp.h:46
u64 local_cookie[2]
Definition: l2tp.h:32
vmrglw vmrglh hi
u64 packets
packet counter
Definition: counter.h:166
#define hash_set(h, key, value)
Definition: hash.h:254
ip6_address_t client_address
Definition: l2tp.h:91
#define CLIB_UNUSED(x)
Definition: clib.h:79
static clib_error_t * clear_counters_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:201
uword unformat(unformat_input_t *i, char *fmt,...)
Definition: unformat.c:966
#define hash_unset(h, key)
Definition: hash.h:260
format_function_t format_ip6_address
Definition: format.h:95
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
ethernet_main_t * ethernet_get_main(vlib_main_t *vm)
Definition: init.c:116
int vnet_hw_interface_rx_redirect_to_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
Definition: interface.c:1100
uword * session_by_session_id
Definition: l2tp.h:66
#define UNFORMAT_END_OF_INPUT
Definition: format.h:143
static clib_error_t * l2tp_session_add_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:236
ip6_address_t our_address
Definition: l2tp.h:28
static clib_error_t * l2tp_session_cookie_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:492
static clib_error_t * show_session_summary_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:116
Combined counter to hold both packets and byte differences.
Definition: counter.h:164
#define hash_set_mem(h, key, value)
Definition: hash.h:274
#define hash_get_pair_mem(h, key)
Definition: hash.h:271
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:200
u64 remote_cookie
Definition: l2tp.h:33
static u32 session_index_to_counter_index(u32 session_index, u32 counter_id)
Definition: l2tp.h:106
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
Definition: node_funcs.h:1063
ip6_address_t client_address
Definition: l2tp.h:29
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:348
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * show_session_detail_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:136
static void unformat_free(unformat_input_t *i)
Definition: format.h:161
#define clib_warning(format, args...)
Definition: error.h:59
unsigned long u64
Definition: types.h:89
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:977
vlib_node_registration_t l2t_l2_node
(constructor) VLIB_REGISTER_NODE (l2t_l2_node)
Definition: l2t_l2.c:62
void get_interface_ethernet_address(l2t_main_t *lm, u8 *dst, u32 sw_if_index)
Definition: l2t.c:37
#define hash_get(h, key)
Definition: hash.h:248
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:369
#define hash_unset_mem(h, key)
Definition: hash.h:280
static clib_error_t * l2tp_session_del_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:416
u32 local_session_id
Definition: l2tp.h:34
#define v
Definition: acl.c:314
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:214
static void vlib_get_combined_counter(vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of mini co...
Definition: counter.h:287
u8 * format_l2t_session(u8 *s, va_list *args)
Definition: l2t.c:68
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:576
ip6_to_l2_lookup_t lookup_type
Definition: l2tp.h:68
unformat_function_t unformat_ip6_address
Definition: format.h:94
ip6_address_t our_address
Definition: l2tp.h:90
u64 bytes
byte counter
Definition: counter.h:167
u8 * format_l2t_trace(u8 *s, va_list *args)
Definition: l2t.c:50
#define clib_memcpy(a, b, c)
Definition: string.h:69
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
Definition: ethernet.h:113
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:211
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
#define ASSERT(truth)
vlib_main_t * vlib_main
Definition: l2tp.h:80
u32 remote_session_id
Definition: l2tp.h:35
unsigned int u32
Definition: types.h:88
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
static void clib_mem_free(void *p)
Definition: mem.h:176
vnet_main_t * vnet_main
Definition: l2tp.h:81
uword * session_by_dst_address
Definition: l2tp.h:65
static void * clib_mem_alloc(uword size)
Definition: mem.h:109
vlib_combined_counter_main_t counter_main
Definition: l2tp.h:71
u64 uword
Definition: types.h:112
unsigned char u8
Definition: types.h:56
l2t_session_t * sessions
Definition: l2tp.h:61
#define hash_get_mem(h, key)
Definition: hash.h:268
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:169
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:418
#define clib_error_return(e, args...)
Definition: error.h:111
struct _unformat_input_t unformat_input_t
uword * session_by_src_address
Definition: l2tp.h:64
u8 l2_sublayer_present
Definition: l2tp.h:45
static clib_error_t * test_counters_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: l2t.c:162
l2t_main_t l2t_main
Definition: l2t.c:29
ethernet_interface_t * interfaces
Definition: ethernet.h:243
u32 sw_if_index
Definition: l2tp.h:39
unformat_function_t unformat_line_input
Definition: format.h:281
uword key
Definition: hash.h:161
u32 session_index
Definition: l2tp.h:89
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Definition: interface.c:319
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:109