FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lisp_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * lisp_api.c - lisp api
4  *
5  * Copyright (c) 2016 Cisco and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #include <vnet/vnet.h>
21 #include <vlibmemory/api.h>
22 
23 #include <vnet/interface.h>
24 #include <vnet/api_errno.h>
25 #include <lisp/lisp-cp/control.h>
26 #include <lisp/lisp-gpe/lisp_gpe.h>
27 #include <vnet/ip/ip_types_api.h>
30 
31 /* define message IDs */
32 #include <vnet/format_fns.h>
33 #include <lisp/lisp-cp/lisp.api_enum.h>
34 #include <lisp/lisp-cp/lisp.api_types.h>
35 
36 /**
37  * Base message ID fot the plugin
38  */
40 #define REPLY_MSG_ID_BASE lisp_base_msg_id
41 
43 
44 static locator_t *
45 unformat_lisp_locs (vl_api_remote_locator_t * rmt_locs, u32 rloc_num)
46 {
47  u32 i;
48  locator_t *locs = 0, loc;
49  vl_api_remote_locator_t *r;
50 
51  for (i = 0; i < rloc_num; i++)
52  {
53  /* remote locators */
54  r = &rmt_locs[i];
55  clib_memset (&loc, 0, sizeof (loc));
56  ip_address_decode2 (&r->ip_address, &loc.address.ippref.addr);
57  loc.address.ippref.len =
58  ip_address_max_len (loc.address.ippref.addr.version);
59 
60  loc.priority = r->priority;
61  loc.weight = r->weight;
62 
63  vec_add1 (locs, loc);
64  }
65  return locs;
66 }
67 
68 static void
70  mp)
71 {
73  int rv = 0;
75  locator_t locator;
76  vl_api_local_locator_t *ls_loc;
77  u32 ls_index = ~0, locator_num;
78  u8 *locator_name = NULL;
79  int i;
80 
81  clib_memset (a, 0, sizeof (a[0]));
82 
83  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
84  locator_name = format (0, "%s", mp->locator_set_name);
85  vec_terminate_c_string (locator_name);
86 
87  a->name = locator_name;
88  a->is_add = mp->is_add;
89  a->local = 1;
90  locator_num = clib_net_to_host_u32 (mp->locator_num);
91 
92  clib_memset (&locator, 0, sizeof (locator));
93  for (i = 0; i < locator_num; i++)
94  {
95  ls_loc = &mp->locators[i];
96  VALIDATE_SW_IF_INDEX (ls_loc);
97 
98  locator.sw_if_index = htonl (ls_loc->sw_if_index);
99  locator.priority = ls_loc->priority;
100  locator.weight = ls_loc->weight;
101  locator.local = 1;
102  vec_add1 (a->locators, locator);
103  }
104 
105  rv = vnet_lisp_add_del_locator_set (a, &ls_index);
106 
108 
109  vec_free (locator_name);
110  vec_free (a->locators);
111 
112  /* *INDENT-OFF* */
113  REPLY_MACRO2 (VL_API_LISP_ADD_DEL_LOCATOR_SET_REPLY,
114  ({
115  rmp->ls_index = clib_host_to_net_u32 (ls_index);
116  }));
117  /* *INDENT-ON* */
118 }
119 
120 static void
122 {
123  vl_api_lisp_add_del_locator_reply_t *rmp;
124  int rv = 0;
125  locator_t locator, *locators = NULL;
127  u32 ls_index = ~0;
128  u8 *locator_name = NULL;
129 
130  clib_memset (&locator, 0, sizeof (locator));
131  clib_memset (a, 0, sizeof (a[0]));
132 
133  locator.sw_if_index = ntohl (mp->sw_if_index);
134  locator.priority = mp->priority;
135  locator.weight = mp->weight;
136  locator.local = 1;
137  vec_add1 (locators, locator);
138 
139  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
140  locator_name = format (0, "%s", mp->locator_set_name);
141  vec_terminate_c_string (locator_name);
142 
143  a->name = locator_name;
144  a->locators = locators;
145  a->is_add = mp->is_add;
146  a->local = 1;
147 
148  rv = vnet_lisp_add_del_locator (a, NULL, &ls_index);
149 
150  vec_free (locators);
151  vec_free (locator_name);
152 
153  REPLY_MACRO (VL_API_LISP_ADD_DEL_LOCATOR_REPLY);
154 }
155 
156 static void
158 {
159  vl_api_lisp_add_del_local_eid_reply_t *rmp;
161  int rv = 0;
162  gid_address_t _gid, *gid = &_gid;
163  uword *p = NULL;
164  u32 locator_set_index = ~0, map_index = ~0;
166  u8 *name = NULL, *key = NULL;
167  clib_memset (a, 0, sizeof (a[0]));
168  clib_memset (gid, 0, sizeof (gid[0]));
169 
170  rv = unformat_lisp_eid_api (gid, mp->vni, &mp->eid);
171  if (rv)
172  goto out;
173 
174  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
175  name = format (0, "%s", mp->locator_set_name);
178  if (!p)
179  {
180  rv = VNET_API_ERROR_INVALID_VALUE;
181  goto out;
182  }
183  locator_set_index = p[0];
184 
185  if (mp->key.id)
186  key = format (0, "%s", mp->key.key);
187 
188  /* XXX treat batch configuration */
189  a->is_add = mp->is_add;
190  gid_address_copy (&a->eid, gid);
191  a->locator_set_index = locator_set_index;
192  a->local = 1;
193  a->key = key;
194  a->key_id = clib_net_to_host_u16 (mp->key.id);
195 
196  rv = vnet_lisp_add_del_local_mapping (a, &map_index);
197 
198 out:
199  vec_free (name);
200  vec_free (key);
201  gid_address_free (&a->eid);
202 
203  REPLY_MACRO (VL_API_LISP_ADD_DEL_LOCAL_EID_REPLY);
204 }
205 
206 static void
209 {
210  vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
211  int rv = 0;
212  rv = vnet_lisp_eid_table_map (clib_net_to_host_u32 (mp->vni),
213  clib_net_to_host_u32 (mp->dp_table),
214  mp->is_l2, mp->is_add);
215 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
216 
217 static void
219  * mp)
220 {
221  vl_api_lisp_add_del_map_server_reply_t *rmp;
222  int rv = 0;
224 
225  clib_memset (&addr, 0, sizeof (addr));
226 
229 
230  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
231 }
232 
233 static void
235  * mp)
236 {
237  vl_api_lisp_add_del_map_resolver_reply_t *rmp;
238  int rv = 0;
240 
241  clib_memset (a, 0, sizeof (a[0]));
242 
243  a->is_add = mp->is_add;
244  ip_address_decode2 (&mp->ip_address, &a->address);
245 
247 
248  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
249 }
250 
251 static void
254 {
255  vl_api_lisp_map_register_enable_disable_reply_t *rmp;
256  int rv = 0;
257 
259  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
260 }
261 
262 static void
265 {
266  vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
267  int rv = 0;
268 
270  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
271 }
272 
273 static void
275 {
276  vl_api_lisp_enable_disable_reply_t *rmp;
277  int rv = 0;
278 
280  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
281 }
282 
283 static void
286 {
287  int rv = 0;
289 
290  /* *INDENT-OFF* */
291  REPLY_MACRO2(VL_API_SHOW_LISP_MAP_REQUEST_MODE_REPLY,
292  ({
294  }));
295  /* *INDENT-ON* */
296 }
297 
298 static void
300 {
301  vl_api_lisp_map_request_mode_reply_t *rmp;
302  int rv = 0;
303 
305 
306  REPLY_MACRO (VL_API_LISP_MAP_REQUEST_MODE_REPLY);
307 }
308 
309 static void
311  * mp)
312 {
313  vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
314  int rv = 0;
315  u8 *ls_name = 0;
316 
317  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
318  ls_name = format (0, "%s", mp->ls_name);
319  vec_terminate_c_string (ls_name);
320  rv = vnet_lisp_pitr_set_locator_set (ls_name, mp->is_add);
321  vec_free (ls_name);
322 
323  REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
324 }
325 
326 static void
328 {
329  vl_api_lisp_use_petr_reply_t *rmp;
330  int rv = 0;
332 
334  rv = vnet_lisp_use_petr (&addr, mp->is_add);
335 
336  REPLY_MACRO (VL_API_LISP_USE_PETR_REPLY);
337 }
338 
339 static void
341 {
344  mapping_t *m;
345  locator_set_t *ls = 0;
346  int rv = 0;
347  locator_t *loc = 0;
348  u8 status = 0;
350 
351  clib_memset (&addr, 0, sizeof (addr));
352  status = lcm->flags & LISP_FLAG_USE_PETR;
353  if (status)
354  {
356  if (~0 != m->locator_set_index)
357  {
358  ls =
360  loc = pool_elt_at_index (lcm->locator_pool, ls->locator_indices[0]);
361  gid_address_copy (&addr, &loc->address);
362  }
363  }
364 
365  /* *INDENT-OFF* */
366  REPLY_MACRO2 (VL_API_SHOW_LISP_USE_PETR_REPLY,
367  {
368  rmp->is_petr_enable = status;
370  });
371  /* *INDENT-ON* */
372 }
373 
374 static void
377 {
378  vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
379  int rv = 0;
380  u8 *locator_set_name = NULL;
382 
383  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
384  locator_set_name = format (0, "%s", mp->locator_set_name);
385  vec_terminate_c_string (locator_set_name);
386 
387  a->is_add = mp->is_add;
388  a->locator_set_name = locator_set_name;
389 
391 
392  vec_free (locator_set_name);
393 
394  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
395 }
396 
397 static void
400 {
401  locator_t *rlocs = 0;
402  vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
403  int rv = 0;
404  gid_address_t _eid, *eid = &_eid;
405  u32 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
406 
407  clib_memset (eid, 0, sizeof (eid[0]));
408 
409  rv = unformat_lisp_eid_api (eid, mp->vni, &mp->deid);
410  if (rv)
411  goto send_reply;
412 
413  rlocs = unformat_lisp_locs (mp->rlocs, rloc_num);
414 
415  if (!mp->is_add)
416  {
418  clib_memset (a, 0, sizeof (*a));
419  gid_address_copy (&a->reid, eid);
420  a->is_add = 0;
422  if (rv)
423  {
424  goto out;
425  }
426  }
427 
428  /* NOTE: for now this works as a static remote mapping, i.e.,
429  * not authoritative and ttl infinite. */
430  if (mp->is_add)
431  {
432  vnet_lisp_add_del_mapping_args_t _m_args, *m_args = &_m_args;
433  clib_memset (m_args, 0, sizeof (m_args[0]));
434  gid_address_copy (&m_args->eid, eid);
435  m_args->action = mp->action;
436  m_args->is_static = 1;
437  m_args->ttl = ~0;
438  m_args->authoritative = 0;
439  rv = vnet_lisp_add_mapping (m_args, rlocs, NULL, NULL);
440  }
441  else
442  {
443  rv = vnet_lisp_del_mapping (eid, NULL);
444  }
445 
446  if (mp->del_all)
448 
449 out:
450  vec_free (rlocs);
451 send_reply:
452  REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
453 }
454 
455 static void
457 {
458  vl_api_lisp_add_del_adjacency_reply_t *rmp;
460 
461  int rv = 0;
462  clib_memset (a, 0, sizeof (a[0]));
463 
464  rv = unformat_lisp_eid_api (&a->leid, mp->vni, &mp->leid);
465  rv = unformat_lisp_eid_api (&a->reid, mp->vni, &mp->reid);
466 
467  if (rv)
468  goto send_reply;
469 
470  a->is_add = mp->is_add;
472 
473 send_reply:
474  REPLY_MACRO (VL_API_LISP_ADD_DEL_ADJACENCY_REPLY);
475 }
476 
477 static void
479  locator_t * loc, vl_api_registration_t * reg,
480  u32 context)
481 {
483 
484  rmp = vl_msg_api_alloc (sizeof (*rmp));
485  clib_memset (rmp, 0, sizeof (*rmp));
486  rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_DETAILS + REPLY_MSG_ID_BASE);
487  rmp->context = context;
488 
489  rmp->local = loc->local;
490  if (loc->local)
491  {
492  rmp->sw_if_index = ntohl (loc->sw_if_index);
493  }
494  else
495  {
497  }
498  rmp->priority = loc->priority;
499  rmp->weight = loc->weight;
500 
501  vl_api_send_msg (reg, (u8 *) rmp);
502 }
503 
504 static void
506 {
507  u8 *ls_name = 0;
508  vl_api_registration_t *reg = 0;
510  locator_set_t *lsit = 0;
511  locator_t *loc = 0;
512  u32 ls_index = ~0, *locit = 0;
513  uword *p = 0;
514 
516  if (!reg)
517  return;
518 
519  if (mp->is_index_set)
520  ls_index = htonl (mp->ls_index);
521  else
522  {
523  /* make sure we get a proper C-string */
524  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
525  ls_name = format (0, "%s", mp->ls_name);
526  vec_terminate_c_string (ls_name);
527  p = hash_get_mem (lcm->locator_set_index_by_name, ls_name);
528  if (!p)
529  goto out;
530  ls_index = p[0];
531  }
532 
533  if (pool_is_free_index (lcm->locator_set_pool, ls_index))
534  return;
535 
536  lsit = pool_elt_at_index (lcm->locator_set_pool, ls_index);
537 
538  vec_foreach (locit, lsit->locator_indices)
539  {
540  loc = pool_elt_at_index (lcm->locator_pool, locit[0]);
541  send_lisp_locator_details (lcm, loc, reg, mp->context);
542  };
543 out:
544  vec_free (ls_name);
545 }
546 
547 static void
549  locator_set_t * lsit,
551  u32 ls_index)
552 {
554  u8 *str = 0;
555 
556  rmp = vl_msg_api_alloc (sizeof (*rmp));
557  clib_memset (rmp, 0, sizeof (*rmp));
558  rmp->_vl_msg_id =
559  ntohs (VL_API_LISP_LOCATOR_SET_DETAILS + REPLY_MSG_ID_BASE);
560  rmp->context = context;
561 
562  rmp->ls_index = htonl (ls_index);
563  if (lsit->local)
564  {
565  ASSERT (lsit->name != NULL);
566  strncpy ((char *) rmp->ls_name, (char *) lsit->name,
567  vec_len (lsit->name));
568  }
569  else
570  {
571  str = format (0, "<remote-%d>", ls_index);
572  strncpy ((char *) rmp->ls_name, (char *) str, vec_len (str));
573  vec_free (str);
574  }
575 
576  vl_api_send_msg (reg, (u8 *) rmp);
577 }
578 
579 static void
581 {
584  locator_set_t *lsit = NULL;
585  u8 filter;
586 
588  if (!reg)
589  return;
590 
591  filter = mp->filter;
592  /* *INDENT-OFF* */
593  pool_foreach (lsit, lcm->locator_set_pool)
594  {
595  if (filter && !((1 == filter && lsit->local) ||
596  (2 == filter && !lsit->local)))
597  {
598  continue;
599  }
600  send_lisp_locator_set_details (lcm, lsit, reg, mp->context,
601  lsit - lcm->locator_set_pool);
602  }
603  /* *INDENT-ON* */
604 }
605 
606 static void
609  u8 filter)
610 {
612  locator_set_t *ls = 0;
614  gid_address_t *gid = NULL;
615 
616  switch (filter)
617  {
618  case 0: /* all mappings */
619  break;
620 
621  case 1: /* local only */
622  if (!mapit->local)
623  return;
624  break;
625  case 2: /* remote only */
626  if (mapit->local)
627  return;
628  break;
629  default:
630  clib_warning ("Filter error, unknown filter: %d", filter);
631  return;
632  }
633 
634  /* don't send PITR generated mapping */
635  if (mapit->pitr_set)
636  return;
637 
638  gid = &mapit->eid;
639 
640  rmp = vl_msg_api_alloc (sizeof (*rmp));
641  clib_memset (rmp, 0, sizeof (*rmp));
642  rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_DETAILS + REPLY_MSG_ID_BASE);
643 
645  if (vec_len (ls->locator_indices) == 0)
646  rmp->locator_set_index = ~0;
647  else
648  rmp->locator_set_index = clib_host_to_net_u32 (mapit->locator_set_index);
649 
650  rmp->is_local = mapit->local;
651  rmp->ttl = clib_host_to_net_u32 (mapit->ttl);
652  rmp->action = mapit->action;
653  rmp->authoritative = mapit->authoritative;
654  switch (gid_address_type (gid))
655  {
656  case GID_ADDR_SRC_DST:
657  lisp_fid_put_api (&rmp->seid, &gid_address_sd_src (gid));
658  lisp_fid_put_api (&rmp->deid, &gid_address_sd_dst (gid));
659  rmp->is_src_dst = 1;
660  break;
661  case GID_ADDR_IP_PREFIX:
662  lisp_gid_put_api (&rmp->seid, gid);
663  break;
664  case GID_ADDR_MAC:
665  lisp_gid_put_api (&rmp->seid, gid);
666  break;
667  default:
668  ASSERT (0);
669  }
670  rmp->context = context;
671  rmp->vni = clib_host_to_net_u32 (gid_address_vni (gid));
672  rmp->key.id = clib_host_to_net_u16 (mapit->key_id);
673  memcpy (rmp->key.key, mapit->key, vec_len (mapit->key));
674  vl_api_send_msg (reg, (u8 *) rmp);
675 }
676 
677 static void
679 {
680  u32 mi;
683  mapping_t *mapit = NULL;
684  gid_address_t _eid, *eid = &_eid;
685 
687  if (!reg)
688  return;
689 
690  if (mp->eid_set)
691  {
692  clib_memset (eid, 0, sizeof (*eid));
693 
694  unformat_lisp_eid_api (eid, mp->vni, &mp->eid);
695 
697  if ((u32) ~ 0 == mi)
698  return;
699 
700  mapit = pool_elt_at_index (lcm->mapping_pool, mi);
701  send_lisp_eid_table_details (mapit, reg, mp->context,
702  0 /* ignore filter */ );
703  }
704  else
705  {
706  /* *INDENT-OFF* */
707  pool_foreach (mapit, lcm->mapping_pool)
708  {
709  send_lisp_eid_table_details(mapit, reg, mp->context,
710  mp->filter);
711  }
712  /* *INDENT-ON* */
713  }
714 }
715 
716 static void
718  u32 context)
719 {
721 
722  rmp = vl_msg_api_alloc (sizeof (*rmp));
723  clib_memset (rmp, 0, sizeof (*rmp));
724  rmp->_vl_msg_id =
725  ntohs (VL_API_LISP_MAP_SERVER_DETAILS + REPLY_MSG_ID_BASE);
726 
728  rmp->context = context;
729 
730  vl_api_send_msg (reg, (u8 *) rmp);
731 }
732 
733 static void
735 {
738  lisp_msmr_t *mr;
739 
741  if (!reg)
742  return;
743 
744  vec_foreach (mr, lcm->map_servers)
745  {
747  }
748 }
749 
750 static void
753 {
755 
756  rmp = vl_msg_api_alloc (sizeof (*rmp));
757  clib_memset (rmp, 0, sizeof (*rmp));
758  rmp->_vl_msg_id =
759  ntohs (VL_API_LISP_MAP_RESOLVER_DETAILS + REPLY_MSG_ID_BASE);
760 
762  rmp->context = context;
763 
764  vl_api_send_msg (reg, (u8 *) rmp);
765 }
766 
767 static void
769 {
772  lisp_msmr_t *mr;
773 
775  if (!reg)
776  return;
777 
778  vec_foreach (mr, lcm->map_resolvers)
779  {
781  }
782 }
783 
784 static void
786  u32 context)
787 {
789 
790  rmp = vl_msg_api_alloc (sizeof (*rmp));
791  clib_memset (rmp, 0, sizeof (*rmp));
792  rmp->_vl_msg_id =
793  ntohs (VL_API_LISP_EID_TABLE_MAP_DETAILS + REPLY_MSG_ID_BASE);
794 
795  rmp->vni = clib_host_to_net_u32 (p->key);
796  rmp->dp_table = clib_host_to_net_u32 (p->value[0]);
797  rmp->context = context;
798  vl_api_send_msg (reg, (u8 *) rmp);
799 }
800 
801 static void
803  mp)
804 {
807  hash_pair_t *p;
808  uword *vni_table = 0;
809 
811  if (!reg)
812  return;
813 
814  if (mp->is_l2)
815  {
816  vni_table = lcm->bd_id_by_vni;
817  }
818  else
819  {
820  vni_table = lcm->table_id_by_vni;
821  }
822 
823  /* *INDENT-OFF* */
824  hash_foreach_pair (p, vni_table,
825  ({
826  send_eid_table_map_pair (p, reg, mp->context);
827  }));
828  /* *INDENT-ON* */
829 }
830 
831 static void
833 {
835 
836  rmp = vl_msg_api_alloc (sizeof (*rmp));
837  clib_memset (rmp, 0, sizeof (*rmp));
838  rmp->_vl_msg_id =
839  ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS + REPLY_MSG_ID_BASE);
840  rmp->context = context;
841  rmp->vni = clib_host_to_net_u32 (vni);
842  vl_api_send_msg (reg, (u8 *) rmp);
843 }
844 
845 static void
846 lisp_adjacency_copy (vl_api_lisp_adjacency_t * dst, lisp_adjacency_t * adjs)
847 {
848  lisp_adjacency_t *adj;
849  vl_api_lisp_adjacency_t a;
850  u32 i, n = vec_len (adjs);
851 
852  for (i = 0; i < n; i++)
853  {
854  adj = vec_elt_at_index (adjs, i);
855  clib_memset (&a, 0, sizeof (a));
856 
857  lisp_gid_put_api (&a.reid, &adj->reid);
858  lisp_gid_put_api (&a.leid, &adj->leid);
859 
860  dst[i] = a;
861  }
862 }
863 
864 static void
867 {
869  int rv = 0;
870 
871  /* *INDENT-OFF* */
872  REPLY_MACRO2 (VL_API_SHOW_LISP_RLOC_PROBE_STATE_REPLY,
873  {
875  });
876  /* *INDENT-ON* */
877 }
878 
879 static void
882 {
884  int rv = 0;
885 
886  /* *INDENT-OFF* */
887  REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
888  {
890  });
891  /* *INDENT-ON* */
892 }
893 
894 static void
896 {
898  lisp_adjacency_t *adjs = 0;
899  int rv = 0;
900  u32 size = ~0;
901  u32 vni = clib_net_to_host_u32 (mp->vni);
902 
904  size = vec_len (adjs) * sizeof (vl_api_lisp_adjacency_t);
905 
906  /* *INDENT-OFF* */
907  REPLY_MACRO4 (VL_API_LISP_ADJACENCIES_GET_REPLY, size,
908  {
909  rmp->count = clib_host_to_net_u32 (vec_len (adjs));
910  lisp_adjacency_copy (rmp->adjacencies, adjs);
911  });
912  /* *INDENT-ON* */
913 
914  vec_free (adjs);
915 }
916 
917 static void
919  mp)
920 {
921  hash_pair_t *p;
922  u32 *vnis = 0;
923  vl_api_registration_t *reg = 0;
925 
927  if (!reg)
928  return;
929 
930  /* *INDENT-OFF* */
932  ({
933  hash_set (vnis, p->key, 0);
934  }));
935 
937  ({
938  hash_set (vnis, p->key, 0);
939  }));
940 
941  hash_foreach_pair (p, vnis,
942  ({
943  send_eid_table_vni (p->key, reg, mp->context);
944  }));
945  /* *INDENT-ON* */
946 
947  hash_free (vnis);
948 }
949 
950 static void
952 {
954  int rv = 0;
955 
956  /* *INDENT-OFF* */
957  REPLY_MACRO2(VL_API_SHOW_LISP_STATUS_REPLY,
958  ({
961  }));
962  /* *INDENT-ON* */
963 }
964 
965 static void
968 {
971  locator_set_t *loc_set = 0;
972  u8 *tmp_str = 0;
973  int rv = 0;
974 
975  if (~0 == lcm->mreq_itr_rlocs)
976  {
977  tmp_str = format (0, " ");
978  }
979  else
980  {
981  loc_set =
983  tmp_str = format (0, "%s", loc_set->name);
984  }
985 
986  /* *INDENT-OFF* */
987  REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
988  ({
989  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
990  ARRAY_LEN(rmp->locator_set_name) - 1);
991  }));
992  /* *INDENT-ON* */
993 
994  vec_free (tmp_str);
995 }
996 
997 static void
999 {
1000  vl_api_show_lisp_pitr_reply_t *rmp = NULL;
1002  mapping_t *m;
1003  locator_set_t *ls = 0;
1004  u8 *tmp_str = 0;
1005  int rv = 0;
1006 
1007  u8 is_enabled = (lcm->flags & LISP_FLAG_PITR_MODE)
1008  && lcm->pitr_map_index != ~0;
1009 
1010  if (!is_enabled)
1011  {
1012  tmp_str = format (0, "N/A");
1013  }
1014  else
1015  {
1017  if (~0 != m->locator_set_index)
1018  {
1019  ls =
1021  tmp_str = format (0, "%s", ls->name);
1022  }
1023  else
1024  {
1025  tmp_str = format (0, "N/A");
1026  }
1027  }
1028  vec_add1 (tmp_str, 0);
1029 
1030  /* *INDENT-OFF* */
1031  REPLY_MACRO2(VL_API_SHOW_LISP_PITR_REPLY,
1032  ({
1033  rmp->is_enabled = lcm->flags & LISP_FLAG_PITR_MODE;
1034  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1035  ARRAY_LEN(rmp->locator_set_name) - 1);
1036  }));
1037  /* *INDENT-ON* */
1038 }
1039 
1040 /*
1041  * lisp_api_hookup
1042  * Add vpe's API message handlers to the table.
1043  * vlib has already mapped shared memory and
1044  * added the client registration handlers.
1045  * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
1046  */
1047 #include <lisp/lisp-cp/lisp.api.c>
1048 
1049 static clib_error_t *
1051 {
1052  /*
1053  * Set up the (msg_name, crc, message-id) table
1054  */
1056 
1057  return NULL;
1058 }
1059 
1061 
1062 /*
1063  * fd.io coding-style-patch-verification: ON
1064  *
1065  * Local Variables:
1066  * eval: (c-set-style "gnu")
1067  * End:
1068  */
vl_api_lisp_eid_table_dump_t_handler
static void vl_api_lisp_eid_table_dump_t_handler(vl_api_lisp_eid_table_dump_t *mp)
Definition: lisp_api.c:678
vl_api_show_lisp_status_reply_t
Status of lisp, enable or disable.
Definition: lisp.api:620
vl_api_lisp_map_resolver_dump_t
Request for map resolver summary status.
Definition: lisp.api:580
vl_api_lisp_locator_dump_t::is_index_set
u8 is_index_set
Definition: lisp.api:379
ip_address
Definition: ip_types.h:79
vl_api_show_lisp_map_register_state_t_handler
static void vl_api_show_lisp_map_register_state_t_handler(vl_api_show_lisp_map_register_state_t *mp)
Definition: lisp_api.c:881
lisp_cp_main_t::table_id_by_vni
uword * table_id_by_vni
Definition: control.h:240
vnet_lisp_add_del_mreq_itr_rloc_args_t
Definition: control.h:390
vl_api_lisp_map_request_mode_t::is_src_dst
bool is_src_dst
Definition: lisp.api:259
VALIDATE_SW_IF_INDEX
#define VALIDATE_SW_IF_INDEX(mp)
Definition: api_helper_macros.h:281
vl_api_client_index_to_registration
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Definition: api.h:79
vl_api_lisp_add_del_map_resolver_t_handler
static void vl_api_lisp_add_del_map_resolver_t_handler(vl_api_lisp_add_del_map_resolver_t *mp)
Definition: lisp_api.c:234
api.h
locator_t::priority
u8 priority
Definition: lisp_types.h:269
vl_api_lisp_eid_table_add_del_map_t::is_l2
bool is_l2
Definition: lisp.api:363
vl_api_lisp_map_server_dump_t
Request for map server summary status.
Definition: lisp.api:599
vl_api_lisp_map_register_enable_disable_t_handler
static void vl_api_lisp_map_register_enable_disable_t_handler(vl_api_lisp_map_register_enable_disable_t *mp)
Definition: lisp_api.c:253
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
lisp_fid_put_api
void lisp_fid_put_api(vl_api_eid_t *eid, const fid_address_t *fid)
Definition: lisp_types_api.c:49
locator_set_t::name
u8 * name
Definition: lisp_types.h:284
vl_api_lisp_adjacencies_get_t
Request for LISP adjacencies.
Definition: lisp.api:517
vl_api_show_lisp_map_register_state_t
Get state of LISP map-register.
Definition: lisp.api:232
lisp_api_hookup
static clib_error_t * lisp_api_hookup(vlib_main_t *vm)
Definition: lisp_api.c:1050
send_lisp_locator_details
static void send_lisp_locator_details(lisp_cp_main_t *lcm, locator_t *loc, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:478
vnet_lisp_map_register_state_get
u8 vnet_lisp_map_register_state_get(void)
Definition: control.c:375
lisp_cp_main_t::flags
u32 flags
Definition: control.h:163
hash_free
#define hash_free(h)
Definition: hash.h:310
REPLY_MACRO2
#define REPLY_MACRO2(t, body)
Definition: api_helper_macros.h:65
vl_api_lisp_adjacencies_get_reply_t::count
u32 count
Definition: lisp.api:508
vl_api_lisp_eid_table_details_t::locator_set_index
u32 locator_set_index
Definition: lisp.api:453
vl_api_show_lisp_map_register_state_reply_t
Reply for show_lisp_map_register_state.
Definition: lisp.api:242
vl_api_lisp_add_del_locator_t::weight
u8 weight
Definition: lisp.api:68
vl_api_lisp_add_del_remote_mapping_t::is_add
bool is_add[default=true]
Definition: lisp.api:301
vl_api_lisp_map_resolver_details_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:573
vl_api_lisp_locator_details_t::priority
u8 priority
Definition: lisp.api:396
vnet_lisp_use_petr
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
Definition: control.c:1645
vl_api_lisp_use_petr_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:155
vl_api_send_msg
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
vl_api_lisp_eid_table_dump_t
Request for eid table summary status.
Definition: lisp.api:479
vl_api_lisp_add_del_map_server_t_handler
static void vl_api_lisp_add_del_map_server_t_handler(vl_api_lisp_add_del_map_server_t *mp)
Definition: lisp_api.c:218
control.h
vl_api_lisp_locator_set_details_t
LISP locator_set status.
Definition: lisp.api:405
vnet_lisp_add_del_mapping_args_t
Definition: control.h:334
gid_address_sd_dst
#define gid_address_sd_dst(_a)
Definition: lisp_types.h:221
vl_api_lisp_add_del_local_eid_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:86
vl_api_lisp_use_petr_t::is_add
bool is_add[default=true]
Definition: lisp.api:156
hash_foreach_pair
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
Definition: hash.h:373
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:549
name
string name[64]
Definition: fib.api:25
vl_api_lisp_map_resolver_dump_t::context
u32 context
Definition: lisp.api:583
vl_api_lisp_get_map_request_itr_rlocs_reply_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:644
lisp_cp_main_t::map_resolvers
lisp_msmr_t * map_resolvers
Definition: control.h:221
vl_api_lisp_add_del_local_eid_t::vni
u32 vni
Definition: lisp.api:87
vl_api_lisp_add_del_locator_t::priority
u8 priority
Definition: lisp.api:67
vl_api_lisp_map_resolver_details_t
LISP map resolver status.
Definition: lisp.api:570
REPLY_MACRO4
#define REPLY_MACRO4(t, n, body)
Definition: api_helper_macros.h:173
vl_api_lisp_add_del_adjacency_t_handler
static void vl_api_lisp_add_del_adjacency_t_handler(vl_api_lisp_add_del_adjacency_t *mp)
Definition: lisp_api.c:456
lisp_msmr_t
Definition: control.h:85
vl_api_lisp_eid_table_details_t::seid
vl_api_eid_t seid
Definition: lisp.api:459
vl_api_lisp_map_resolver_dump_t::client_index
u32 client_index
Definition: lisp.api:582
vl_api_lisp_eid_table_map_dump_t::client_index
u32 client_index
Definition: lisp.api:542
vl_api_lisp_eid_table_map_details_t::vni
u32 vni
Definition: lisp.api:531
lisp_cp_main_t::map_servers
lisp_msmr_t * map_servers
Definition: control.h:224
vl_api_lisp_map_server_dump_t_handler
static void vl_api_lisp_map_server_dump_t_handler(vl_api_lisp_map_server_dump_t *mp)
Definition: lisp_api.c:734
vl_api_show_lisp_rloc_probe_state_reply_t::is_enabled
bool is_enabled
Definition: lisp.api:201
vni
u32 vni
Definition: flow_types.api:160
vl_api_lisp_locator_dump_t::ls_name
string ls_name[64]
Definition: lisp.api:378
vl_api_lisp_map_server_dump_t::client_index
u32 client_index
Definition: lisp.api:601
vl_api_lisp_add_del_local_eid_t::is_add
bool is_add[default=true]
Definition: lisp.api:84
vl_api_lisp_map_resolver_details_t::context
u32 context
Definition: lisp.api:572
vl_api_lisp_add_del_local_eid_t
add or delete lisp eid-table
Definition: lisp.api:80
vl_api_show_lisp_pitr_t_handler
static void vl_api_show_lisp_pitr_t_handler(vl_api_show_lisp_pitr_t *mp)
Definition: lisp_api.c:998
vl_api_lisp_eid_table_vni_details_t::vni
u32 vni
Definition: lisp.api:564
vl_api_show_lisp_status_reply_t::is_gpe_enabled
bool is_gpe_enabled
Definition: lisp.api:625
vl_api_lisp_map_server_dump_t::context
u32 context
Definition: lisp.api:602
vl_api_lisp_eid_table_add_del_map_t::vni
u32 vni
Definition: lisp.api:361
vnet_lisp_add_del_adjacency
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:1435
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vl_api_lisp_locator_set_dump_t_handler
static void vl_api_lisp_locator_set_dump_t_handler(vl_api_lisp_locator_set_dump_t *mp)
Definition: lisp_api.c:580
vl_api_lisp_adjacencies_get_reply_t
LISP adjacency reply.
Definition: lisp.api:504
vl_api_lisp_add_del_adjacency_t
add or delete LISP adjacency adjacency
Definition: lisp.api:320
vl_api_lisp_add_del_locator_t::is_add
bool is_add[default=true]
Definition: lisp.api:64
vl_api_lisp_eid_table_dump_t::client_index
u32 client_index
Definition: lisp.api:481
vl_api_lisp_add_del_locator_set_t_handler
static void vl_api_lisp_add_del_locator_set_t_handler(vl_api_lisp_add_del_locator_set_t *mp)
Definition: lisp_api.c:69
send_lisp_locator_set_details
static void send_lisp_locator_set_details(lisp_cp_main_t *lcm, locator_set_t *lsit, vl_api_registration_t *reg, u32 context, u32 ls_index)
Definition: lisp_api.c:548
vl_api_show_lisp_use_petr_reply_t::is_petr_enable
bool is_petr_enable
Definition: lisp.api:178
vl_api_lisp_add_del_adjacency_t::leid
vl_api_eid_t leid
Definition: lisp.api:327
vl_api_lisp_eid_table_map_details_t
Shows relationship between vni and vrf/bd.
Definition: lisp.api:528
mapping_t::key
u8 * key
Definition: lisp_types.h:315
vl_api_lisp_eid_table_map_dump_t
Request for lisp_eid_table_map_details.
Definition: lisp.api:540
GID_ADDR_IP_PREFIX
@ GID_ADDR_IP_PREFIX
Definition: lisp_types.h:39
vl_api_show_lisp_map_request_mode_t
Request for LISP map-request mode.
Definition: lisp.api:266
vnet_lisp_pitr_set_locator_set
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
Definition: control.c:1578
gid_address_ip
#define gid_address_ip(_a)
Definition: lisp_types.h:206
vl_api_lisp_eid_table_dump_t::context
u32 context
Definition: lisp.api:482
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
vl_api_lisp_eid_table_add_del_map_t::dp_table
u32 dp_table
Definition: lisp.api:362
r
vnet_hw_if_output_node_runtime_t * r
Definition: interface_output.c:1089
vl_api_lisp_use_petr_t_handler
static void vl_api_lisp_use_petr_t_handler(vl_api_lisp_use_petr_t *mp)
Definition: lisp_api.c:327
vl_api_lisp_eid_table_add_del_map_t_handler
static void vl_api_lisp_eid_table_add_del_map_t_handler(vl_api_lisp_eid_table_add_del_map_t *mp)
Definition: lisp_api.c:208
vl_api_lisp_add_del_locator_t
add or delete locator for locator_set
Definition: lisp.api:60
locator_t
Definition: lisp_types.h:259
vl_api_lisp_adjacencies_get_t::vni
u32 vni
Definition: lisp.api:521
lisp_cp_main_t::petr_map_index
u32 petr_map_index
Proxy ETR map index used for 'use-petr'.
Definition: control.h:255
vl_api_lisp_add_del_remote_mapping_t_handler
static void vl_api_lisp_add_del_remote_mapping_t_handler(vl_api_lisp_add_del_remote_mapping_t *mp)
Definition: lisp_api.c:399
eid
typedef eid
Definition: lisp_types.api:59
vnet_lisp_get_map_request_mode
u8 vnet_lisp_get_map_request_mode(void)
Definition: control.c:55
lisp_gpe.h
LISP-GPE definitions.
vnet_lisp_eid_table_map
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
Definition: control.c:1035
key
typedef key
Definition: ipsec_types.api:91
vl_api_lisp_eid_table_details_t::vni
u32 vni
Definition: lisp.api:457
unformat_lisp_eid_api
int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, const vl_api_eid_t *eid)
Definition: lisp_types_api.c:24
vl_api_lisp_map_resolver_dump_t_handler
static void vl_api_lisp_map_resolver_dump_t_handler(vl_api_lisp_map_resolver_dump_t *mp)
Definition: lisp_api.c:768
lisp_cp_main_t::mapping_pool
mapping_t * mapping_pool
Definition: control.h:172
unformat_lisp_locs
static locator_t * unformat_lisp_locs(vl_api_remote_locator_t *rmt_locs, u32 rloc_num)
Definition: lisp_api.c:45
ip_address_encode2
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
Definition: ip_types_api.c:228
mapping_t::local
u8 local
Definition: lisp_types.h:306
vl_api_lisp_locator_details_t::weight
u8 weight
Definition: lisp.api:397
lisp_msmr_t::address
ip_address_t address
Definition: control.h:89
pool_is_free_index
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:302
locator_t::local
u8 local
Definition: lisp_types.h:262
vl_api_show_lisp_status_t_handler
static void vl_api_show_lisp_status_t_handler(vl_api_show_lisp_status_t *mp)
Definition: lisp_api.c:951
vl_api_lisp_eid_table_details_t::authoritative
u8 authoritative
Definition: lisp.api:461
vl_api_show_lisp_pitr_reply_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:667
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
vl_api_lisp_add_del_adjacency_t::reid
vl_api_eid_t reid
Definition: lisp.api:326
ip_address_max_len
u8 ip_address_max_len(u8 version)
Definition: lisp_types.c:432
vnet_lisp_rloc_probe_state_get
u8 vnet_lisp_rloc_probe_state_get(void)
Definition: control.c:382
vnet_lisp_enable_disable
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
Definition: control.c:2202
vl_api_lisp_locator_dump_t::context
u32 context
Definition: lisp.api:376
vl_api_lisp_eid_table_vni_details_t
reply to lisp_eid_table_vni_dump
Definition: lisp.api:561
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vnet_lisp_add_mapping
int vnet_lisp_add_mapping(vnet_lisp_add_del_mapping_args_t *a, locator_t *rlocs, u32 *res_map_index, u8 *is_updated)
Adds/updates mapping.
Definition: control.c:1226
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
vl_api_lisp_add_del_remote_mapping_t::del_all
bool del_all
Definition: lisp.api:303
send_lisp_map_resolver_details
static void send_lisp_map_resolver_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:751
hash_pair_t::value
uword value[0]
Definition: hash.h:165
vnet_lisp_add_del_local_mapping
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:836
send_eid_table_vni
static void send_eid_table_vni(u32 vni, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:832
vl_api_lisp_add_del_remote_mapping_t::rlocs
vl_api_remote_locator_t rlocs[rloc_num]
Definition: lisp.api:309
vl_api_lisp_eid_table_dump_t::eid
vl_api_eid_t eid
Definition: lisp.api:486
lisp_cp_main_t::locator_set_pool
locator_set_t * locator_set_pool
Definition: control.h:181
vnet_lisp_set_map_request_mode
int vnet_lisp_set_map_request_mode(u8 mode)
Definition: control.c:1506
vl_api_lisp_locator_set_dump_t::client_index
u32 client_index
Definition: lisp.api:425
vec_elt_at_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Definition: vec_bootstrap.h:203
vl_api_lisp_eid_table_details_t
Dump lisp eid-table.
Definition: lisp.api:450
mapping_t::ttl
u32 ttl
Definition: lisp_types.h:302
locator_t::sw_if_index
u32 sw_if_index
Definition: lisp_types.h:266
vl_api_lisp_pitr_set_locator_set_t::is_add
bool is_add[default=true]
Definition: lisp.api:141
vl_api_lisp_eid_table_dump_t::eid_set
u8 eid_set
Definition: lisp.api:483
vl_api_lisp_map_register_enable_disable_t::is_enable
bool is_enable[default=true]
Definition: lisp.api:225
vnet_lisp_cp_get_main
static lisp_cp_main_t * vnet_lisp_cp_get_main()
Definition: control.h:305
vl_api_registration_
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
REPLY_MACRO
#define REPLY_MACRO(t)
Definition: api_helper_macros.h:30
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: sr_mpls_api.c:174
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vl_api_lisp_map_request_mode_t_handler
static void vl_api_lisp_map_request_mode_t_handler(vl_api_lisp_map_request_mode_t *mp)
Definition: lisp_api.c:299
vl_api_lisp_add_del_map_request_itr_rlocs_t::is_add
bool is_add[default=true]
Definition: lisp.api:340
vl_api_lisp_enable_disable_t::is_enable
bool is_enable[default=true]
Definition: lisp.api:128
vl_api_lisp_add_del_remote_mapping_t::action
u8 action
Definition: lisp.api:305
lisp_cp_main_t::mapping_index_by_gid
gid_dictionary_t mapping_index_by_gid
Definition: control.h:169
mapping_t::authoritative
u8 authoritative
Definition: lisp_types.h:305
gid_address_vni
#define gid_address_vni(_a)
Definition: lisp_types.h:213
vl_api_lisp_eid_table_map_dump_t_handler
static void vl_api_lisp_eid_table_map_dump_t_handler(vl_api_lisp_eid_table_map_dump_t *mp)
Definition: lisp_api.c:802
vl_api_lisp_pitr_set_locator_set_t
configure or disable LISP PITR node
Definition: lisp.api:137
vl_api_lisp_map_request_mode_t
set LISP map-request mode.
Definition: lisp.api:255
vl_api_lisp_rloc_probe_enable_disable_t
enable/disable LISP RLOC probing
Definition: lisp.api:209
uword
u64 uword
Definition: types.h:112
vl_api_lisp_eid_table_vni_dump_t_handler
static void vl_api_lisp_eid_table_vni_dump_t_handler(vl_api_lisp_eid_table_vni_dump_t *mp)
Definition: lisp_api.c:918
lisp_cp_main_t::bd_id_by_vni
uword * bd_id_by_vni
Definition: control.h:244
vl_api_lisp_add_del_remote_mapping_t::vni
u32 vni
Definition: lisp.api:304
if
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
send_lisp_map_server_details
static void send_lisp_map_server_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:717
vl_api_show_lisp_pitr_reply_t
Status of lisp pitr, enable or disable.
Definition: lisp.api:662
vnet_lisp_add_del_locator_set_args_t
Definition: control.h:315
mapping_t
Definition: lisp_types.h:291
vl_api_lisp_locator_details_t
LISP locator_set status.
Definition: lisp.api:390
vl_api_lisp_eid_table_vni_dump_t
Dumps all VNIs used in mappings.
Definition: lisp.api:551
vnet_lisp_add_del_adjacency_args_t
Definition: control.h:364
vl_api_lisp_locator_dump_t::ls_index
u32 ls_index
Definition: lisp.api:377
vl_api_lisp_add_del_local_eid_t::key
vl_api_hmac_key_t key
Definition: lisp.api:88
interface.h
lisp_cp_main_t
Definition: control.h:161
vl_api_lisp_eid_table_dump_t::vni
u32 vni
Definition: lisp.api:485
vl_api_lisp_add_del_locator_set_t::locators
vl_api_local_locator_t locators[locator_num]
Definition: lisp.api:36
lisp_gid_put_api
void lisp_gid_put_api(vl_api_eid_t *eid, const gid_address_t *gid)
Definition: lisp_types_api.c:70
vnet_lisp_add_del_map_server
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
Definition: control.c:632
vl_api_lisp_add_del_locator_set_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:34
vl_api_lisp_add_del_map_request_itr_rlocs_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:341
lisp_cp_main_t::locator_set_index_by_name
uword * locator_set_index_by_name
Definition: control.h:187
vl_api_lisp_pitr_set_locator_set_t_handler
static void vl_api_lisp_pitr_set_locator_set_t_handler(vl_api_lisp_pitr_set_locator_set_t *mp)
Definition: lisp_api.c:310
mapping_t::pitr_set
u8 pitr_set
Definition: lisp_types.h:309
vl_api_lisp_add_del_map_request_itr_rlocs_t_handler
static void vl_api_lisp_add_del_map_request_itr_rlocs_t_handler(vl_api_lisp_add_del_map_request_itr_rlocs_t *mp)
Definition: lisp_api.c:376
vnet_lisp_add_del_mapping_args_t::eid
gid_address_t eid
Definition: control.h:337
vl_api_lisp_eid_table_vni_details_t::context
u32 context
Definition: lisp.api:563
vnet_lisp_clear_all_remote_adjacencies
int vnet_lisp_clear_all_remote_adjacencies(void)
Definition: control.c:1384
vl_api_lisp_eid_table_vni_dump_t::client_index
u32 client_index
Definition: lisp.api:553
vnet_lisp_add_del_mapping_args_t::ttl
u32 ttl
Definition: control.h:340
vl_api_lisp_locator_details_t::local
u8 local
Definition: lisp.api:393
vl_api_show_lisp_use_petr_reply_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:179
mapping_t::locator_set_index
u32 locator_set_index
Definition: lisp_types.h:298
vl_api_lisp_eid_table_vni_dump_t::context
u32 context
Definition: lisp.api:554
vl_api_lisp_eid_table_dump_t::filter
vl_api_lisp_locator_set_filter_t filter
Definition: lisp.api:487
gid_address_sd_src
#define gid_address_sd_src(_a)
Definition: lisp_types.h:220
mapping_t::key_id
lisp_key_type_t key_id
Definition: lisp_types.h:316
locator_t::weight
u8 weight
Definition: lisp_types.h:270
vnet_lisp_add_del_mapping_args_t::is_static
u8 is_static
Definition: control.h:345
vl_api_lisp_eid_table_add_del_map_t
Reply for lisp_add_del_map_request_itr_rlocs.
Definition: lisp.api:356
vl_api_lisp_add_del_map_server_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:102
ip_address_decode2
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
Definition: ip_types_api.c:178
vnet_lisp_gpe_enable_disable_status
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
Definition: lisp_gpe.c:184
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
locator_set_t::locator_indices
u32 * locator_indices
Definition: lisp_types.h:287
vnet_lisp_enable_disable_status
u8 vnet_lisp_enable_disable_status(void)
Definition: control.c:2267
vl_api_lisp_locator_set_dump_t::filter
vl_api_lisp_locator_set_filter_t filter
Definition: lisp.api:427
vnet_lisp_add_del_mreq_itr_rlocs
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
Definition: control.c:2337
lisp_adjacency_copy
static void lisp_adjacency_copy(vl_api_lisp_adjacency_t *dst, lisp_adjacency_t *adjs)
Definition: lisp_api.c:846
vnet_lisp_add_del_mapping_args_t::action
u8 action
Definition: control.h:341
vl_api_lisp_locator_dump_t_handler
static void vl_api_lisp_locator_dump_t_handler(vl_api_lisp_locator_dump_t *mp)
Definition: lisp_api.c:505
vl_api_lisp_locator_set_dump_t::context
u32 context
Definition: lisp.api:426
hash_get_mem
#define hash_get_mem(h, key)
Definition: hash.h:269
vl_api_lisp_get_map_request_itr_rlocs_t
Get LISP map request itr rlocs status.
Definition: lisp.api:632
vl_api_lisp_add_del_remote_mapping_t::rloc_num
u32 rloc_num
Definition: lisp.api:308
vl_api_show_lisp_status_t
Request for lisp-gpe protocol status.
Definition: lisp.api:609
lisp_base_msg_id
static u32 lisp_base_msg_id
Base message ID fot the plugin.
Definition: lisp_api.c:39
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
vl_api_lisp_eid_table_details_t::is_local
bool is_local
Definition: lisp.api:455
size
u32 size
Definition: vhost_user.h:125
vl_api_lisp_locator_details_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:395
gid_address_copy
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
Definition: lisp_types.c:1203
vl_api_lisp_map_register_enable_disable_t
enable/disable LISP map-register
Definition: lisp.api:221
vl_api_show_lisp_map_request_mode_reply_t::is_src_dst
bool is_src_dst
Definition: lisp.api:281
format_fns.h
vl_api_lisp_add_del_adjacency_t::vni
u32 vni
Definition: lisp.api:325
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
GID_ADDR_SRC_DST
@ GID_ADDR_SRC_DST
Definition: lisp_types.h:42
vnet_lisp_adjacencies_get_by_vni
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
Definition: control.c:578
vl_api_lisp_eid_table_details_t::deid
vl_api_eid_t deid
Definition: lisp.api:458
vl_api_lisp_add_del_locator_set_reply_t::ls_index
u32 ls_index
Definition: lisp.api:48
vl_api_show_lisp_rloc_probe_state_t
Get state of LISP RLOC probing.
Definition: lisp.api:186
u32
unsigned int u32
Definition: types.h:88
vl_api_lisp_adjacencies_get_reply_t::adjacencies
vl_api_lisp_adjacency_t adjacencies[count]
Definition: lisp.api:509
vl_api_lisp_rloc_probe_enable_disable_t::is_enable
bool is_enable[default=true]
Definition: lisp.api:213
vl_api_lisp_rloc_probe_enable_disable_t_handler
static void vl_api_lisp_rloc_probe_enable_disable_t_handler(vl_api_lisp_rloc_probe_enable_disable_t *mp)
Definition: lisp_api.c:264
REPLY_MSG_ID_BASE
#define REPLY_MSG_ID_BASE
Definition: lisp_api.c:40
vl_api_lisp_map_server_details_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:592
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
vl_api_show_lisp_status_reply_t::is_lisp_enabled
bool is_lisp_enabled
Definition: lisp.api:624
ethernet_types_api.h
vl_api_lisp_add_del_locator_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lisp.api:66
vl_api_lisp_enable_disable_t
enable or disable LISP feature
Definition: lisp.api:124
vl_api_lisp_locator_details_t::context
u32 context
Definition: lisp.api:392
vl_api_show_lisp_map_request_mode_t_handler
static void vl_api_show_lisp_map_request_mode_t_handler(vl_api_show_lisp_map_request_mode_t *mp)
Definition: lisp_api.c:285
vnet_lisp_add_del_locator_set
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
Definition: control.c:1992
api_helper_macros.h
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
lisp_adjacency_t::reid
gid_address_t reid
Definition: control.h:75
vl_api_lisp_add_del_map_request_itr_rlocs_t
add or delete map request itr rlocs
Definition: lisp.api:336
hash_pair_t::key
uword key
Definition: hash.h:162
vl_api_lisp_map_server_details_t
LISP map server details.
Definition: lisp.api:589
vl_api_lisp_eid_table_add_del_map_t::is_add
bool is_add[default=true]
Definition: lisp.api:360
vl_api_lisp_add_del_local_eid_t_handler
static void vl_api_lisp_add_del_local_eid_t_handler(vl_api_lisp_add_del_local_eid_t *mp)
Definition: lisp_api.c:157
vl_api_show_lisp_rloc_probe_state_t_handler
static void vl_api_show_lisp_rloc_probe_state_t_handler(vl_api_show_lisp_rloc_probe_state_t *mp)
Definition: lisp_api.c:866
vl_api_lisp_map_server_details_t::context
u32 context
Definition: lisp.api:591
vl_api_show_lisp_use_petr_t_handler
static void vl_api_show_lisp_use_petr_t_handler(vl_api_show_lisp_use_petr_t *mp)
Definition: lisp_api.c:340
vl_api_lisp_add_del_local_eid_t::eid
vl_api_eid_t eid
Definition: lisp.api:85
vnet_lisp_rloc_probe_enable_disable
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
Definition: control.c:2127
vl_api_lisp_use_petr_t
configure or disable use of PETR
Definition: lisp.api:151
vl_api_show_lisp_pitr_t
Request for lisp pitr status.
Definition: lisp.api:651
vnet_lisp_del_mapping
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
Definition: control.c:1335
locator_set_t
Definition: lisp_types.h:281
vnet_lisp_map_register_enable_disable
int vnet_lisp_map_register_enable_disable(u8 is_enable)
Definition: control.c:2136
vl_api_lisp_add_del_locator_set_t::locator_num
u32 locator_num
Definition: lisp.api:35
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vl_api_lisp_locator_set_details_t::context
u32 context
Definition: lisp.api:407
gid_dictionary_lookup
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
Definition: gid_dictionary.c:399
vl_api_lisp_enable_disable_t_handler
static void vl_api_lisp_enable_disable_t_handler(vl_api_lisp_enable_disable_t *mp)
Definition: lisp_api.c:274
gid_address_type
#define gid_address_type(_a)
Definition: lisp_types.h:203
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
locator_t::address
gid_address_t address
Definition: lisp_types.h:267
gid_address_free
void gid_address_free(gid_address_t *a)
Definition: lisp_types.c:733
a
a
Definition: bitmap.h:525
lisp_adjacency_t
Definition: control.h:72
ip
vl_api_address_t ip
Definition: l2.api:558
mapping_t::eid
gid_address_t eid
Definition: lisp_types.h:293
vl_api_lisp_eid_table_map_details_t::dp_table
u32 dp_table
Definition: lisp.api:532
locator_set_t::local
u8 local
Definition: lisp_types.h:288
vec_terminate_c_string
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
Definition: vec.h:1132
vl_api_lisp_add_del_remote_mapping_t::deid
vl_api_eid_t deid
Definition: lisp.api:306
i
int i
Definition: flowhash_template.h:376
vl_api_lisp_add_del_map_server_t
Add/delete map server.
Definition: lisp.api:97
vl_api_lisp_get_map_request_itr_rlocs_t_handler
static void vl_api_lisp_get_map_request_itr_rlocs_t_handler(vl_api_lisp_get_map_request_itr_rlocs_t *mp)
Definition: lisp_api.c:967
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
gid_address_t
struct _gid_address_t gid_address_t
vl_api_lisp_add_del_map_resolver_t
add or delete map-resolver
Definition: lisp.api:111
context
u32 context
Definition: ip.api:852
vl_api_show_lisp_rloc_probe_state_reply_t
Reply for show_lisp_rloc_probe_state.
Definition: lisp.api:197
vnet_lisp_add_del_mapping_args_t::authoritative
u8 authoritative
Definition: control.h:342
rv
int __clib_unused rv
Definition: application.c:491
vl_api_lisp_eid_table_details_t::context
u32 context
Definition: lisp.api:452
vl_api_lisp_eid_table_map_details_t::context
u32 context
Definition: lisp.api:530
vl_api_lisp_eid_table_details_t::ttl
u32 ttl
Definition: lisp.api:460
vl_api_lisp_get_map_request_itr_rlocs_reply_t
Request for map request itr rlocs summary status.
Definition: lisp.api:640
send_lisp_eid_table_details
static void send_lisp_eid_table_details(mapping_t *mapit, vl_api_registration_t *reg, u32 context, u8 filter)
Definition: lisp_api.c:607
vl_api_lisp_eid_table_details_t::is_src_dst
bool is_src_dst
Definition: lisp.api:456
vnet.h
api_errno.h
vl_api_show_lisp_use_petr_t
Request for LISP PETR status.
Definition: lisp.api:163
vl_api_lisp_add_del_locator_set_t
add or delete locator_set
Definition: lisp.api:29
GID_ADDR_MAC
@ GID_ADDR_MAC
Definition: lisp_types.h:41
vl_api_lisp_locator_dump_t
Request for map lisp locator status.
Definition: lisp.api:373
vl_api_lisp_eid_table_map_dump_t::is_l2
bool is_l2
Definition: lisp.api:544
vl_api_lisp_eid_table_details_t::action
u8 action
Definition: lisp.api:454
lisp_cp_main_t::mreq_itr_rlocs
u32 mreq_itr_rlocs
Definition: control.h:237
vl_api_lisp_add_del_remote_mapping_t
add or delete remote static mapping
Definition: lisp.api:297
vl_api_lisp_add_del_map_server_t::is_add
bool is_add[default=true]
Definition: lisp.api:101
vnet_lisp_add_del_map_resolver_args_t
Definition: control.h:373
vl_api_lisp_locator_set_details_t::ls_name
string ls_name[64]
Definition: lisp.api:409
vl_api_lisp_locator_dump_t::client_index
u32 client_index
Definition: lisp.api:375
vl_api_lisp_add_del_adjacency_t::is_add
bool is_add[default=true]
Definition: lisp.api:324
vl_api_show_lisp_pitr_reply_t::is_enabled
bool is_enabled
Definition: lisp.api:666
lisp_types_api.h
lisp_adjacency_t::leid
gid_address_t leid
Definition: control.h:74
mapping_t::action
u8 action
Definition: lisp_types.h:303
vl_api_lisp_add_del_locator_t_handler
static void vl_api_lisp_add_del_locator_t_handler(vl_api_lisp_add_del_locator_t *mp)
Definition: lisp_api.c:121
vl_api_lisp_add_del_map_resolver_t::ip_address
vl_api_address_t ip_address
Definition: lisp.api:116
vl_api_lisp_pitr_set_locator_set_t::ls_name
string ls_name[64]
Definition: lisp.api:142
lisp_cp_main_t::pitr_map_index
u32 pitr_map_index
Definition: control.h:251
vl_api_lisp_add_del_map_resolver_t::is_add
bool is_add[default=true]
Definition: lisp.api:115
ip_types_api.h
vnet_lisp_add_del_map_resolver
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
Definition: control.c:2274
vl_api_lisp_eid_table_map_dump_t::context
u32 context
Definition: lisp.api:543
vl_api_lisp_add_del_locator_set_t::is_add
bool is_add[default=true]
Definition: lisp.api:33
vl_api_lisp_adjacencies_get_t_handler
static void vl_api_lisp_adjacencies_get_t_handler(vl_api_lisp_adjacencies_get_t *mp)
Definition: lisp_api.c:895
vl_api_lisp_add_del_locator_t::locator_set_name
string locator_set_name[64]
Definition: lisp.api:65
vl_api_show_lisp_use_petr_reply_t
LISP PETR status, enable or disable.
Definition: lisp.api:174
vl_api_lisp_eid_table_details_t::key
vl_api_hmac_key_t key
Definition: lisp.api:462
VLIB_API_INIT_FUNCTION
VLIB_API_INIT_FUNCTION(lisp_api_hookup)
send_eid_table_map_pair
static void send_eid_table_map_pair(hash_pair_t *p, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:785
vl_api_lisp_locator_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: lisp.api:394
vl_api_lisp_add_del_locator_set_reply_t
Reply for locator_set add/del.
Definition: lisp.api:44
vl_api_show_lisp_map_register_state_reply_t::is_enabled
bool is_enabled
Definition: lisp.api:246
vl_api_lisp_locator_set_dump_t
Request for locator_set summary status.
Definition: lisp.api:423
vl_api_lisp_locator_set_details_t::ls_index
u32 ls_index
Definition: lisp.api:408
hash_pair_t
Definition: hash.h:159
vnet_lisp_add_del_locator
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:1888
lisp_cp_main_t::locator_pool
locator_t * locator_pool
Definition: control.h:178
vl_api_show_lisp_map_request_mode_reply_t
Reply for show_lisp_map_request_mode.
Definition: lisp.api:277
vl_msg_api_alloc
void * vl_msg_api_alloc(int nbytes)
Definition: memory_shared.c:199