FD.io VPP  v20.09-64-g4f7b92f0a
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 <vnet/lisp-cp/control.h>
26 #include <vnet/lisp-gpe/lisp_gpe.h>
27 #include <vnet/ip/ip_types_api.h>
30 
31 #include <vnet/vnet_msg_enum.h>
32 
33 
34 #define vl_api_lisp_add_del_locator_set_t_endian vl_noop_handler
35 #define vl_api_lisp_add_del_locator_set_t_print vl_noop_handler
36 #define vl_api_lisp_add_del_remote_mapping_t_endian vl_noop_handler
37 #define vl_api_lisp_add_del_remote_mapping_t_print vl_noop_handler
38 
39 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler
40 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler
41 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler
42 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler
43 
44 #define vl_typedefs /* define message structures */
45 #include <vnet/vnet_all_api_h.h>
46 #undef vl_typedefs
47 
48 #define vl_endianfun /* define message structures */
49 #include <vnet/vnet_all_api_h.h>
50 #undef vl_endianfun
51 
52 /* instantiate all the print functions we know about */
53 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
54 #define vl_printfun
55 #include <vnet/vnet_all_api_h.h>
56 #undef vl_printfun
57 
59 
60 #define foreach_vpe_api_msg \
61 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \
62 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \
63 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \
64 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \
65 _(LISP_ADD_DEL_MAP_SERVER, lisp_add_del_map_server) \
66 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \
67 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \
68 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \
69 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \
70 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \
71 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \
72 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \
73 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \
74 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \
75 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \
76 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \
77 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \
78 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \
79 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \
80 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \
81 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \
82 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \
83 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \
84 _(SHOW_LISP_STATUS, show_lisp_status) \
85 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
86  lisp_add_del_map_request_itr_rlocs) \
87 _(LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs) \
88 _(SHOW_LISP_PITR, show_lisp_pitr) \
89 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \
90 _(LISP_USE_PETR, lisp_use_petr) \
91 _(SHOW_LISP_USE_PETR, show_lisp_use_petr) \
92 
93 static locator_t *
94 unformat_lisp_locs (vl_api_remote_locator_t * rmt_locs, u32 rloc_num)
95 {
96  u32 i;
97  locator_t *locs = 0, loc;
98  vl_api_remote_locator_t *r;
99 
100  for (i = 0; i < rloc_num; i++)
101  {
102  /* remote locators */
103  r = &rmt_locs[i];
104  clib_memset (&loc, 0, sizeof (loc));
105  ip_address_decode2 (&r->ip_address, &loc.address.ippref.addr);
106  loc.address.ippref.len =
107  ip_address_max_len (loc.address.ippref.addr.version);
108 
109  loc.priority = r->priority;
110  loc.weight = r->weight;
111 
112  vec_add1 (locs, loc);
113  }
114  return locs;
115 }
116 
117 static void
119  mp)
120 {
122  int rv = 0;
124  locator_t locator;
125  vl_api_local_locator_t *ls_loc;
126  u32 ls_index = ~0, locator_num;
127  u8 *locator_name = NULL;
128  int i;
129 
130  clib_memset (a, 0, sizeof (a[0]));
131 
132  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
133  locator_name = format (0, "%s", mp->locator_set_name);
134  vec_terminate_c_string (locator_name);
135 
136  a->name = locator_name;
137  a->is_add = mp->is_add;
138  a->local = 1;
139  locator_num = clib_net_to_host_u32 (mp->locator_num);
140 
141  clib_memset (&locator, 0, sizeof (locator));
142  for (i = 0; i < locator_num; i++)
143  {
144  ls_loc = &mp->locators[i];
145  VALIDATE_SW_IF_INDEX (ls_loc);
146 
147  locator.sw_if_index = htonl (ls_loc->sw_if_index);
148  locator.priority = ls_loc->priority;
149  locator.weight = ls_loc->weight;
150  locator.local = 1;
151  vec_add1 (a->locators, locator);
152  }
153 
154  rv = vnet_lisp_add_del_locator_set (a, &ls_index);
155 
157 
158  vec_free (locator_name);
159  vec_free (a->locators);
160 
161  /* *INDENT-OFF* */
162  REPLY_MACRO2 (VL_API_LISP_ADD_DEL_LOCATOR_SET_REPLY,
163  ({
164  rmp->ls_index = clib_host_to_net_u32 (ls_index);
165  }));
166  /* *INDENT-ON* */
167 }
168 
169 static void
171 {
172  vl_api_lisp_add_del_locator_reply_t *rmp;
173  int rv = 0;
174  locator_t locator, *locators = NULL;
176  u32 ls_index = ~0;
177  u8 *locator_name = NULL;
178 
179  clib_memset (&locator, 0, sizeof (locator));
180  clib_memset (a, 0, sizeof (a[0]));
181 
182  locator.sw_if_index = ntohl (mp->sw_if_index);
183  locator.priority = mp->priority;
184  locator.weight = mp->weight;
185  locator.local = 1;
186  vec_add1 (locators, locator);
187 
188  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
189  locator_name = format (0, "%s", mp->locator_set_name);
190  vec_terminate_c_string (locator_name);
191 
192  a->name = locator_name;
193  a->locators = locators;
194  a->is_add = mp->is_add;
195  a->local = 1;
196 
197  rv = vnet_lisp_add_del_locator (a, NULL, &ls_index);
198 
199  vec_free (locators);
200  vec_free (locator_name);
201 
202  REPLY_MACRO (VL_API_LISP_ADD_DEL_LOCATOR_REPLY);
203 }
204 
205 static void
207 {
208  vl_api_lisp_add_del_local_eid_reply_t *rmp;
210  int rv = 0;
211  gid_address_t _gid, *gid = &_gid;
212  uword *p = NULL;
213  u32 locator_set_index = ~0, map_index = ~0;
215  u8 *name = NULL, *key = NULL;
216  clib_memset (a, 0, sizeof (a[0]));
217  clib_memset (gid, 0, sizeof (gid[0]));
218 
219  rv = unformat_lisp_eid_api (gid, mp->vni, &mp->eid);
220  if (rv)
221  goto out;
222 
223  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
224  name = format (0, "%s", mp->locator_set_name);
225  vec_terminate_c_string (name);
226  p = hash_get_mem (lcm->locator_set_index_by_name, name);
227  if (!p)
228  {
229  rv = VNET_API_ERROR_INVALID_VALUE;
230  goto out;
231  }
232  locator_set_index = p[0];
233 
234  if (mp->key.id)
235  key = format (0, "%s", mp->key.key);
236 
237  /* XXX treat batch configuration */
238  a->is_add = mp->is_add;
239  gid_address_copy (&a->eid, gid);
240  a->locator_set_index = locator_set_index;
241  a->local = 1;
242  a->key = key;
243  a->key_id = clib_net_to_host_u16 (mp->key.id);
244 
245  rv = vnet_lisp_add_del_local_mapping (a, &map_index);
246 
247 out:
248  vec_free (name);
249  vec_free (key);
250  gid_address_free (&a->eid);
251 
252  REPLY_MACRO (VL_API_LISP_ADD_DEL_LOCAL_EID_REPLY);
253 }
254 
255 static void
258 {
259  vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
260  int rv = 0;
261  rv = vnet_lisp_eid_table_map (clib_net_to_host_u32 (mp->vni),
262  clib_net_to_host_u32 (mp->dp_table),
263  mp->is_l2, mp->is_add);
264 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
265 
266 static void
268  * mp)
269 {
270  vl_api_lisp_add_del_map_server_reply_t *rmp;
271  int rv = 0;
273 
274  clib_memset (&addr, 0, sizeof (addr));
275 
276  ip_address_decode2 (&mp->ip_address, &addr);
277  rv = vnet_lisp_add_del_map_server (&addr, mp->is_add);
278 
279  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
280 }
281 
282 static void
284  * mp)
285 {
286  vl_api_lisp_add_del_map_resolver_reply_t *rmp;
287  int rv = 0;
289 
290  clib_memset (a, 0, sizeof (a[0]));
291 
292  a->is_add = mp->is_add;
294 
296 
297  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
298 }
299 
300 static void
303 {
304  vl_api_lisp_map_register_enable_disable_reply_t *rmp;
305  int rv = 0;
306 
308  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
309 }
310 
311 static void
314 {
315  vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
316  int rv = 0;
317 
319  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
320 }
321 
322 static void
324 {
325  vl_api_lisp_enable_disable_reply_t *rmp;
326  int rv = 0;
327 
329  REPLY_MACRO (VL_API_LISP_ENABLE_DISABLE_REPLY);
330 }
331 
332 static void
335 {
336  int rv = 0;
338 
339  /* *INDENT-OFF* */
340  REPLY_MACRO2(VL_API_SHOW_LISP_MAP_REQUEST_MODE_REPLY,
341  ({
343  }));
344  /* *INDENT-ON* */
345 }
346 
347 static void
349 {
350  vl_api_lisp_map_request_mode_reply_t *rmp;
351  int rv = 0;
352 
354 
355  REPLY_MACRO (VL_API_LISP_MAP_REQUEST_MODE_REPLY);
356 }
357 
358 static void
360  * mp)
361 {
362  vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
363  int rv = 0;
364  u8 *ls_name = 0;
365 
366  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
367  ls_name = format (0, "%s", mp->ls_name);
368  vec_terminate_c_string (ls_name);
369  rv = vnet_lisp_pitr_set_locator_set (ls_name, mp->is_add);
370  vec_free (ls_name);
371 
372  REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
373 }
374 
375 static void
377 {
378  vl_api_lisp_use_petr_reply_t *rmp;
379  int rv = 0;
381 
382  ip_address_decode2 (&mp->ip_address, &addr);
383  rv = vnet_lisp_use_petr (&addr, mp->is_add);
384 
385  REPLY_MACRO (VL_API_LISP_USE_PETR_REPLY);
386 }
387 
388 static void
390 {
393  mapping_t *m;
394  locator_set_t *ls = 0;
395  int rv = 0;
396  locator_t *loc = 0;
397  u8 status = 0;
399 
400  clib_memset (&addr, 0, sizeof (addr));
401  status = lcm->flags & LISP_FLAG_USE_PETR;
402  if (status)
403  {
405  if (~0 != m->locator_set_index)
406  {
407  ls =
409  loc = pool_elt_at_index (lcm->locator_pool, ls->locator_indices[0]);
410  gid_address_copy (&addr, &loc->address);
411  }
412  }
413 
414  /* *INDENT-OFF* */
415  REPLY_MACRO2 (VL_API_SHOW_LISP_USE_PETR_REPLY,
416  {
417  rmp->is_petr_enable = status;
418  ip_address_encode2 (&gid_address_ip (&addr), &rmp->ip_address);
419  });
420  /* *INDENT-ON* */
421 }
422 
423 static void
426 {
427  vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
428  int rv = 0;
429  u8 *locator_set_name = NULL;
431 
432  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
433  locator_set_name = format (0, "%s", mp->locator_set_name);
434  vec_terminate_c_string (locator_set_name);
435 
436  a->is_add = mp->is_add;
437  a->locator_set_name = locator_set_name;
438 
440 
441  vec_free (locator_set_name);
442 
443  REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
444 }
445 
446 static void
449 {
450  locator_t *rlocs = 0;
451  vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
452  int rv = 0;
453  gid_address_t _eid, *eid = &_eid;
454  u32 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
455 
456  clib_memset (eid, 0, sizeof (eid[0]));
457 
458  rv = unformat_lisp_eid_api (eid, mp->vni, &mp->deid);
459  if (rv)
460  goto send_reply;
461 
462  rlocs = unformat_lisp_locs (mp->rlocs, rloc_num);
463 
464  if (!mp->is_add)
465  {
467  clib_memset (a, 0, sizeof (*a));
468  gid_address_copy (&a->reid, eid);
469  a->is_add = 0;
471  if (rv)
472  {
473  goto out;
474  }
475  }
476 
477  /* NOTE: for now this works as a static remote mapping, i.e.,
478  * not authoritative and ttl infinite. */
479  if (mp->is_add)
480  {
481  vnet_lisp_add_del_mapping_args_t _m_args, *m_args = &_m_args;
482  clib_memset (m_args, 0, sizeof (m_args[0]));
483  gid_address_copy (&m_args->eid, eid);
484  m_args->action = mp->action;
485  m_args->is_static = 1;
486  m_args->ttl = ~0;
487  m_args->authoritative = 0;
488  rv = vnet_lisp_add_mapping (m_args, rlocs, NULL, NULL);
489  }
490  else
491  {
492  rv = vnet_lisp_del_mapping (eid, NULL);
493  }
494 
495  if (mp->del_all)
497 
498 out:
499  vec_free (rlocs);
500 send_reply:
501  REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
502 }
503 
504 static void
506 {
507  vl_api_lisp_add_del_adjacency_reply_t *rmp;
509 
510  int rv = 0;
511  clib_memset (a, 0, sizeof (a[0]));
512 
513  rv = unformat_lisp_eid_api (&a->leid, mp->vni, &mp->leid);
514  rv = unformat_lisp_eid_api (&a->reid, mp->vni, &mp->reid);
515 
516  if (rv)
517  goto send_reply;
518 
519  a->is_add = mp->is_add;
521 
522 send_reply:
523  REPLY_MACRO (VL_API_LISP_ADD_DEL_ADJACENCY_REPLY);
524 }
525 
526 static void
528  locator_t * loc, vl_api_registration_t * reg,
529  u32 context)
530 {
532 
533  rmp = vl_msg_api_alloc (sizeof (*rmp));
534  clib_memset (rmp, 0, sizeof (*rmp));
535  rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_DETAILS);
536  rmp->context = context;
537 
538  rmp->local = loc->local;
539  if (loc->local)
540  {
541  rmp->sw_if_index = ntohl (loc->sw_if_index);
542  }
543  else
544  {
546  }
547  rmp->priority = loc->priority;
548  rmp->weight = loc->weight;
549 
550  vl_api_send_msg (reg, (u8 *) rmp);
551 }
552 
553 static void
555 {
556  u8 *ls_name = 0;
557  vl_api_registration_t *reg = 0;
559  locator_set_t *lsit = 0;
560  locator_t *loc = 0;
561  u32 ls_index = ~0, *locit = 0;
562  uword *p = 0;
563 
565  if (!reg)
566  return;
567 
568  if (mp->is_index_set)
569  ls_index = htonl (mp->ls_index);
570  else
571  {
572  /* make sure we get a proper C-string */
573  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
574  ls_name = format (0, "%s", mp->ls_name);
575  vec_terminate_c_string (ls_name);
576  p = hash_get_mem (lcm->locator_set_index_by_name, ls_name);
577  if (!p)
578  goto out;
579  ls_index = p[0];
580  }
581 
582  if (pool_is_free_index (lcm->locator_set_pool, ls_index))
583  return;
584 
585  lsit = pool_elt_at_index (lcm->locator_set_pool, ls_index);
586 
587  vec_foreach (locit, lsit->locator_indices)
588  {
589  loc = pool_elt_at_index (lcm->locator_pool, locit[0]);
590  send_lisp_locator_details (lcm, loc, reg, mp->context);
591  };
592 out:
593  vec_free (ls_name);
594 }
595 
596 static void
598  locator_set_t * lsit,
599  vl_api_registration_t * reg, u32 context,
600  u32 ls_index)
601 {
603  u8 *str = 0;
604 
605  rmp = vl_msg_api_alloc (sizeof (*rmp));
606  clib_memset (rmp, 0, sizeof (*rmp));
607  rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_SET_DETAILS);
608  rmp->context = context;
609 
610  rmp->ls_index = htonl (ls_index);
611  if (lsit->local)
612  {
613  ASSERT (lsit->name != NULL);
614  strncpy ((char *) rmp->ls_name, (char *) lsit->name,
615  vec_len (lsit->name));
616  }
617  else
618  {
619  str = format (0, "<remote-%d>", ls_index);
620  strncpy ((char *) rmp->ls_name, (char *) str, vec_len (str));
621  vec_free (str);
622  }
623 
624  vl_api_send_msg (reg, (u8 *) rmp);
625 }
626 
627 static void
629 {
632  locator_set_t *lsit = NULL;
633  u8 filter;
634 
636  if (!reg)
637  return;
638 
639  filter = mp->filter;
640  /* *INDENT-OFF* */
641  pool_foreach (lsit, lcm->locator_set_pool,
642  ({
643  if (filter && !((1 == filter && lsit->local) ||
644  (2 == filter && !lsit->local)))
645  {
646  continue;
647  }
648  send_lisp_locator_set_details (lcm, lsit, reg, mp->context,
649  lsit - lcm->locator_set_pool);
650  }));
651  /* *INDENT-ON* */
652 }
653 
654 static void
656  vl_api_registration_t * reg, u32 context,
657  u8 filter)
658 {
660  locator_set_t *ls = 0;
662  gid_address_t *gid = NULL;
663 
664  switch (filter)
665  {
666  case 0: /* all mappings */
667  break;
668 
669  case 1: /* local only */
670  if (!mapit->local)
671  return;
672  break;
673  case 2: /* remote only */
674  if (mapit->local)
675  return;
676  break;
677  default:
678  clib_warning ("Filter error, unknown filter: %d", filter);
679  return;
680  }
681 
682  /* don't send PITR generated mapping */
683  if (mapit->pitr_set)
684  return;
685 
686  gid = &mapit->eid;
687 
688  rmp = vl_msg_api_alloc (sizeof (*rmp));
689  clib_memset (rmp, 0, sizeof (*rmp));
690  rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_DETAILS);
691 
693  if (vec_len (ls->locator_indices) == 0)
694  rmp->locator_set_index = ~0;
695  else
696  rmp->locator_set_index = clib_host_to_net_u32 (mapit->locator_set_index);
697 
698  rmp->is_local = mapit->local;
699  rmp->ttl = clib_host_to_net_u32 (mapit->ttl);
700  rmp->action = mapit->action;
701  rmp->authoritative = mapit->authoritative;
702  switch (gid_address_type (gid))
703  {
704  case GID_ADDR_SRC_DST:
705  lisp_fid_put_api (&rmp->seid, &gid_address_sd_src (gid));
706  lisp_fid_put_api (&rmp->deid, &gid_address_sd_dst (gid));
707  rmp->is_src_dst = 1;
708  break;
709  case GID_ADDR_IP_PREFIX:
710  lisp_gid_put_api (&rmp->seid, gid);
711  break;
712  case GID_ADDR_MAC:
713  lisp_gid_put_api (&rmp->seid, gid);
714  break;
715  default:
716  ASSERT (0);
717  }
718  rmp->context = context;
719  rmp->vni = clib_host_to_net_u32 (gid_address_vni (gid));
720  rmp->key.id = clib_host_to_net_u16 (mapit->key_id);
721  memcpy (rmp->key.key, mapit->key, vec_len (mapit->key));
722  vl_api_send_msg (reg, (u8 *) rmp);
723 }
724 
725 static void
727 {
728  u32 mi;
731  mapping_t *mapit = NULL;
732  gid_address_t _eid, *eid = &_eid;
733 
735  if (!reg)
736  return;
737 
738  if (mp->eid_set)
739  {
740  clib_memset (eid, 0, sizeof (*eid));
741 
742  unformat_lisp_eid_api (eid, mp->vni, &mp->eid);
743 
745  if ((u32) ~ 0 == mi)
746  return;
747 
748  mapit = pool_elt_at_index (lcm->mapping_pool, mi);
749  send_lisp_eid_table_details (mapit, reg, mp->context,
750  0 /* ignore filter */ );
751  }
752  else
753  {
754  /* *INDENT-OFF* */
755  pool_foreach (mapit, lcm->mapping_pool,
756  ({
757  send_lisp_eid_table_details(mapit, reg, mp->context,
758  mp->filter);
759  }));
760  /* *INDENT-ON* */
761  }
762 }
763 
764 static void
766  u32 context)
767 {
769 
770  rmp = vl_msg_api_alloc (sizeof (*rmp));
771  clib_memset (rmp, 0, sizeof (*rmp));
772  rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_SERVER_DETAILS);
773 
774  ip_address_encode2 (ip, &rmp->ip_address);
775  rmp->context = context;
776 
777  vl_api_send_msg (reg, (u8 *) rmp);
778 }
779 
780 static void
782 {
785  lisp_msmr_t *mr;
786 
788  if (!reg)
789  return;
790 
791  vec_foreach (mr, lcm->map_servers)
792  {
794  }
795 }
796 
797 static void
799  vl_api_registration_t * reg, u32 context)
800 {
802 
803  rmp = vl_msg_api_alloc (sizeof (*rmp));
804  clib_memset (rmp, 0, sizeof (*rmp));
805  rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_RESOLVER_DETAILS);
806 
807  ip_address_encode2 (ip, &rmp->ip_address);
808  rmp->context = context;
809 
810  vl_api_send_msg (reg, (u8 *) rmp);
811 }
812 
813 static void
815 {
818  lisp_msmr_t *mr;
819 
821  if (!reg)
822  return;
823 
824  vec_foreach (mr, lcm->map_resolvers)
825  {
827  }
828 }
829 
830 static void
832  u32 context)
833 {
835 
836  rmp = vl_msg_api_alloc (sizeof (*rmp));
837  clib_memset (rmp, 0, sizeof (*rmp));
838  rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_MAP_DETAILS);
839 
840  rmp->vni = clib_host_to_net_u32 (p->key);
841  rmp->dp_table = clib_host_to_net_u32 (p->value[0]);
842  rmp->context = context;
843  vl_api_send_msg (reg, (u8 *) rmp);
844 }
845 
846 static void
848  mp)
849 {
852  hash_pair_t *p;
853  uword *vni_table = 0;
854 
856  if (!reg)
857  return;
858 
859  if (mp->is_l2)
860  {
861  vni_table = lcm->bd_id_by_vni;
862  }
863  else
864  {
865  vni_table = lcm->table_id_by_vni;
866  }
867 
868  /* *INDENT-OFF* */
869  hash_foreach_pair (p, vni_table,
870  ({
871  send_eid_table_map_pair (p, reg, mp->context);
872  }));
873  /* *INDENT-ON* */
874 }
875 
876 static void
878 {
880 
881  rmp = vl_msg_api_alloc (sizeof (*rmp));
882  clib_memset (rmp, 0, sizeof (*rmp));
883  rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS);
884  rmp->context = context;
885  rmp->vni = clib_host_to_net_u32 (vni);
886  vl_api_send_msg (reg, (u8 *) rmp);
887 }
888 
889 static void
890 lisp_adjacency_copy (vl_api_lisp_adjacency_t * dst, lisp_adjacency_t * adjs)
891 {
892  lisp_adjacency_t *adj;
893  vl_api_lisp_adjacency_t a;
894  u32 i, n = vec_len (adjs);
895 
896  for (i = 0; i < n; i++)
897  {
898  adj = vec_elt_at_index (adjs, i);
899  clib_memset (&a, 0, sizeof (a));
900 
901  lisp_gid_put_api (&a.reid, &adj->reid);
902  lisp_gid_put_api (&a.leid, &adj->leid);
903 
904  dst[i] = a;
905  }
906 }
907 
908 static void
911 {
913  int rv = 0;
914 
915  /* *INDENT-OFF* */
916  REPLY_MACRO2 (VL_API_SHOW_LISP_RLOC_PROBE_STATE_REPLY,
917  {
919  });
920  /* *INDENT-ON* */
921 }
922 
923 static void
926 {
928  int rv = 0;
929 
930  /* *INDENT-OFF* */
931  REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
932  {
934  });
935  /* *INDENT-ON* */
936 }
937 
938 static void
940 {
942  lisp_adjacency_t *adjs = 0;
943  int rv = 0;
944  u32 size = ~0;
945  u32 vni = clib_net_to_host_u32 (mp->vni);
946 
948  size = vec_len (adjs) * sizeof (vl_api_lisp_adjacency_t);
949 
950  /* *INDENT-OFF* */
951  REPLY_MACRO4 (VL_API_LISP_ADJACENCIES_GET_REPLY, size,
952  {
953  rmp->count = clib_host_to_net_u32 (vec_len (adjs));
954  lisp_adjacency_copy (rmp->adjacencies, adjs);
955  });
956  /* *INDENT-ON* */
957 
958  vec_free (adjs);
959 }
960 
961 static void
963  mp)
964 {
965  hash_pair_t *p;
966  u32 *vnis = 0;
967  vl_api_registration_t *reg = 0;
969 
971  if (!reg)
972  return;
973 
974  /* *INDENT-OFF* */
976  ({
977  hash_set (vnis, p->key, 0);
978  }));
979 
981  ({
982  hash_set (vnis, p->key, 0);
983  }));
984 
985  hash_foreach_pair (p, vnis,
986  ({
987  send_eid_table_vni (p->key, reg, mp->context);
988  }));
989  /* *INDENT-ON* */
990 
991  hash_free (vnis);
992 }
993 
994 static void
996 {
998  int rv = 0;
999 
1000  /* *INDENT-OFF* */
1001  REPLY_MACRO2(VL_API_SHOW_LISP_STATUS_REPLY,
1002  ({
1005  }));
1006  /* *INDENT-ON* */
1007 }
1008 
1009 static void
1012 {
1015  locator_set_t *loc_set = 0;
1016  u8 *tmp_str = 0;
1017  int rv = 0;
1018 
1019  if (~0 == lcm->mreq_itr_rlocs)
1020  {
1021  tmp_str = format (0, " ");
1022  }
1023  else
1024  {
1025  loc_set =
1027  tmp_str = format (0, "%s", loc_set->name);
1028  }
1029 
1030  /* *INDENT-OFF* */
1031  REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1032  ({
1033  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1034  ARRAY_LEN(rmp->locator_set_name) - 1);
1035  }));
1036  /* *INDENT-ON* */
1037 
1038  vec_free (tmp_str);
1039 }
1040 
1041 static void
1043 {
1044  vl_api_show_lisp_pitr_reply_t *rmp = NULL;
1046  mapping_t *m;
1047  locator_set_t *ls = 0;
1048  u8 *tmp_str = 0;
1049  int rv = 0;
1050 
1051  u8 is_enabled = (lcm->flags & LISP_FLAG_PITR_MODE)
1052  && lcm->pitr_map_index != ~0;
1053 
1054  if (!is_enabled)
1055  {
1056  tmp_str = format (0, "N/A");
1057  }
1058  else
1059  {
1061  if (~0 != m->locator_set_index)
1062  {
1063  ls =
1065  tmp_str = format (0, "%s", ls->name);
1066  }
1067  else
1068  {
1069  tmp_str = format (0, "N/A");
1070  }
1071  }
1072  vec_add1 (tmp_str, 0);
1073 
1074  /* *INDENT-OFF* */
1075  REPLY_MACRO2(VL_API_SHOW_LISP_PITR_REPLY,
1076  ({
1077  rmp->is_enabled = lcm->flags & LISP_FLAG_PITR_MODE;
1078  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1079  ARRAY_LEN(rmp->locator_set_name) - 1);
1080  }));
1081  /* *INDENT-ON* */
1082 }
1083 
1084 /*
1085  * lisp_api_hookup
1086  * Add vpe's API message handlers to the table.
1087  * vlib has already mapped shared memory and
1088  * added the client registration handlers.
1089  * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
1090  */
1091 #define vl_msg_name_crc_list
1092 #include <vnet/vnet_all_api_h.h>
1093 #undef vl_msg_name_crc_list
1094 
1095 static void
1097 {
1098 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
1099  foreach_vl_msg_name_crc_lisp;
1100 #undef _
1101 }
1102 
1103 static clib_error_t *
1105 {
1106  api_main_t *am = vlibapi_get_main ();
1107 
1108 #define _(N,n) \
1109  vl_msg_api_set_handlers(VL_API_##N, #n, \
1110  vl_api_##n##_t_handler, \
1111  vl_noop_handler, \
1112  vl_api_##n##_t_endian, \
1113  vl_api_##n##_t_print, \
1114  sizeof(vl_api_##n##_t), 1);
1116 #undef _
1117 
1118  /*
1119  * Set up the (msg_name, crc, message-id) table
1120  */
1122 
1123  return 0;
1124 }
1125 
1127 
1128 /*
1129  * fd.io coding-style-patch-verification: ON
1130  *
1131  * Local Variables:
1132  * eval: (c-set-style "gnu")
1133  * End:
1134  */
Reply for show_lisp_map_register_state.
Definition: lisp.api:242
static void send_lisp_eid_table_details(mapping_t *mapit, vl_api_registration_t *reg, u32 context, u8 filter)
Definition: lisp_api.c:655
vl_api_local_locator_t locators[locator_num]
Definition: lisp.api:36
static void send_eid_table_map_pair(hash_pair_t *p, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:831
u16 vni
Definition: flow_types.api:160
u32 pitr_map_index
Definition: control.h:251
gid_address_t leid
Definition: control.h:74
void lisp_gid_put_api(vl_api_eid_t *eid, const gid_address_t *gid)
LISP locator_set status.
Definition: lisp.api:390
enable/disable LISP RLOC probing
Definition: lisp.api:209
#define gid_address_type(_a)
Definition: lisp_types.h:203
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
Definition: ip_types_api.c:216
a
Definition: bitmap.h:538
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
Definition: lisp_gpe.c:184
#define ntohs(x)
Definition: af_xdp.bpf.c:29
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:1011
lisp_msmr_t * map_resolvers
Definition: control.h:221
VLIB_API_INIT_FUNCTION(lisp_api_hookup)
configure or disable LISP PITR node
Definition: lisp.api:137
Reply for locator_set add/del.
Definition: lisp.api:44
#define REPLY_MACRO4(t, n, body)
LISP map resolver status.
Definition: lisp.api:570
vl_api_lisp_adjacency_t adjacencies[count]
Definition: lisp.api:509
uword * table_id_by_vni
Definition: control.h:240
#define REPLY_MACRO2(t, body)
vl_api_interface_index_t sw_if_index
Definition: lisp.api:66
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void lisp_adjacency_copy(vl_api_lisp_adjacency_t *dst, lisp_adjacency_t *adjs)
Definition: lisp_api.c:890
vl_api_address_t ip_address
Definition: lisp.api:573
locator_t * locator_pool
Definition: control.h:178
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
static void send_lisp_map_resolver_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:798
u8 vnet_lisp_get_map_request_mode(void)
Definition: control.c:57
static void vl_api_lisp_add_del_map_server_t_handler(vl_api_lisp_add_del_map_server_t *mp)
Definition: lisp_api.c:267
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
Definition: vec.h:1090
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:592
LISP locator_set status.
Definition: lisp.api:405
bool is_add[default=true]
Definition: lisp.api:64
vlib_main_t * vm
Definition: in2out_ed.c:1582
Request for lisp_eid_table_map_details.
Definition: lisp.api:540
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
configure or disable use of PETR
Definition: lisp.api:151
static void vl_api_lisp_pitr_set_locator_set_t_handler(vl_api_lisp_pitr_set_locator_set_t *mp)
Definition: lisp_api.c:359
Request for LISP PETR status.
Definition: lisp.api:163
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:527
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:257
static void vl_api_lisp_add_del_locator_set_t_handler(vl_api_lisp_add_del_locator_set_t *mp)
Definition: lisp_api.c:118
ip_address_t address
Definition: control.h:89
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:1230
static void vl_api_lisp_locator_dump_t_handler(vl_api_lisp_locator_dump_t *mp)
Definition: lisp_api.c:554
bool is_add[default=true]
Definition: lisp.api:324
void * vl_msg_api_alloc(int nbytes)
vhost_vring_addr_t addr
Definition: vhost_user.h:111
unsigned char u8
Definition: types.h:56
u8 vnet_lisp_map_register_state_get(void)
Definition: control.c:376
int vnet_lisp_set_map_request_mode(u8 mode)
Definition: control.c:1510
Reply for show_lisp_map_request_mode.
Definition: lisp.api:277
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:1439
Request for map resolver summary status.
Definition: lisp.api:580
static void vl_api_lisp_map_register_enable_disable_t_handler(vl_api_lisp_map_register_enable_disable_t *mp)
Definition: lisp_api.c:302
uword value[0]
Definition: hash.h:165
lisp_msmr_t * map_servers
Definition: control.h:224
add or delete LISP adjacency adjacency
Definition: lisp.api:320
bool is_add[default=true]
Definition: lisp.api:101
#define foreach_vpe_api_msg
Definition: lisp_api.c:60
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:513
static void vl_api_lisp_rloc_probe_enable_disable_t_handler(vl_api_lisp_rloc_probe_enable_disable_t *mp)
Definition: lisp_api.c:313
static void vl_api_lisp_add_del_remote_mapping_t_handler(vl_api_lisp_add_del_remote_mapping_t *mp)
Definition: lisp_api.c:448
u8 * key
Definition: lisp_types.h:315
#define gid_address_sd_src(_a)
Definition: lisp_types.h:220
static void vl_api_show_lisp_map_register_state_t_handler(vl_api_show_lisp_map_register_state_t *mp)
Definition: lisp_api.c:925
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void vl_api_lisp_adjacencies_get_t_handler(vl_api_lisp_adjacencies_get_t *mp)
Definition: lisp_api.c:939
bool is_add[default=true]
Definition: lisp.api:360
Get LISP map request itr rlocs status.
Definition: lisp.api:632
Reply for show_lisp_rloc_probe_state.
Definition: lisp.api:197
add or delete map request itr rlocs
Definition: lisp.api:336
typedef eid
Definition: lisp_types.api:59
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
Definition: control.c:1036
unsigned int u32
Definition: types.h:88
uword * bd_id_by_vni
Definition: control.h:244
static lisp_cp_main_t * vnet_lisp_cp_get_main()
Definition: control.h:305
u32 petr_map_index
Proxy ETR map index used for &#39;use-petr&#39;.
Definition: control.h:255
static void vl_api_lisp_use_petr_t_handler(vl_api_lisp_use_petr_t *mp)
Definition: lisp_api.c:376
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
Definition: control.c:2206
static void vl_api_show_lisp_pitr_t_handler(vl_api_show_lisp_pitr_t *mp)
Definition: lisp_api.c:1042
vl_api_hmac_key_t key
Definition: lisp.api:88
Get state of LISP map-register.
Definition: lisp.api:232
Get state of LISP RLOC probing.
Definition: lisp.api:186
vl_api_hmac_key_t key
Definition: lisp.api:462
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
Definition: control.c:1582
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:534
u8 vnet_lisp_rloc_probe_state_get(void)
Definition: control.c:383
set LISP map-request mode.
Definition: lisp.api:255
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:837
Request for LISP adjacencies.
Definition: lisp.api:517
u32 size
Definition: vhost_user.h:106
#define hash_free(h)
Definition: hash.h:310
void gid_address_free(gid_address_t *a)
Definition: lisp_types.c:733
u8 authoritative
Definition: lisp_types.h:305
add or delete lisp eid-table
Definition: lisp.api:80
LISP adjacency reply.
Definition: lisp.api:504
#define REPLY_MACRO(t)
static void vl_api_lisp_map_server_dump_t_handler(vl_api_lisp_map_server_dump_t *mp)
Definition: lisp_api.c:781
static void vl_api_lisp_add_del_adjacency_t_handler(vl_api_lisp_add_del_adjacency_t *mp)
Definition: lisp_api.c:505
vl_api_address_t dst
Definition: gre.api:55
LISP PETR status, enable or disable.
Definition: lisp.api:174
API main structure, used by both vpp and binary API clients.
Definition: api_common.h:227
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
Definition: control.c:579
bool is_petr_enable[default=true]
Definition: lisp.api:178
string locator_set_name[64]
Definition: lisp.api:65
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
Definition: ip_types_api.c:166
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
#define BAD_SW_IF_INDEX_LABEL
u32 sw_if_index
Definition: lisp_types.h:266
Request for lisp-gpe protocol status.
Definition: lisp.api:609
vl_api_address_t ip_address
Definition: lisp.api:155
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
Definition: control.c:2341
enable or disable LISP feature
Definition: lisp.api:124
bool is_add[default=true]
Definition: lisp.api:115
Shows relationship between vni and vrf/bd.
Definition: lisp.api:528
bool is_add[default=true]
Definition: lisp.api:156
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:317
static void vl_api_show_lisp_status_t_handler(vl_api_show_lisp_status_t *mp)
Definition: lisp_api.c:995
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:380
#define clib_warning(format, args...)
Definition: error.h:59
u32 locator_set_index
Definition: lisp_types.h:298
static void vl_api_lisp_locator_set_dump_t_handler(vl_api_lisp_locator_set_dump_t *mp)
Definition: lisp_api.c:628
int vnet_lisp_map_register_enable_disable(u8 is_enable)
Definition: control.c:2140
add or delete map-resolver
Definition: lisp.api:111
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:299
#define ARRAY_LEN(x)
Definition: clib.h:67
lisp_key_type_t key_id
Definition: lisp_types.h:316
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Definition: api.h:79
Request for map lisp locator status.
Definition: lisp.api:373
string name[64]
Definition: ip.api:44
u8 vnet_lisp_enable_disable_status(void)
Definition: control.c:2271
vl_api_lisp_locator_set_filter_t filter
Definition: lisp.api:427
struct _gid_address_t gid_address_t
Dump lisp eid-table.
Definition: lisp.api:450
vl_api_address_t ip_address
Definition: lisp.api:592
static clib_error_t * lisp_api_hookup(vlib_main_t *vm)
Definition: lisp_api.c:1104
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
Definition: control.c:633
#define ASSERT(truth)
Request for eid table summary status.
Definition: lisp.api:479
enable/disable LISP map-register
Definition: lisp.api:221
int vnet_lisp_clear_all_remote_adjacencies(void)
Definition: control.c:1388
Request for locator_set summary status.
Definition: lisp.api:423
#define gid_address_sd_dst(_a)
Definition: lisp_types.h:221
static void vl_api_show_lisp_use_petr_t_handler(vl_api_show_lisp_use_petr_t *mp)
Definition: lisp_api.c:389
Reply for lisp_add_del_map_request_itr_rlocs.
Definition: lisp.api:356
static void send_lisp_map_server_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:765
gid_dictionary_t mapping_index_by_gid
Definition: control.h:169
vl_api_address_t ip_address
Definition: lisp.api:179
locator_set_t * locator_set_pool
Definition: control.h:181
Status of lisp pitr, enable or disable.
Definition: lisp.api:662
static void vl_api_lisp_map_resolver_dump_t_handler(vl_api_lisp_map_resolver_dump_t *mp)
Definition: lisp_api.c:814
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
Definition: control.c:2131
add or delete locator_set
Definition: lisp.api:29
vl_api_remote_locator_t rlocs[rloc_num]
Definition: lisp.api:309
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:425
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
bool is_add[default=true]
Definition: lisp.api:141
vl_api_address_t ip_address
Definition: lisp.api:116
void lisp_fid_put_api(vl_api_eid_t *eid, const fid_address_t *fid)
static void vl_api_lisp_add_del_local_eid_t_handler(vl_api_lisp_add_del_local_eid_t *mp)
Definition: lisp_api.c:206
bool is_add[default=true]
Definition: lisp.api:84
typedef key
Definition: ipsec_types.api:85
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
Definition: control.c:1996
#define gid_address_ip(_a)
Definition: lisp_types.h:206
Status of lisp, enable or disable.
Definition: lisp.api:620
#define gid_address_vni(_a)
Definition: lisp_types.h:213
vl_api_interface_index_t sw_if_index
Definition: lisp.api:394
Request for map server summary status.
Definition: lisp.api:599
static void vl_api_lisp_eid_table_dump_t_handler(vl_api_lisp_eid_table_dump_t *mp)
Definition: lisp_api.c:726
static void vl_api_show_lisp_map_request_mode_t_handler(vl_api_show_lisp_map_request_mode_t *mp)
Definition: lisp_api.c:334
vl_api_address_t ip
Definition: l2.api:501
static locator_t * unformat_lisp_locs(vl_api_remote_locator_t *rmt_locs, u32 rloc_num)
Definition: lisp_api.c:94
static void send_eid_table_vni(u32 vni, vl_api_registration_t *reg, u32 context)
Definition: lisp_api.c:877
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
Definition: hash.h:373
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:597
vl_api_address_t ip_address
Definition: lisp.api:395
add or delete locator for locator_set
Definition: lisp.api:60
u64 uword
Definition: types.h:112
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
Definition: control.c:1339
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:1892
mapping_t * mapping_pool
Definition: control.h:172
u8 ip_address_max_len(u8 version)
Definition: lisp_types.c:432
uword * locator_set_index_by_name
Definition: control.h:187
add or delete remote static mapping
Definition: lisp.api:297
static void setup_message_id_table(api_main_t *am)
Definition: lisp_api.c:1096
static void vl_api_lisp_map_request_mode_t_handler(vl_api_lisp_map_request_mode_t *mp)
Definition: lisp_api.c:348
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
Definition: lisp_types.c:1203
gid_address_t eid
Definition: lisp_types.h:293
gid_address_t reid
Definition: control.h:75
gid_address_t address
Definition: lisp_types.h:267
#define hash_get_mem(h, key)
Definition: hash.h:269
LISP map server details.
Definition: lisp.api:589
static api_main_t * vlibapi_get_main(void)
Definition: api_common.h:389
static void vl_api_lisp_enable_disable_t_handler(vl_api_lisp_enable_disable_t *mp)
Definition: lisp_api.c:323
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
Definition: control.c:2278
bool is_enable[default=true]
Definition: lisp.api:128
static void vl_api_lisp_eid_table_vni_dump_t_handler(vl_api_lisp_eid_table_vni_dump_t *mp)
Definition: lisp_api.c:962
#define vec_foreach(var, vec)
Vector iterator.
Dumps all VNIs used in mappings.
Definition: lisp.api:551
vl_api_address_t ip_address
Definition: lisp.api:102
Request for map request itr rlocs summary status.
Definition: lisp.api:640
static void vl_api_lisp_add_del_locator_t_handler(vl_api_lisp_add_del_locator_t *mp)
Definition: lisp_api.c:170
Request for LISP map-request mode.
Definition: lisp.api:266
static void vl_api_show_lisp_rloc_probe_state_t_handler(vl_api_show_lisp_rloc_probe_state_t *mp)
Definition: lisp_api.c:910
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
Definition: control.c:1649
reply to lisp_eid_table_vni_dump
Definition: lisp.api:561
u32 mreq_itr_rlocs
Definition: control.h:237
bool is_add[default=true]
Definition: lisp.api:33
u32 * locator_indices
Definition: lisp_types.h:287
int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, const vl_api_eid_t *eid)
uword key
Definition: hash.h:162
LISP-GPE definitions.
static void vl_api_lisp_eid_table_map_dump_t_handler(vl_api_lisp_eid_table_map_dump_t *mp)
Definition: lisp_api.c:847
Request for lisp pitr status.
Definition: lisp.api:651
Add/delete map server.
Definition: lisp.api:97
#define VALIDATE_SW_IF_INDEX(mp)
static void vl_api_lisp_add_del_map_resolver_t_handler(vl_api_lisp_add_del_map_resolver_t *mp)
Definition: lisp_api.c:283