FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
one_cli.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 <vnet/lisp-cp/control.h>
17 #include <vnet/lisp-gpe/lisp_gpe.h>
18 
19 static clib_error_t *
21  unformat_input_t * input,
22  vlib_cli_command_t * cmd)
23 {
24  lisp_adjacency_t *adjs, *adj;
25  vlib_cli_output (vm, "%s %40s\n", "leid", "reid");
26  unformat_input_t _line_input, *line_input = &_line_input;
27  u32 vni = ~0;
28 
29  /* Get a line of input. */
30  if (!unformat_user (input, unformat_line_input, line_input))
31  return 0;
32 
33  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
34  {
35  if (unformat (line_input, "vni %d", &vni))
36  ;
37  else
38  {
39  vlib_cli_output (vm, "parse error: '%U'",
40  format_unformat_error, line_input);
41  unformat_free (line_input);
42  return 0;
43  }
44  }
45  unformat_free (line_input);
46 
47  if (~0 == vni)
48  {
49  vlib_cli_output (vm, "error: no vni specified!");
50  return 0;
51  }
52 
54 
55  vec_foreach (adj, adjs)
56  {
57  vlib_cli_output (vm, "%U %40U\n", format_gid_address, &adj->leid,
58  format_gid_address, &adj->reid);
59  }
60  vec_free (adjs);
61 
62  return 0;
63 }
64 
65 /* *INDENT-OFF* */
66 VLIB_CLI_COMMAND (one_show_adjacencies_command) = {
67  .path = "show one adjacencies",
68  .short_help = "show one adjacencies",
70 };
71 /* *INDENT-ON* */
72 
73 static clib_error_t *
75  unformat_input_t * input,
76  vlib_cli_command_t * cmd)
77 {
78  int rv = 0;
79  u8 is_add = 1, ip_set = 0;
80  ip_address_t ip;
81  unformat_input_t _line_input, *line_input = &_line_input;
82 
83  /* Get a line of input. */
84  if (!unformat_user (input, unformat_line_input, line_input))
85  return 0;
86 
87  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
88  {
89  if (unformat (line_input, "add"))
90  is_add = 1;
91  else if (unformat (line_input, "del"))
92  is_add = 0;
93  else if (unformat (line_input, "%U", unformat_ip_address, &ip))
94  ip_set = 1;
95  else
96  {
97  vlib_cli_output (vm, "parse error: '%U'",
98  format_unformat_error, line_input);
99  unformat_free (line_input);
100  return 0;
101  }
102  }
103  unformat_free (line_input);
104 
105  if (!ip_set)
106  {
107  vlib_cli_output (vm, "map-server ip address not set!");
108  return 0;
109  }
110 
111  rv = vnet_lisp_add_del_map_server (&ip, is_add);
112  if (!rv)
113  vlib_cli_output (vm, "failed to %s map-server!",
114  is_add ? "add" : "delete");
115 
116  return 0;
117 }
118 
119 /* *INDENT-OFF* */
120 VLIB_CLI_COMMAND (one_add_del_map_server_command) = {
121  .path = "one map-server",
122  .short_help = "one map-server add|del <ip>",
124 };
125 /* *INDENT-ON* */
126 
127 
128 static clib_error_t *
130  vlib_cli_command_t * cmd)
131 {
133  unformat_input_t _line_input, *line_input = &_line_input;
134  u8 is_add = 1;
135  gid_address_t eid;
136  gid_address_t *eids = 0;
137  clib_error_t *error = 0;
138  u8 *locator_set_name = 0;
139  u32 locator_set_index = 0, map_index = 0;
140  uword *p;
142  int rv = 0;
143  u32 vni = 0;
144  u8 *key = 0;
145  u32 key_id = 0;
146 
147  memset (&eid, 0, sizeof (eid));
148  memset (a, 0, sizeof (*a));
149 
150  /* Get a line of input. */
151  if (!unformat_user (input, unformat_line_input, line_input))
152  return 0;
153 
154  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
155  {
156  if (unformat (line_input, "add"))
157  is_add = 1;
158  else if (unformat (line_input, "del"))
159  is_add = 0;
160  else if (unformat (line_input, "eid %U", unformat_gid_address, &eid))
161  ;
162  else if (unformat (line_input, "vni %d", &vni))
163  gid_address_vni (&eid) = vni;
164  else if (unformat (line_input, "secret-key %_%v%_", &key))
165  ;
166  else if (unformat (line_input, "key-id %U", unformat_hmac_key_id,
167  &key_id))
168  ;
169  else if (unformat (line_input, "locator-set %_%v%_", &locator_set_name))
170  {
171  p = hash_get_mem (lcm->locator_set_index_by_name, locator_set_name);
172  if (!p)
173  {
174  error = clib_error_return (0, "locator-set %s doesn't exist",
175  locator_set_name);
176  goto done;
177  }
178  locator_set_index = p[0];
179  }
180  else
181  {
182  error = unformat_parse_error (line_input);
183  goto done;
184  }
185  }
186  /* XXX treat batch configuration */
187 
188  if (GID_ADDR_SRC_DST == gid_address_type (&eid))
189  {
190  error =
191  clib_error_return (0, "src/dst is not supported for local EIDs!");
192  goto done;
193  }
194 
195  if (key && (0 == key_id))
196  {
197  vlib_cli_output (vm, "invalid key_id!");
198  goto done;
199  }
200 
201  gid_address_copy (&a->eid, &eid);
202  a->is_add = is_add;
203  a->locator_set_index = locator_set_index;
204  a->local = 1;
205  a->key = key;
206  a->key_id = key_id;
207 
208  rv = vnet_lisp_add_del_local_mapping (a, &map_index);
209  if (0 != rv)
210  {
211  error = clib_error_return (0, "failed to %s local mapping!",
212  is_add ? "add" : "delete");
213  }
214 done:
215  vec_free (eids);
216  if (locator_set_name)
217  vec_free (locator_set_name);
218  gid_address_free (&a->eid);
219  vec_free (a->key);
220  unformat_free (line_input);
221  return error;
222 }
223 
224 /* *INDENT-OFF* */
225 VLIB_CLI_COMMAND (one_add_del_local_eid_command) = {
226  .path = "one eid-table",
227  .short_help = "one eid-table add/del [vni <vni>] eid <eid> "
228  "locator-set <locator-set> [key <secret-key> key-id sha1|sha256 ]",
230 };
231 /* *INDENT-ON* */
232 
233 static clib_error_t *
235  unformat_input_t * input,
236  vlib_cli_command_t * cmd)
237 {
238  u8 is_add = 1, is_l2 = 0;
239  u32 vni = 0, dp_id = 0;
240  unformat_input_t _line_input, *line_input = &_line_input;
241  clib_error_t *error = NULL;
242 
243  /* Get a line of input. */
244  if (!unformat_user (input, unformat_line_input, line_input))
245  return 0;
246 
247  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
248  {
249  if (unformat (line_input, "del"))
250  is_add = 0;
251  else if (unformat (line_input, "vni %d", &vni))
252  ;
253  else if (unformat (line_input, "vrf %d", &dp_id))
254  ;
255  else if (unformat (line_input, "bd %d", &dp_id))
256  is_l2 = 1;
257  else
258  {
259  error = unformat_parse_error (line_input);
260  goto done;
261  }
262  }
263  vnet_lisp_eid_table_map (vni, dp_id, is_l2, is_add);
264 
265 done:
266  unformat_free (line_input);
267 
268  return error;
269 }
270 
271 /* *INDENT-OFF* */
272 VLIB_CLI_COMMAND (one_eid_table_map_command) = {
273  .path = "one eid-table map",
274  .short_help = "one eid-table map [del] vni <vni> vrf <vrf> | bd <bdi>",
275  .function = lisp_eid_table_map_command_fn,
276 };
277 /* *INDENT-ON* */
278 
279 static clib_error_t *
281  unformat_input_t * input,
282  vlib_cli_command_t * cmd)
283 {
284  unformat_input_t _line_input, *line_input = &_line_input;
285  clib_error_t *error = NULL;
286  int rc = 0;
287  u8 hw_addr[6], bd = 0;
288  ip4_address_t ip4;
289  u32 hw_addr_set = 0, ip_set = 0, is_add = 1;
290  gid_address_t _arp, *arp = &_arp;
291 
292  memset (&ip4, 0, sizeof (ip4));
293  memset (hw_addr, 0, sizeof (hw_addr));
294  memset (arp, 0, sizeof (*arp));
295 
296  if (!unformat_user (input, unformat_line_input, line_input))
297  return 0;
298 
299  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
300  {
301  if (unformat (line_input, "mac %U", unformat_mac_address, hw_addr))
302  hw_addr_set = 1;
303  else if (unformat (line_input, "ip %U", unformat_ip4_address, &ip4))
304  ip_set = 1;
305  else if (unformat (line_input, "del"))
306  is_add = 0;
307  else if (unformat (line_input, "bd %d", &bd))
308  ;
309  else
310  {
311  error = clib_error_return (0, "parse error");
312  goto done;
313  }
314  }
315 
316  if (!ip_set || (!hw_addr_set && is_add))
317  {
318  vlib_cli_output (vm, "expected IP and MAC addresses!");
319  return 0;
320  }
321 
322  /* build GID address */
323  gid_address_arp_ip4 (arp) = ip4;
324  gid_address_arp_bd (arp) = bd;
326  rc = vnet_lisp_add_del_l2_arp_entry (arp, hw_addr, is_add);
327  if (rc)
328  clib_warning ("Failed to %s l2 arp entry!", is_add ? "add" : "delete");
329 
330 done:
331  unformat_free (line_input);
332  return error;
333 }
334 
335 /* *INDENT-OFF* */
336 VLIB_CLI_COMMAND (one_add_del_l2_arp_entry_command) = {
337  .path = "one l2 arp",
338  .short_help = "one l2 arp [del] bd <bd> mac <mac> ip <ipv4>",
340 };
341 /* *INDENT-ON* */
342 
343 static clib_error_t *
345  unformat_input_t * input,
346  vlib_cli_command_t * cmd)
347 {
348  u32 *ht = vnet_lisp_l2_arp_bds_get ();
349  lisp_api_l2_arp_entry_t *entries, *e;
350  hash_pair_t *p;
351 
352  /* *INDENT-OFF* */
353  hash_foreach_pair (p, ht,
354  ({
356  vlib_cli_output (vm, "Table: %d", p->key);
357 
358  vec_foreach (e, entries)
359  {
360  vlib_cli_output (vm, "\t%U -> %U", format_ip4_address, &e->ip4,
361  format_mac_address, e->mac);
362  }
363  vec_free (entries);
364  }));
365  /* *INDENT-ON* */
366 
367  hash_free (ht);
368  return 0;
369 }
370 
371 /* *INDENT-OFF* */
372 VLIB_CLI_COMMAND (one_show_l2_arp_entries_command) = {
373  .path = "show one l2 arp entries",
374  .short_help = "Show ONE L2 ARP entries",
376 };
377 /* *INDENT-ON* */
378 
379 /**
380  * Handler for add/del remote mapping CLI.
381  *
382  * @param vm vlib context
383  * @param input input from user
384  * @param cmd cmd
385  * @return pointer to clib error structure
386  */
387 static clib_error_t *
389  unformat_input_t * input,
390  vlib_cli_command_t * cmd)
391 {
392  clib_error_t *error = 0;
393  unformat_input_t _line_input, *line_input = &_line_input;
394  u8 is_add = 1, del_all = 0;
395  locator_t rloc, *rlocs = 0, *curr_rloc = 0;
396  gid_address_t eid;
397  u8 eid_set = 0;
398  u32 vni, action = ~0, p, w;
399  int rv;
400 
401  /* Get a line of input. */
402  if (!unformat_user (input, unformat_line_input, line_input))
403  return 0;
404 
405  memset (&eid, 0, sizeof (eid));
406  memset (&rloc, 0, sizeof (rloc));
407 
408  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
409  {
410  if (unformat (line_input, "del-all"))
411  del_all = 1;
412  else if (unformat (line_input, "del"))
413  is_add = 0;
414  else if (unformat (line_input, "add"))
415  ;
416  else if (unformat (line_input, "eid %U", unformat_gid_address, &eid))
417  eid_set = 1;
418  else if (unformat (line_input, "vni %u", &vni))
419  {
420  gid_address_vni (&eid) = vni;
421  }
422  else if (unformat (line_input, "p %d w %d", &p, &w))
423  {
424  if (!curr_rloc)
425  {
427  ("No RLOC configured for setting priority/weight!");
428  goto done;
429  }
430  curr_rloc->priority = p;
431  curr_rloc->weight = w;
432  }
433  else if (unformat (line_input, "rloc %U", unformat_ip_address,
434  &gid_address_ip (&rloc.address)))
435  {
436  /* since rloc is stored in ip prefix we need to set prefix length */
437  ip_prefix_t *pref = &gid_address_ippref (&rloc.address);
438 
439  u8 version = gid_address_ip_version (&rloc.address);
440  ip_prefix_len (pref) = ip_address_max_len (version);
441 
442  vec_add1 (rlocs, rloc);
443  curr_rloc = &rlocs[vec_len (rlocs) - 1];
444  }
445  else if (unformat (line_input, "action %U",
447  ;
448  else
449  {
450  clib_warning ("parse error");
451  goto done;
452  }
453  }
454 
455  if (!del_all && !eid_set)
456  {
457  clib_warning ("missing eid!");
458  goto done;
459  }
460 
461  if (!del_all)
462  {
463  if (is_add && (~0 == action) && 0 == vec_len (rlocs))
464  {
465  clib_warning ("no action set for negative map-reply!");
466  goto done;
467  }
468  }
469  else
470  {
472  goto done;
473  }
474 
475  /* if it's a delete, clean forwarding */
476  if (!is_add)
477  {
479  memset (a, 0, sizeof (a[0]));
480  gid_address_copy (&a->reid, &eid);
482  {
483  clib_warning ("failed to delete adjacency!");
484  goto done;
485  }
486  }
487 
488  /* add as static remote mapping, i.e., not authoritative and infinite
489  * ttl */
490  rv = vnet_lisp_add_del_mapping (&eid, rlocs, action, 0, ~0, is_add,
491  1 /* is_static */ , 0);
492 
493  if (rv)
494  clib_warning ("failed to %s remote mapping!", is_add ? "add" : "delete");
495 
496 done:
497  vec_free (rlocs);
498  unformat_free (line_input);
499  return error;
500 }
501 
502 /* *INDENT-OFF* */
503 VLIB_CLI_COMMAND (one_add_del_remote_mapping_command) = {
504  .path = "one remote-mapping",
505  .short_help =
506  "one remote-mapping add|del [del-all] vni <vni> "
507  "eid <est-eid> [action <no-action|natively-forward|"
508  "send-map-request|drop>] rloc <dst-locator> p <prio> w <weight> "
509  "[rloc <dst-locator> ... ]",
511 };
512 /* *INDENT-ON* */
513 
514 /**
515  * Handler for add/del adjacency CLI.
516  */
517 static clib_error_t *
519  vlib_cli_command_t * cmd)
520 {
521  clib_error_t *error = 0;
522  unformat_input_t _line_input, *line_input = &_line_input;
524  u8 is_add = 1;
525  ip_prefix_t *reid_ippref, *leid_ippref;
526  gid_address_t leid, reid;
527  u8 *dmac = gid_address_mac (&reid);
528  u8 *smac = gid_address_mac (&leid);
529  u8 reid_set = 0, leid_set = 0;
530  u32 vni;
531 
532  /* Get a line of input. */
533  if (!unformat_user (input, unformat_line_input, line_input))
534  return 0;
535 
536  memset (&reid, 0, sizeof (reid));
537  memset (&leid, 0, sizeof (leid));
538 
539  leid_ippref = &gid_address_ippref (&leid);
540  reid_ippref = &gid_address_ippref (&reid);
541 
542  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
543  {
544  if (unformat (line_input, "del"))
545  is_add = 0;
546  else if (unformat (line_input, "add"))
547  ;
548  else if (unformat (line_input, "reid %U",
549  unformat_ip_prefix, reid_ippref))
550  {
552  reid_set = 1;
553  }
554  else if (unformat (line_input, "reid %U", unformat_mac_address, dmac))
555  {
556  gid_address_type (&reid) = GID_ADDR_MAC;
557  reid_set = 1;
558  }
559  else if (unformat (line_input, "vni %u", &vni))
560  {
561  gid_address_vni (&leid) = vni;
562  gid_address_vni (&reid) = vni;
563  }
564  else if (unformat (line_input, "leid %U",
565  unformat_ip_prefix, leid_ippref))
566  {
568  leid_set = 1;
569  }
570  else if (unformat (line_input, "leid %U", unformat_mac_address, smac))
571  {
572  gid_address_type (&leid) = GID_ADDR_MAC;
573  leid_set = 1;
574  }
575  else
576  {
577  clib_warning ("parse error");
578  goto done;
579  }
580  }
581 
582  if (!reid_set || !leid_set)
583  {
584  clib_warning ("missing remote or local eid!");
585  goto done;
586  }
587 
588  if ((gid_address_type (&leid) != gid_address_type (&reid))
589  || (gid_address_type (&reid) == GID_ADDR_IP_PREFIX
590  && ip_prefix_version (reid_ippref)
591  != ip_prefix_version (leid_ippref)))
592  {
593  clib_warning ("remote and local EIDs are of different types!");
594  goto done;
595  }
596 
597  memset (a, 0, sizeof (a[0]));
598  gid_address_copy (&a->leid, &leid);
599  gid_address_copy (&a->reid, &reid);
600  a->is_add = is_add;
601 
603  clib_warning ("failed to %s adjacency!", is_add ? "add" : "delete");
604 
605 done:
606  unformat_free (line_input);
607  return error;
608 }
609 
610 /* *INDENT-OFF* */
611 VLIB_CLI_COMMAND (one_add_del_adjacency_command) = {
612  .path = "one adjacency",
613  .short_help = "one adjacency add|del vni <vni> reid <remote-eid> "
614  "leid <local-eid>",
616 };
617 /* *INDENT-ON* */
618 
619 
620 static clib_error_t *
622  unformat_input_t * input,
623  vlib_cli_command_t * cmd)
624 {
625  unformat_input_t _i, *i = &_i;
626  map_request_mode_t mr_mode = _MR_MODE_MAX;
627 
628  /* Get a line of input. */
629  if (!unformat_user (input, unformat_line_input, i))
630  return 0;
631 
633  {
634  if (unformat (i, "dst-only"))
635  mr_mode = MR_MODE_DST_ONLY;
636  else if (unformat (i, "src-dst"))
637  mr_mode = MR_MODE_SRC_DST;
638  else
639  {
640  clib_warning ("parse error '%U'", format_unformat_error, i);
641  goto done;
642  }
643  }
644 
645  if (_MR_MODE_MAX == mr_mode)
646  {
647  clib_warning ("No map request mode entered!");
648  goto done;
649  }
650 
652 
653 done:
654  unformat_free (i);
655 
656  return 0;
657 }
658 
659 /* *INDENT-OFF* */
660 VLIB_CLI_COMMAND (one_map_request_mode_command) = {
661  .path = "one map-request mode",
662  .short_help = "one map-request mode dst-only|src-dst",
664 };
665 /* *INDENT-ON* */
666 
667 
668 static u8 *
669 format_lisp_map_request_mode (u8 * s, va_list * args)
670 {
671  u32 mode = va_arg (*args, u32);
672 
673  switch (mode)
674  {
675  case 0:
676  return format (0, "dst-only");
677  case 1:
678  return format (0, "src-dst");
679  }
680  return 0;
681 }
682 
683 static clib_error_t *
685  unformat_input_t * input,
686  vlib_cli_command_t * cmd)
687 {
688  vlib_cli_output (vm, "map-request mode: %U", format_lisp_map_request_mode,
690  return 0;
691 }
692 
693 /* *INDENT-OFF* */
694 VLIB_CLI_COMMAND (one_show_map_request_mode_command) = {
695  .path = "show one map-request mode",
696  .short_help = "show one map-request mode",
698 };
699 /* *INDENT-ON* */
700 
701 static clib_error_t *
703  unformat_input_t * input,
704  vlib_cli_command_t * cmd)
705 {
706  lisp_msmr_t *mr;
708 
709  vec_foreach (mr, lcm->map_resolvers)
710  {
711  vlib_cli_output (vm, "%U", format_ip_address, &mr->address);
712  }
713  return 0;
714 }
715 
716 /* *INDENT-OFF* */
717 VLIB_CLI_COMMAND (one_show_map_resolvers_command) = {
718  .path = "show one map-resolvers",
719  .short_help = "show one map-resolvers",
721 };
722 /* *INDENT-ON* */
723 
724 static clib_error_t *
726  unformat_input_t * input,
727  vlib_cli_command_t * cmd)
728 {
729  u8 locator_name_set = 0;
730  u8 *locator_set_name = 0;
731  u8 is_add = 1;
732  unformat_input_t _line_input, *line_input = &_line_input;
733  clib_error_t *error = 0;
734  int rv = 0;
735 
736  /* Get a line of input. */
737  if (!unformat_user (input, unformat_line_input, line_input))
738  return 0;
739 
740  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
741  {
742  if (unformat (line_input, "ls %_%v%_", &locator_set_name))
743  locator_name_set = 1;
744  else if (unformat (line_input, "disable"))
745  is_add = 0;
746  else
747  {
748  error = clib_error_return (0, "parse error");
749  goto done;
750  }
751  }
752 
753  if (!locator_name_set)
754  {
755  clib_warning ("No locator set specified!");
756  goto done;
757  }
758 
759  rv = vnet_lisp_nsh_set_locator_set (locator_set_name, is_add);
760  if (0 != rv)
761  {
762  error = clib_error_return (0, "failed to %s NSH mapping!",
763  is_add ? "add" : "delete");
764  }
765 
766 done:
767  vec_free (locator_set_name);
768  unformat_free (line_input);
769  return error;
770 }
771 
772 /* *INDENT-OFF* */
773 VLIB_CLI_COMMAND (one_nsh_set_locator_set_command) = {
774  .path = "one nsh-mapping",
775  .short_help = "one nsh-mapping [del] ls <locator-set-name>",
777 };
778 /* *INDENT-ON* */
779 
780 
781 static clib_error_t *
783  unformat_input_t * input,
784  vlib_cli_command_t * cmd)
785 {
786  u8 locator_name_set = 0;
787  u8 *locator_set_name = 0;
788  u8 is_add = 1;
789  unformat_input_t _line_input, *line_input = &_line_input;
790  clib_error_t *error = 0;
791  int rv = 0;
792 
793  /* Get a line of input. */
794  if (!unformat_user (input, unformat_line_input, line_input))
795  return 0;
796 
797  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
798  {
799  if (unformat (line_input, "ls %_%v%_", &locator_set_name))
800  locator_name_set = 1;
801  else if (unformat (line_input, "disable"))
802  is_add = 0;
803  else
804  {
805  error = clib_error_return (0, "parse error");
806  goto done;
807  }
808  }
809 
810  if (!locator_name_set)
811  {
812  clib_warning ("No locator set specified!");
813  goto done;
814  }
815  rv = vnet_lisp_pitr_set_locator_set (locator_set_name, is_add);
816  if (0 != rv)
817  {
818  error = clib_error_return (0, "failed to %s pitr!",
819  is_add ? "add" : "delete");
820  }
821 
822 done:
823  if (locator_set_name)
824  vec_free (locator_set_name);
825  unformat_free (line_input);
826  return error;
827 }
828 
829 /* *INDENT-OFF* */
830 VLIB_CLI_COMMAND (one_pitr_set_locator_set_command) = {
831  .path = "one pitr",
832  .short_help = "one pitr [disable] ls <locator-set-name>",
834 };
835 /* *INDENT-ON* */
836 
837 static clib_error_t *
839  unformat_input_t * input, vlib_cli_command_t * cmd)
840 {
842  mapping_t *m;
843  locator_set_t *ls;
844  u8 *tmp_str = 0;
845 
846  vlib_cli_output (vm, "%=20s%=16s",
847  "pitr", lcm->lisp_pitr ? "locator-set" : "");
848 
849  if (!lcm->lisp_pitr)
850  {
851  vlib_cli_output (vm, "%=20s", "disable");
852  return 0;
853  }
854 
855  if (~0 == lcm->pitr_map_index)
856  {
857  tmp_str = format (0, "N/A");
858  }
859  else
860  {
862  if (~0 != m->locator_set_index)
863  {
864  ls =
866  tmp_str = format (0, "%s", ls->name);
867  }
868  else
869  {
870  tmp_str = format (0, "N/A");
871  }
872  }
873  vec_add1 (tmp_str, 0);
874 
875  vlib_cli_output (vm, "%=20s%=16s", "enable", tmp_str);
876 
877  vec_free (tmp_str);
878 
879  return 0;
880 }
881 
882 /* *INDENT-OFF* */
883 VLIB_CLI_COMMAND (one_show_pitr_command) = {
884  .path = "show one pitr",
885  .short_help = "Show pitr",
886  .function = lisp_show_pitr_command_fn,
887 };
888 /* *INDENT-ON* */
889 
890 static u8 *
891 format_eid_entry (u8 * s, va_list * args)
892 {
893  vnet_main_t *vnm = va_arg (*args, vnet_main_t *);
894  lisp_cp_main_t *lcm = va_arg (*args, lisp_cp_main_t *);
895  mapping_t *mapit = va_arg (*args, mapping_t *);
896  locator_set_t *ls = va_arg (*args, locator_set_t *);
897  gid_address_t *gid = &mapit->eid;
898  u32 ttl = mapit->ttl;
899  u8 aut = mapit->authoritative;
900  u32 *loc_index;
901  u8 first_line = 1;
902  u8 *loc;
903 
904  u8 *type = ls->local ? format (0, "local(%s)", ls->name)
905  : format (0, "remote");
906 
907  if (vec_len (ls->locator_indices) == 0)
908  {
909  s = format (s, "%-35U%-20saction:%-30U%-20u%-u", format_gid_address,
910  gid, type, format_negative_mapping_action, mapit->action,
911  ttl, aut);
912  }
913  else
914  {
915  vec_foreach (loc_index, ls->locator_indices)
916  {
917  locator_t *l = pool_elt_at_index (lcm->locator_pool, loc_index[0]);
918  if (l->local)
919  loc = format (0, "%U", format_vnet_sw_if_index_name, vnm,
920  l->sw_if_index);
921  else
922  loc = format (0, "%U", format_ip_address,
923  &gid_address_ip (&l->address));
924 
925  if (first_line)
926  {
927  s = format (s, "%-35U%-20s%-30v%-20u%-u\n", format_gid_address,
928  gid, type, loc, ttl, aut);
929  first_line = 0;
930  }
931  else
932  s = format (s, "%55s%v\n", "", loc);
933  }
934  }
935  return s;
936 }
937 
938 static clib_error_t *
940  unformat_input_t * input,
941  vlib_cli_command_t * cmd)
942 {
944  mapping_t *mapit;
945  unformat_input_t _line_input, *line_input = &_line_input;
946  u32 mi;
947  gid_address_t eid;
948  u8 print_all = 1;
949  u8 filter = 0;
950  clib_error_t *error = NULL;
951 
952  memset (&eid, 0, sizeof (eid));
953 
954  /* Get a line of input. */
955  if (!unformat_user (input, unformat_line_input, line_input))
956  return 0;
957 
958  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
959  {
960  if (unformat (line_input, "eid %U", unformat_gid_address, &eid))
961  print_all = 0;
962  else if (unformat (line_input, "local"))
963  filter = 1;
964  else if (unformat (line_input, "remote"))
965  filter = 2;
966  else
967  {
968  error = clib_error_return (0, "parse error: '%U'",
969  format_unformat_error, line_input);
970  goto done;
971  }
972  }
973 
974  vlib_cli_output (vm, "%-35s%-20s%-30s%-20s%-s",
975  "EID", "type", "locators", "ttl", "autoritative");
976 
977  if (print_all)
978  {
979  /* *INDENT-OFF* */
980  pool_foreach (mapit, lcm->mapping_pool,
981  ({
982  if (mapit->pitr_set || mapit->nsh_set)
983  continue;
984 
985  locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool,
986  mapit->locator_set_index);
987  if (filter && !((1 == filter && ls->local) ||
988  (2 == filter && !ls->local)))
989  {
990  continue;
991  }
992  vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main,
993  lcm, mapit, ls);
994  }));
995  /* *INDENT-ON* */
996  }
997  else
998  {
999  mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &eid);
1000  if ((u32) ~ 0 == mi)
1001  goto done;
1002 
1003  mapit = pool_elt_at_index (lcm->mapping_pool, mi);
1004  locator_set_t *ls = pool_elt_at_index (lcm->locator_set_pool,
1005  mapit->locator_set_index);
1006 
1007  if (filter && !((1 == filter && ls->local) ||
1008  (2 == filter && !ls->local)))
1009  {
1010  goto done;
1011  }
1012 
1013  vlib_cli_output (vm, "%U,", format_eid_entry, lcm->vnet_main,
1014  lcm, mapit, ls);
1015  }
1016 
1017 done:
1018  unformat_free (line_input);
1019 
1020  return error;
1021 }
1022 
1023 /* *INDENT-OFF* */
1024 VLIB_CLI_COMMAND (one_cp_show_eid_table_command) = {
1025  .path = "show one eid-table",
1026  .short_help = "Shows EID table",
1027  .function = lisp_show_eid_table_command_fn,
1028 };
1029 /* *INDENT-ON* */
1030 
1031 
1032 static clib_error_t *
1034  vlib_cli_command_t * cmd)
1035 {
1036  unformat_input_t _line_input, *line_input = &_line_input;
1037  u8 is_enabled = 0;
1038  u8 is_set = 0;
1039  clib_error_t *error = NULL;
1040 
1041  /* Get a line of input. */
1042  if (!unformat_user (input, unformat_line_input, line_input))
1043  return 0;
1044 
1045  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1046  {
1047  if (unformat (line_input, "enable"))
1048  {
1049  is_set = 1;
1050  is_enabled = 1;
1051  }
1052  else if (unformat (line_input, "disable"))
1053  is_set = 1;
1054  else
1055  {
1056  error = clib_error_return (0, "parse error: '%U'",
1057  format_unformat_error, line_input);
1058  goto done;
1059  }
1060  }
1061 
1062  if (!is_set)
1063  {
1064  error = clib_error_return (0, "state not set");
1065  goto done;
1066  }
1067 
1068  vnet_lisp_enable_disable (is_enabled);
1069 
1070 done:
1071  unformat_free (line_input);
1072 
1073  return error;
1074 }
1075 
1076 /* *INDENT-OFF* */
1077 VLIB_CLI_COMMAND (one_cp_enable_disable_command) = {
1078  .path = "one",
1079  .short_help = "one [enable|disable]",
1080  .function = lisp_enable_disable_command_fn,
1081 };
1082 /* *INDENT-ON* */
1083 
1084 static clib_error_t *
1086  unformat_input_t * input,
1087  vlib_cli_command_t * cmd)
1088 {
1089  unformat_input_t _line_input, *line_input = &_line_input;
1090  u8 is_enabled = 0;
1091  u8 is_set = 0;
1092  clib_error_t *error = NULL;
1093 
1094  /* Get a line of input. */
1095  if (!unformat_user (input, unformat_line_input, line_input))
1096  return 0;
1097 
1098  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1099  {
1100  if (unformat (line_input, "enable"))
1101  {
1102  is_set = 1;
1103  is_enabled = 1;
1104  }
1105  else if (unformat (line_input, "disable"))
1106  is_set = 1;
1107  else
1108  {
1109  vlib_cli_output (vm, "parse error: '%U'", format_unformat_error,
1110  line_input);
1111  goto done;
1112  }
1113  }
1114 
1115  if (!is_set)
1116  {
1117  vlib_cli_output (vm, "state not set!");
1118  goto done;
1119  }
1120 
1122 
1123 done:
1124  unformat_free (line_input);
1125 
1126  return error;
1127 }
1128 
1129 /* *INDENT-OFF* */
1130 VLIB_CLI_COMMAND (one_map_register_enable_disable_command) = {
1131  .path = "one map-register",
1132  .short_help = "one map-register [enable|disable]",
1134 };
1135 /* *INDENT-ON* */
1136 
1137 static clib_error_t *
1139  unformat_input_t * input,
1140  vlib_cli_command_t * cmd)
1141 {
1142  unformat_input_t _line_input, *line_input = &_line_input;
1143  u8 is_enabled = 0;
1144  u8 is_set = 0;
1145  clib_error_t *error = NULL;
1146 
1147  /* Get a line of input. */
1148  if (!unformat_user (input, unformat_line_input, line_input))
1149  return 0;
1150 
1151  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1152  {
1153  if (unformat (line_input, "enable"))
1154  {
1155  is_set = 1;
1156  is_enabled = 1;
1157  }
1158  else if (unformat (line_input, "disable"))
1159  is_set = 1;
1160  else
1161  {
1162  vlib_cli_output (vm, "parse error: '%U'", format_unformat_error,
1163  line_input);
1164  goto done;
1165  }
1166  }
1167 
1168  if (!is_set)
1169  {
1170  vlib_cli_output (vm, "state not set!");
1171  goto done;
1172  }
1173 
1175 
1176 done:
1177  unformat_free (line_input);
1178 
1179  return error;
1180 }
1181 
1182 /* *INDENT-OFF* */
1183 VLIB_CLI_COMMAND (one_rloc_probe_enable_disable_command) = {
1184  .path = "one rloc-probe",
1185  .short_help = "one rloc-probe [enable|disable]",
1187 };
1188 /* *INDENT-ON* */
1189 
1190 static u8 *
1191 format_lisp_status (u8 * s, va_list * args)
1192 {
1194  return format (s, "%s", lcm->is_enabled ? "enabled" : "disabled");
1195 }
1196 
1197 static clib_error_t *
1199  vlib_cli_command_t * cmd)
1200 {
1201  u8 *msg = 0;
1202  msg = format (msg, "feature: %U\ngpe: %U\n",
1204  vlib_cli_output (vm, "%v", msg);
1205  vec_free (msg);
1206  return 0;
1207 }
1208 
1209 /* *INDENT-OFF* */
1210 VLIB_CLI_COMMAND (one_show_status_command) = {
1211  .path = "show one status",
1212  .short_help = "show one status",
1213  .function = lisp_show_status_command_fn,
1214 };
1215 /* *INDENT-ON* */
1216 
1217 static clib_error_t *
1219  unformat_input_t * input,
1220  vlib_cli_command_t * cmd)
1221 {
1222  hash_pair_t *p;
1223  unformat_input_t _line_input, *line_input = &_line_input;
1225  uword *vni_table = 0;
1226  u8 is_l2 = 0;
1227  clib_error_t *error = NULL;
1228 
1229  /* Get a line of input. */
1230  if (!unformat_user (input, unformat_line_input, line_input))
1231  return 0;
1232 
1233  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1234  {
1235  if (unformat (line_input, "l2"))
1236  {
1237  vni_table = lcm->bd_id_by_vni;
1238  is_l2 = 1;
1239  }
1240  else if (unformat (line_input, "l3"))
1241  {
1242  vni_table = lcm->table_id_by_vni;
1243  is_l2 = 0;
1244  }
1245  else
1246  {
1247  error = clib_error_return (0, "parse error: '%U'",
1248  format_unformat_error, line_input);
1249  goto done;
1250  }
1251  }
1252 
1253  if (!vni_table)
1254  {
1255  vlib_cli_output (vm, "Error: expected l2|l3 param!\n");
1256  goto done;
1257  }
1258 
1259  vlib_cli_output (vm, "%=10s%=10s", "VNI", is_l2 ? "BD" : "VRF");
1260 
1261  /* *INDENT-OFF* */
1262  hash_foreach_pair (p, vni_table,
1263  ({
1264  vlib_cli_output (vm, "%=10d%=10d", p->key, p->value[0]);
1265  }));
1266  /* *INDENT-ON* */
1267 
1268 done:
1269  unformat_free (line_input);
1270 
1271  return error;
1272 }
1273 
1274 /* *INDENT-OFF* */
1275 VLIB_CLI_COMMAND (one_show_eid_table_map_command) = {
1276  .path = "show one eid-table map",
1277  .short_help = "show one eid-table l2|l3",
1279 };
1280 /* *INDENT-ON* */
1281 
1282 
1283 static clib_error_t *
1285  unformat_input_t * input,
1286  vlib_cli_command_t * cmd)
1287 {
1289  vnet_main_t *vnm = lgm->vnet_main;
1290  unformat_input_t _line_input, *line_input = &_line_input;
1291  u8 is_add = 1;
1292  clib_error_t *error = 0;
1293  u8 *locator_set_name = 0;
1294  locator_t locator, *locators = 0;
1296  u32 ls_index = 0;
1297  int rv = 0;
1298 
1299  memset (&locator, 0, sizeof (locator));
1300  memset (a, 0, sizeof (a[0]));
1301 
1302  /* Get a line of input. */
1303  if (!unformat_user (input, unformat_line_input, line_input))
1304  return 0;
1305 
1306  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1307  {
1308  if (unformat (line_input, "add %_%v%_", &locator_set_name))
1309  is_add = 1;
1310  else if (unformat (line_input, "del %_%v%_", &locator_set_name))
1311  is_add = 0;
1312  else if (unformat (line_input, "iface %U p %d w %d",
1314  &locator.sw_if_index, &locator.priority,
1315  &locator.weight))
1316  {
1317  locator.local = 1;
1318  vec_add1 (locators, locator);
1319  }
1320  else
1321  {
1322  error = unformat_parse_error (line_input);
1323  goto done;
1324  }
1325  }
1326 
1327  a->name = locator_set_name;
1328  a->locators = locators;
1329  a->is_add = is_add;
1330  a->local = 1;
1331 
1332  rv = vnet_lisp_add_del_locator_set (a, &ls_index);
1333  if (0 != rv)
1334  {
1335  error = clib_error_return (0, "failed to %s locator-set!",
1336  is_add ? "add" : "delete");
1337  }
1338 
1339 done:
1340  vec_free (locators);
1341  if (locator_set_name)
1342  vec_free (locator_set_name);
1343  unformat_free (line_input);
1344  return error;
1345 }
1346 
1347 /* *INDENT-OFF* */
1348 VLIB_CLI_COMMAND (one_cp_add_del_locator_set_command) = {
1349  .path = "one locator-set",
1350  .short_help = "one locator-set add/del <name> [iface <iface-name> "
1351  "p <priority> w <weight>]",
1353 };
1354 /* *INDENT-ON* */
1355 
1356 static clib_error_t *
1358  unformat_input_t * input,
1359  vlib_cli_command_t * cmd)
1360 {
1362  vnet_main_t *vnm = lgm->vnet_main;
1363  unformat_input_t _line_input, *line_input = &_line_input;
1364  u8 is_add = 1;
1365  clib_error_t *error = 0;
1366  u8 *locator_set_name = 0;
1367  u8 locator_set_name_set = 0;
1368  locator_t locator, *locators = 0;
1370  u32 ls_index = 0;
1371 
1372  memset (&locator, 0, sizeof (locator));
1373  memset (a, 0, sizeof (a[0]));
1374 
1375  /* Get a line of input. */
1376  if (!unformat_user (input, unformat_line_input, line_input))
1377  return 0;
1378 
1379  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1380  {
1381  if (unformat (line_input, "add"))
1382  is_add = 1;
1383  else if (unformat (line_input, "del"))
1384  is_add = 0;
1385  else if (unformat (line_input, "locator-set %_%v%_", &locator_set_name))
1386  locator_set_name_set = 1;
1387  else if (unformat (line_input, "iface %U p %d w %d",
1389  &locator.sw_if_index, &locator.priority,
1390  &locator.weight))
1391  {
1392  locator.local = 1;
1393  vec_add1 (locators, locator);
1394  }
1395  else
1396  {
1397  error = unformat_parse_error (line_input);
1398  goto done;
1399  }
1400  }
1401 
1402  if (!locator_set_name_set)
1403  {
1404  error = clib_error_return (0, "locator_set name not set!");
1405  goto done;
1406  }
1407 
1408  a->name = locator_set_name;
1409  a->locators = locators;
1410  a->is_add = is_add;
1411  a->local = 1;
1412 
1413  vnet_lisp_add_del_locator (a, 0, &ls_index);
1414 
1415 done:
1416  vec_free (locators);
1417  vec_free (locator_set_name);
1418  unformat_free (line_input);
1419  return error;
1420 }
1421 
1422 /* *INDENT-OFF* */
1423 VLIB_CLI_COMMAND (one_cp_add_del_locator_in_set_command) = {
1424  .path = "one locator",
1425  .short_help = "one locator add/del locator-set <name> iface <iface-name> "
1426  "p <priority> w <weight>",
1428 };
1429 /* *INDENT-ON* */
1430 
1431 static clib_error_t *
1433  unformat_input_t * input,
1434  vlib_cli_command_t * cmd)
1435 {
1436  locator_set_t *lsit;
1437  locator_t *loc;
1438  u32 *locit;
1440 
1441  vlib_cli_output (vm, "%s%=16s%=16s%=16s", "Locator-set", "Locator",
1442  "Priority", "Weight");
1443 
1444  /* *INDENT-OFF* */
1445  pool_foreach (lsit, lcm->locator_set_pool,
1446  ({
1447  u8 * msg = 0;
1448  int next_line = 0;
1449  if (lsit->local)
1450  {
1451  msg = format (msg, "%v", lsit->name);
1452  }
1453  else
1454  {
1455  msg = format (msg, "<%s-%d>", "remote", lsit - lcm->locator_set_pool);
1456  }
1457  vec_foreach (locit, lsit->locator_indices)
1458  {
1459  if (next_line)
1460  {
1461  msg = format (msg, "%16s", " ");
1462  }
1463  loc = pool_elt_at_index (lcm->locator_pool, locit[0]);
1464  if (loc->local)
1465  msg = format (msg, "%16d%16d%16d\n", loc->sw_if_index, loc->priority,
1466  loc->weight);
1467  else
1468  msg = format (msg, "%16U%16d%16d\n", format_ip_address,
1469  &gid_address_ip(&loc->address), loc->priority,
1470  loc->weight);
1471  next_line = 1;
1472  }
1473  vlib_cli_output (vm, "%v", msg);
1474  vec_free (msg);
1475  }));
1476  /* *INDENT-ON* */
1477  return 0;
1478 }
1479 
1480 /* *INDENT-OFF* */
1481 VLIB_CLI_COMMAND (one_cp_show_locator_sets_command) = {
1482  .path = "show one locator-set",
1483  .short_help = "Shows locator-sets",
1485 };
1486 /* *INDENT-ON* */
1487 
1488 
1489 static clib_error_t *
1491  unformat_input_t * input,
1492  vlib_cli_command_t * cmd)
1493 {
1494  unformat_input_t _line_input, *line_input = &_line_input;
1495  u8 is_add = 1, addr_set = 0;
1496  ip_address_t ip_addr;
1497  clib_error_t *error = 0;
1498  int rv = 0;
1500 
1501  /* Get a line of input. */
1502  if (!unformat_user (input, unformat_line_input, line_input))
1503  return 0;
1504 
1505  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1506  {
1507  if (unformat (line_input, "add"))
1508  is_add = 1;
1509  else if (unformat (line_input, "del"))
1510  is_add = 0;
1511  else if (unformat (line_input, "%U", unformat_ip_address, &ip_addr))
1512  addr_set = 1;
1513  else
1514  {
1515  error = unformat_parse_error (line_input);
1516  goto done;
1517  }
1518  }
1519 
1520  if (!addr_set)
1521  {
1522  error = clib_error_return (0, "Map-resolver address must be set!");
1523  goto done;
1524  }
1525 
1526  a->is_add = is_add;
1527  a->address = ip_addr;
1529  if (0 != rv)
1530  {
1531  error = clib_error_return (0, "failed to %s map-resolver!",
1532  is_add ? "add" : "delete");
1533  }
1534 
1535 done:
1536  unformat_free (line_input);
1537  return error;
1538 }
1539 
1540 /* *INDENT-OFF* */
1541 VLIB_CLI_COMMAND (one_add_del_map_resolver_command) = {
1542  .path = "one map-resolver",
1543  .short_help = "one map-resolver add/del <ip_address>",
1545 };
1546 /* *INDENT-ON* */
1547 
1548 
1549 static clib_error_t *
1551  unformat_input_t * input,
1552  vlib_cli_command_t * cmd)
1553 {
1554  unformat_input_t _line_input, *line_input = &_line_input;
1555  u8 is_add = 1;
1556  u8 *locator_set_name = 0;
1557  clib_error_t *error = 0;
1558  int rv = 0;
1560 
1561  /* Get a line of input. */
1562  if (!unformat_user (input, unformat_line_input, line_input))
1563  return 0;
1564 
1565  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1566  {
1567  if (unformat (line_input, "del"))
1568  is_add = 0;
1569  else if (unformat (line_input, "add %_%v%_", &locator_set_name))
1570  is_add = 1;
1571  else
1572  {
1573  error = unformat_parse_error (line_input);
1574  goto done;
1575  }
1576  }
1577 
1578  a->is_add = is_add;
1579  a->locator_set_name = locator_set_name;
1581  if (0 != rv)
1582  {
1583  error = clib_error_return (0, "failed to %s map-request itr-rlocs!",
1584  is_add ? "add" : "delete");
1585  }
1586 
1587 done:
1588  vec_free (locator_set_name);
1589  unformat_free (line_input);
1590  return error;
1591 
1592 }
1593 
1594 /* *INDENT-OFF* */
1595 VLIB_CLI_COMMAND (one_add_del_map_request_command) = {
1596  .path = "one map-request itr-rlocs",
1597  .short_help = "one map-request itr-rlocs add/del <locator_set_name>",
1599 };
1600 /* *INDENT-ON* */
1601 
1602 static clib_error_t *
1604  unformat_input_t * input,
1605  vlib_cli_command_t * cmd)
1606 {
1608  locator_set_t *loc_set;
1609 
1610  vlib_cli_output (vm, "%=20s", "itr-rlocs");
1611 
1612  if (~0 == lcm->mreq_itr_rlocs)
1613  {
1614  return 0;
1615  }
1616 
1617  loc_set = pool_elt_at_index (lcm->locator_set_pool, lcm->mreq_itr_rlocs);
1618 
1619  vlib_cli_output (vm, "%=20s", loc_set->name);
1620 
1621  return 0;
1622 }
1623 
1624 /* *INDENT-OFF* */
1625 VLIB_CLI_COMMAND (one_show_map_request_command) = {
1626  .path = "show one map-request itr-rlocs",
1627  .short_help = "Shows map-request itr-rlocs",
1629 };
1630 /* *INDENT-ON* */
1631 
1632 static clib_error_t *
1634  unformat_input_t * input,
1635  vlib_cli_command_t * cmd)
1636 {
1637  u8 is_add = 1, ip_set = 0;
1638  unformat_input_t _line_input, *line_input = &_line_input;
1639  clib_error_t *error = 0;
1640  ip_address_t ip;
1641 
1642  /* Get a line of input. */
1643  if (!unformat_user (input, unformat_line_input, line_input))
1644  return 0;
1645 
1646  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1647  {
1648  if (unformat (line_input, "%U", unformat_ip_address, &ip))
1649  ip_set = 1;
1650  else if (unformat (line_input, "disable"))
1651  is_add = 0;
1652  else
1653  {
1654  error = clib_error_return (0, "parse error");
1655  goto done;
1656  }
1657  }
1658 
1659  if (!ip_set)
1660  {
1661  clib_warning ("No petr IP specified!");
1662  goto done;
1663  }
1664 
1665  if (vnet_lisp_use_petr (&ip, is_add))
1666  {
1667  error = clib_error_return (0, "failed to %s petr!",
1668  is_add ? "add" : "delete");
1669  }
1670 
1671 done:
1672  unformat_free (line_input);
1673  return error;
1674 }
1675 
1676 /* *INDENT-OFF* */
1677 VLIB_CLI_COMMAND (one_use_petr_set_locator_set_command) = {
1678  .path = "one use-petr",
1679  .short_help = "one use-petr [disable] <petr-ip>",
1681 };
1682 
1683 static clib_error_t *
1685  unformat_input_t * input, vlib_cli_command_t * cmd)
1686 {
1688  mapping_t *m;
1689  locator_set_t *ls;
1690  locator_t *loc;
1691  u8 *tmp_str = 0;
1692  u8 use_petr = lcm->flags & LISP_FLAG_USE_PETR;
1693  vlib_cli_output (vm, "%=20s%=16s", "petr", use_petr ? "ip" : "");
1694 
1695  if (!use_petr)
1696  {
1697  vlib_cli_output (vm, "%=20s", "disable");
1698  return 0;
1699  }
1700 
1701  if (~0 == lcm->petr_map_index)
1702  {
1703  tmp_str = format (0, "N/A");
1704  }
1705  else
1706  {
1708  if (~0 != m->locator_set_index)
1709  {
1711  loc = pool_elt_at_index (lcm->locator_pool, ls->locator_indices[0]);
1712  tmp_str = format (0, "%U", format_ip_address, &loc->address);
1713  }
1714  else
1715  {
1716  tmp_str = format (0, "N/A");
1717  }
1718  }
1719  vec_add1 (tmp_str, 0);
1720 
1721  vlib_cli_output (vm, "%=20s%=16s", "enable", tmp_str);
1722 
1723  vec_free (tmp_str);
1724 
1725  return 0;
1726 }
1727 
1728 /* *INDENT-OFF* */
1729 VLIB_CLI_COMMAND (one_show_petr_command) = {
1730  .path = "show one petr",
1731  .short_help = "Show petr",
1732  .function = lisp_show_petr_command_fn,
1733 };
1734 /* *INDENT-ON* */
1735 
1736 static clib_error_t *
1738  unformat_input_t * input,
1739  vlib_cli_command_t * cmd)
1740 {
1741  lisp_msmr_t *ms;
1743 
1744  vec_foreach (ms, lcm->map_servers)
1745  {
1746  vlib_cli_output (vm, "%U", format_ip_address, &ms->address);
1747  }
1748  return 0;
1749 }
1750 
1751 /* *INDENT-OFF* */
1752 VLIB_CLI_COMMAND (one_show_map_servers_command) = {
1753  .path = "show one map-servers",
1754  .short_help = "show one map servers",
1756 };
1757 /* *INDENT-ON* */
1758 
1759 static clib_error_t *
1761  unformat_input_t * input,
1762  vlib_cli_command_t * cmd)
1763 {
1764  u8 *msg = 0;
1765  u8 is_enabled = vnet_lisp_map_register_state_get ();
1766 
1767  msg = format (msg, "%s\n", is_enabled ? "enabled" : "disabled");
1768  vlib_cli_output (vm, "%v", msg);
1769  vec_free (msg);
1770  return 0;
1771 }
1772 
1773 /* *INDENT-OFF* */
1774 VLIB_CLI_COMMAND (one_show_map_register_state_command) = {
1775  .path = "show one map-register state",
1776  .short_help = "show one map-register state",
1778 };
1779 /* *INDENT-ON* */
1780 
1781 static clib_error_t *
1783  unformat_input_t * input,
1784  vlib_cli_command_t * cmd)
1785 {
1786  u8 *msg = 0;
1787  u8 is_enabled = vnet_lisp_rloc_probe_state_get ();
1788 
1789  msg = format (msg, "%s\n", is_enabled ? "enabled" : "disabled");
1790  vlib_cli_output (vm, "%v", msg);
1791  vec_free (msg);
1792  return 0;
1793 }
1794 
1795 /* *INDENT-OFF* */
1796 VLIB_CLI_COMMAND (one_show_rloc_probe_state_command) = {
1797  .path = "show one rloc state",
1798  .short_help = "show one RLOC state",
1800 };
1801 /* *INDENT-ON* */
1802 
1803 static clib_error_t *
1805  unformat_input_t * input,
1806  vlib_cli_command_t * cmd)
1807 {
1808  u8 is_enabled = vnet_lisp_stats_enable_disable_state ();
1809  vlib_cli_output (vm, "%s\n", is_enabled ? "enabled" : "disabled");
1810  return 0;
1811 }
1812 
1813 /* *INDENT-OFF* */
1814 VLIB_CLI_COMMAND (one_show_stats_command) = {
1815  .path = "show one statistics status",
1816  .short_help = "show ONE statistics enable/disable status",
1817  .function = lisp_show_stats_command_fn,
1818 };
1819 /* *INDENT-ON* */
1820 
1821 static clib_error_t *
1823  unformat_input_t * input,
1824  vlib_cli_command_t * cmd)
1825 {
1826  lisp_api_stats_t *stat, *stats = vnet_lisp_get_stats ();
1827 
1828  if (vec_len (stats) > 0)
1829  vlib_cli_output (vm,
1830  "[src-EID, dst-EID] [loc-rloc, rmt-rloc] count bytes\n");
1831  else
1832  vlib_cli_output (vm, "No statistics found.\n");
1833 
1834  vec_foreach (stat, stats)
1835  {
1836  vlib_cli_output (vm, "[%U, %U] [%U, %U] %7u %7u\n",
1837  format_fid_address, &stat->seid,
1838  format_fid_address, &stat->deid,
1839  format_ip_address, &stat->loc_rloc,
1840  format_ip_address, &stat->rmt_rloc,
1841  stat->counters.packets, stat->counters.bytes);
1842  }
1843  vec_free (stats);
1844  return 0;
1845 }
1846 
1847 /* *INDENT-OFF* */
1848 VLIB_CLI_COMMAND (one_show_stats_details_command) = {
1849  .path = "show one statistics details",
1850  .short_help = "show ONE statistics",
1852 };
1853 /* *INDENT-ON* */
1854 
1855 static clib_error_t *
1857  unformat_input_t * input,
1858  vlib_cli_command_t * cmd)
1859 {
1860  unformat_input_t _line_input, *line_input = &_line_input;
1861  u8 enable = 0;
1862 
1863  /* Get a line of input. */
1864  if (!unformat_user (input, unformat_line_input, line_input))
1865  return 0;
1866 
1867  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
1868  {
1869  if (unformat (line_input, "enable"))
1870  enable = 1;
1871  else if (unformat (line_input, "disable"))
1872  enable = 0;
1873  else
1874  {
1875  clib_warning ("Error: expected enable/disable!");
1876  goto done;
1877  }
1878  }
1880 done:
1881  unformat_free (line_input);
1882  return 0;
1883 }
1884 
1885 /* *INDENT-OFF* */
1886 VLIB_CLI_COMMAND (one_stats_enable_disable_command) = {
1887  .path = "one statistics",
1888  .short_help = "enable/disable ONE statistics collecting",
1890 };
1891 /* *INDENT-ON* */
1892 
1893 static clib_error_t *
1895  unformat_input_t * input,
1896  vlib_cli_command_t * cmd)
1897 {
1899  return 0;
1900 }
1901 
1902 /* *INDENT-OFF* */
1903 VLIB_CLI_COMMAND (one_stats_flush_command) = {
1904  .path = "one statistics flush",
1905  .short_help = "Flush ONE statistics",
1906  .function = lisp_stats_flush_command_fn,
1907 };
1908 /* *INDENT-ON* */
1909 
1910 /*
1911  * fd.io coding-style-patch-verification: ON
1912  *
1913  * Local Variables:
1914  * eval: (c-set-style "gnu")
1915  * End:
1916  */
static clib_error_t * lisp_stats_flush_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1894
#define gid_address_ip_version(_a)
Definition: lisp_types.h:261
#define gid_address_arp_bd(_a)
Definition: lisp_types.h:280
u32 pitr_map_index
Definition: control.h:214
gid_address_t leid
Definition: control.h:63
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:337
#define gid_address_type(_a)
Definition: lisp_types.h:257
static clib_error_t * lisp_show_pitr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:838
a
Definition: bitmap.h:516
lisp_api_l2_arp_entry_t * vnet_lisp_l2_arp_entries_get_by_bd(u32 bd)
Definition: control.c:882
lisp_msmr_t * map_resolvers
Definition: control.h:186
static clib_error_t * lisp_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1033
uword * table_id_by_vni
Definition: control.h:203
#define NULL
Definition: clib.h:55
static u8 * format_eid_entry(u8 *s, va_list *args)
Definition: one_cli.c:891
locator_t * locator_pool
Definition: control.h:152
dp_address_t seid
Definition: lisp_gpe.h:103
LISP-GPE global state.
Definition: lisp_gpe.h:118
u8 vnet_lisp_get_map_request_mode(void)
Definition: control.c:52
#define ip_prefix_len(_a)
Definition: lisp_types.h:73
ip_address_t loc_rloc
Definition: lisp_gpe.h:104
uword unformat_ip_address(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:164
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:522
int vnet_lisp_add_del_l2_arp_entry(gid_address_t *key, u8 *mac, u8 is_add)
Definition: control.c:897
static clib_error_t * lisp_add_del_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1284
static clib_error_t * lisp_add_del_adjacency_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Handler for add/del adjacency CLI.
Definition: one_cli.c:518
static clib_error_t * lisp_show_map_request_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:684
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:983
static clib_error_t * lisp_add_del_local_eid_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:129
u32 ip4
Definition: control.h:93
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
unformat_function_t unformat_vnet_sw_interface
static clib_error_t * lisp_add_del_l2_arp_entry_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:280
ip_address_t address
Definition: control.h:78
vnet_api_error_t vnet_lisp_stats_enable_disable(u8 enable)
Definition: control.c:4260
uword unformat_hmac_key_id(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:317
#define ip_prefix_version(_a)
Definition: lisp_types.h:72
u8 vnet_lisp_stats_enable_disable_state(void)
Definition: control.c:4276
format_function_t format_vnet_sw_if_index_name
u8 vnet_lisp_map_register_state_get(void)
Definition: control.c:417
int vnet_lisp_set_map_request_mode(u8 mode)
Definition: control.c:1384
int vnet_lisp_add_del_adjacency(vnet_lisp_add_del_adjacency_args_t *a)
Adds adjacency or removes forwarding entry associated to remote mapping.
Definition: control.c:1323
uword value[0]
Definition: hash.h:164
uword unformat_negative_mapping_action(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:383
lisp_msmr_t * map_servers
Definition: control.h:189
format_function_t format_ip4_address
Definition: format.h:79
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:376
unformat_function_t unformat_ip4_address
Definition: format.h:76
static clib_error_t * lisp_show_map_servers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1737
u8 * format_mac_address(u8 *s, va_list *args)
Definition: lisp_types.c:215
static clib_error_t * lisp_show_rloc_probe_state_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1782
ip_address_t rmt_rloc
Definition: lisp_gpe.h:105
int vnet_lisp_flush_stats(void)
static clib_error_t * lisp_show_eid_table_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:939
#define clib_error_return(e, args...)
Definition: error.h:99
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
Definition: control.c:936
uword * bd_id_by_vni
Definition: control.h:207
static lisp_cp_main_t * vnet_lisp_cp_get_main()
Definition: control.h:257
static clib_error_t * lisp_nsh_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:725
static clib_error_t * lisp_cp_show_locator_sets_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1432
u32 petr_map_index
Proxy ETR map index.
Definition: control.h:217
unformat_function_t unformat_line_input
Definition: format.h:281
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
Definition: control.c:1981
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
Definition: control.c:1456
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:397
u8 vnet_lisp_rloc_probe_state_get(void)
Definition: control.c:424
counter_t packets
packet counter
Definition: counter.h:141
static clib_error_t * lisp_add_del_map_server_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:74
u8 * format_negative_mapping_action(u8 *s, va_list *args)
Definition: lisp_types.c:430
static clib_error_t * lisp_map_request_mode_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:621
#define gid_address_mac(_a)
Definition: lisp_types.h:263
u8 mac[6]
Definition: control.h:92
struct _unformat_input_t unformat_input_t
int vnet_lisp_add_del_local_mapping(vnet_lisp_add_del_mapping_args_t *a, u32 *map_index_result)
Add/update/delete mapping to/in/from map-cache.
Definition: control.c:809
#define hash_free(h)
Definition: hash.h:286
void gid_address_free(gid_address_t *a)
Definition: lisp_types.c:842
u8 authoritative
Definition: lisp_types.h:355
lisp_api_stats_t * vnet_lisp_get_stats(void)
Definition: control.c:4043
uword unformat_gid_address(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:342
u8 * format_gid_address(u8 *s, va_list *args)
Definition: lisp_types.c:258
static clib_error_t * lisp_map_register_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1085
int vnet_lisp_add_del_mapping(gid_address_t *eid, locator_t *rlocs, u8 action, u8 authoritative, u32 ttl, u8 is_add, u8 is_static, u32 *res_map_index)
Adds/removes/updates mapping.
Definition: control.c:1139
#define gid_address_ippref(_a)
Definition: lisp_types.h:258
dp_address_t deid
Definition: lisp_gpe.h:102
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
Definition: control.c:595
u32 sw_if_index
Definition: lisp_types.h:316
static clib_error_t * lisp_stats_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1856
#define UNFORMAT_END_OF_INPUT
Definition: format.h:143
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
Definition: control.c:2078
vlib_counter_t counters
Definition: lisp_gpe.h:107
static clib_error_t * lisp_add_del_mreq_itr_rlocs_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1550
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:340
vnet_main_t * vnet_main
Definition: lisp_gpe.h:172
#define clib_warning(format, args...)
Definition: error.h:59
u32 locator_set_index
Definition: lisp_types.h:348
int vnet_lisp_map_register_enable_disable(u8 is_enable)
Definition: control.c:1972
static clib_error_t * lisp_add_del_map_resolver_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1490
static clib_error_t * lisp_show_map_resolvers_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:702
static clib_error_t * lisp_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:234
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
Definition: lisp_gpe.c:30
static clib_error_t * lisp_show_adjacencies_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:20
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
struct _gid_address_t gid_address_t
uword unformat_mac_address(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:207
u8 * format_vnet_lisp_gpe_status(u8 *s, va_list *args)
Format LISP-GPE status.
Definition: lisp_gpe.c:584
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
Definition: control.c:649
unsigned int u32
Definition: types.h:88
u8 * format_ip_address(u8 *s, va_list *args)
Definition: lisp_types.c:144
int vnet_lisp_clear_all_remote_adjacencies(void)
Definition: control.c:1272
static u8 * format_lisp_status(u8 *s, va_list *args)
Definition: one_cli.c:1191
locator_set_t * locator_set_pool
Definition: control.h:155
static clib_error_t * lisp_show_stats_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1804
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
Definition: control.c:1963
static clib_error_t * lisp_add_del_remote_mapping_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Handler for add/del remote mapping CLI.
Definition: one_cli.c:388
static clib_error_t * lisp_pitr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:782
static clib_error_t * lisp_show_eid_table_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1218
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
uword unformat_ip_prefix(unformat_input_t *input, va_list *args)
Definition: lisp_types.c:187
Definition: control.h:90
static clib_error_t * lisp_rloc_probe_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1138
u64 uword
Definition: types.h:112
#define unformat_parse_error(input)
Definition: format.h:267
counter_t bytes
byte counter
Definition: counter.h:142
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
Definition: control.c:1823
static clib_error_t * lisp_show_l2_arp_entries_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:344
#define gid_address_ip(_a)
Definition: lisp_types.h:260
static clib_error_t * lisp_show_mreq_itr_rlocs_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1603
static clib_error_t * lisp_show_status_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1198
#define gid_address_vni(_a)
Definition: lisp_types.h:267
map_request_mode_t
Definition: control.h:96
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char u8
Definition: types.h:56
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
Definition: hash.h:349
static void unformat_free(unformat_input_t *i)
Definition: format.h:161
u32 * vnet_lisp_l2_arp_bds_get(void)
Definition: control.c:851
int vnet_lisp_add_del_locator(vnet_lisp_add_del_locator_set_args_t *a, locator_set_t *ls, u32 *ls_result)
Definition: control.c:1719
mapping_t * mapping_pool
Definition: control.h:146
u8 ip_address_max_len(u8 version)
Definition: lisp_types.c:541
uword * locator_set_index_by_name
Definition: control.h:161
int vnet_lisp_nsh_set_locator_set(u8 *locator_set_name, u8 is_add)
Definition: control.c:1405
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
Definition: lisp_types.c:1487
gid_address_t eid
Definition: lisp_types.h:343
gid_address_t reid
Definition: control.h:64
static clib_error_t * lisp_show_map_register_state_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1760
gid_address_t address
Definition: lisp_types.h:317
#define hash_get_mem(h, key)
Definition: hash.h:268
static clib_error_t * lisp_show_petr_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1684
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
Definition: control.c:2030
static u8 * format_lisp_map_request_mode(u8 *s, va_list *args)
Definition: one_cli.c:669
static clib_error_t * lisp_use_petr_set_locator_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1633
#define vec_foreach(var, vec)
Vector iterator.
#define gid_address_arp_ip4(_a)
Definition: lisp_types.h:279
static clib_error_t * lisp_add_del_locator_in_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1357
static clib_error_t * lisp_show_stats_details_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: one_cli.c:1822
u8 * format_fid_address(u8 *s, va_list *args)
Definition: lisp_types.c:237
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
Definition: control.c:1508
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:680
u32 mreq_itr_rlocs
Definition: control.h:200
u32 * locator_indices
Definition: lisp_types.h:337
vnet_main_t * vnet_main
Definition: control.h:244
uword key
Definition: hash.h:161
LISP-GPE definitions.
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:169