FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
one_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * one_api.c - Overlay Network Engine API
4  *
5  * Copyright (c) 2016-2017 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 
28 #include <vnet/ip/ip_types_api.h>
30 
31 #include <vnet/vnet_msg_enum.h>
32 
33 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler
34 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler
35 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler
36 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler
37 
38 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler
39 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler
40 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler
41 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler
42 
43 #define vl_api_one_add_del_l2_arp_entry vl_noop_handler
44 #define vl_api_one_l2_arp_bd_get vl_noop_handler
45 
46 #define vl_api_one_ndp_entries_get_reply_t_endian vl_noop_handler
47 #define vl_api_one_ndp_entries_get_reply_t_print vl_noop_handler
48 
49 #define vl_typedefs /* define message structures */
50 #include <vnet/vnet_all_api_h.h>
51 #undef vl_typedefs
52 
53 #define vl_endianfun /* define message structures */
54 #include <vnet/vnet_all_api_h.h>
55 #undef vl_endianfun
56 
57 /* instantiate all the print functions we know about */
58 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
59 #define vl_printfun
60 #include <vnet/vnet_all_api_h.h>
61 #undef vl_printfun
62 
64 
65 #define REPLY_DETAILS(t, body) \
66 do { \
67  vl_api_registration_t * reg; \
68  rv = vl_msg_api_pd_handler (mp, rv); \
69  reg = vl_api_client_index_to_registration (mp->client_index); \
70  if (!reg) \
71  return; \
72  \
73  rmp = vl_msg_api_alloc (sizeof (*rmp)); \
74  rmp->_vl_msg_id = ntohs((t)); \
75  rmp->context = mp->context; \
76  do {body;} while (0); \
77  vl_api_send_msg (reg, (u8 *)&rmp); \
78 } while(0);
79 
80 #define foreach_vpe_api_msg \
81 _(ONE_ADD_DEL_LOCATOR_SET, one_add_del_locator_set) \
82 _(ONE_ADD_DEL_LOCATOR, one_add_del_locator) \
83 _(ONE_ADD_DEL_LOCAL_EID, one_add_del_local_eid) \
84 _(ONE_ADD_DEL_MAP_RESOLVER, one_add_del_map_resolver) \
85 _(ONE_ADD_DEL_MAP_SERVER, one_add_del_map_server) \
86 _(ONE_ENABLE_DISABLE, one_enable_disable) \
87 _(ONE_RLOC_PROBE_ENABLE_DISABLE, one_rloc_probe_enable_disable) \
88 _(ONE_MAP_REGISTER_ENABLE_DISABLE, one_map_register_enable_disable) \
89 _(ONE_MAP_REGISTER_FALLBACK_THRESHOLD, \
90  one_map_register_fallback_threshold) \
91 _(ONE_ADD_DEL_REMOTE_MAPPING, one_add_del_remote_mapping) \
92 _(ONE_ADD_DEL_ADJACENCY, one_add_del_adjacency) \
93 _(ONE_PITR_SET_LOCATOR_SET, one_pitr_set_locator_set) \
94 _(ONE_NSH_SET_LOCATOR_SET, one_nsh_set_locator_set) \
95 _(ONE_MAP_REQUEST_MODE, one_map_request_mode) \
96 _(ONE_EID_TABLE_ADD_DEL_MAP, one_eid_table_add_del_map) \
97 _(ONE_LOCATOR_SET_DUMP, one_locator_set_dump) \
98 _(ONE_LOCATOR_DUMP, one_locator_dump) \
99 _(ONE_EID_TABLE_DUMP, one_eid_table_dump) \
100 _(ONE_MAP_RESOLVER_DUMP, one_map_resolver_dump) \
101 _(ONE_MAP_SERVER_DUMP, one_map_server_dump) \
102 _(ONE_EID_TABLE_MAP_DUMP, one_eid_table_map_dump) \
103 _(ONE_EID_TABLE_VNI_DUMP, one_eid_table_vni_dump) \
104 _(ONE_ADJACENCIES_GET, one_adjacencies_get) \
105 _(ONE_MAP_REGISTER_SET_TTL, one_map_register_set_ttl) \
106 _(SHOW_ONE_NSH_MAPPING, show_one_nsh_mapping) \
107 _(SHOW_ONE_RLOC_PROBE_STATE, show_one_rloc_probe_state) \
108 _(SHOW_ONE_MAP_REGISTER_STATE, show_one_map_register_state) \
109 _(SHOW_ONE_MAP_REGISTER_TTL, show_one_map_register_ttl) \
110 _(SHOW_ONE_MAP_REGISTER_FALLBACK_THRESHOLD, \
111  show_one_map_register_fallback_threshold) \
112 _(SHOW_ONE_STATUS, show_one_status) \
113 _(ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \
114  one_add_del_map_request_itr_rlocs) \
115 _(ONE_GET_MAP_REQUEST_ITR_RLOCS, one_get_map_request_itr_rlocs) \
116 _(SHOW_ONE_PITR, show_one_pitr) \
117 _(SHOW_ONE_MAP_REQUEST_MODE, show_one_map_request_mode) \
118 _(ONE_USE_PETR, one_use_petr) \
119 _(SHOW_ONE_USE_PETR, show_one_use_petr) \
120 _(SHOW_ONE_STATS_ENABLE_DISABLE, show_one_stats_enable_disable) \
121 _(ONE_STATS_ENABLE_DISABLE, one_stats_enable_disable) \
122 _(ONE_STATS_DUMP, one_stats_dump) \
123 _(ONE_STATS_FLUSH, one_stats_flush) \
124 _(ONE_L2_ARP_BD_GET, one_l2_arp_bd_get) \
125 _(ONE_L2_ARP_ENTRIES_GET, one_l2_arp_entries_get) \
126 _(ONE_ADD_DEL_L2_ARP_ENTRY, one_add_del_l2_arp_entry) \
127 _(ONE_ADD_DEL_NDP_ENTRY, one_add_del_ndp_entry) \
128 _(ONE_NDP_BD_GET, one_ndp_bd_get) \
129 _(ONE_NDP_ENTRIES_GET, one_ndp_entries_get) \
130 _(ONE_SET_TRANSPORT_PROTOCOL, one_set_transport_protocol) \
131 _(ONE_GET_TRANSPORT_PROTOCOL, one_get_transport_protocol) \
132 _(ONE_ENABLE_DISABLE_XTR_MODE, one_enable_disable_xtr_mode) \
133 _(ONE_SHOW_XTR_MODE, one_show_xtr_mode) \
134 _(ONE_ENABLE_DISABLE_PITR_MODE, one_enable_disable_pitr_mode) \
135 _(ONE_SHOW_PITR_MODE, one_show_pitr_mode) \
136 _(ONE_ENABLE_DISABLE_PETR_MODE, one_enable_disable_petr_mode) \
137 _(ONE_SHOW_PETR_MODE, one_show_petr_mode) \
138 
139 
140 static locator_t *
141 unformat_one_locs (vl_api_remote_locator_t * rmt_locs, u32 rloc_num)
142 {
143  u32 i;
144  locator_t *locs = 0, loc;
145  vl_api_remote_locator_t *r;
146 
147  for (i = 0; i < rloc_num; i++)
148  {
149  /* remote locators */
150  r = &rmt_locs[i];
151  clib_memset (&loc, 0, sizeof (loc));
152  ip_address_decode2 (&r->ip_address, &loc.address.ippref.addr);
153  loc.address.ippref.len =
154  ip_address_max_len (loc.address.ippref.addr.version);
155 
156  loc.priority = r->priority;
157  loc.weight = r->weight;
158 
159  vec_add1 (locs, loc);
160  }
161  return locs;
162 }
163 
164 static void
166  mp)
167 {
168  vl_api_one_map_register_set_ttl_reply_t *rmp;
169  int rv = 0;
170 
171  mp->ttl = clib_net_to_host_u32 (mp->ttl);
173 
174  REPLY_MACRO (VL_API_ONE_MAP_REGISTER_SET_TTL_REPLY);
175 }
176 
177 static void
180 {
182  int rv = 0;
183 
185  /* *INDENT-OFF* */
186  REPLY_MACRO2 (VL_API_SHOW_ONE_MAP_REGISTER_TTL_REPLY,
187  ({
188  rmp->ttl = clib_host_to_net_u32 (ttl);
189  }));
190  /* *INDENT-ON* */
191 }
192 
193 static void
195  mp)
196 {
198  int rv = 0;
200  locator_t locator;
201  vl_api_local_locator_t *ls_loc;
202  u32 ls_index = ~0, locator_num;
203  u8 *locator_name = NULL;
204  int i;
205 
206  clib_memset (a, 0, sizeof (a[0]));
207 
208  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
209  locator_name = format (0, "%s", mp->locator_set_name);
210  vec_terminate_c_string (locator_name);
211 
212  a->name = locator_name;
213  a->is_add = mp->is_add;
214  a->local = 1;
215  locator_num = clib_net_to_host_u32 (mp->locator_num);
216 
217  clib_memset (&locator, 0, sizeof (locator));
218  for (i = 0; i < locator_num; i++)
219  {
220  ls_loc = &mp->locators[i];
221  VALIDATE_SW_IF_INDEX (ls_loc);
222 
223  locator.sw_if_index = htonl (ls_loc->sw_if_index);
224  locator.priority = ls_loc->priority;
225  locator.weight = ls_loc->weight;
226  locator.local = 1;
227  vec_add1 (a->locators, locator);
228  }
229 
230  rv = vnet_lisp_add_del_locator_set (a, &ls_index);
231 
233 
234  vec_free (locator_name);
235  vec_free (a->locators);
236 
237  /* *INDENT-OFF* */
238  REPLY_MACRO2 (VL_API_ONE_ADD_DEL_LOCATOR_SET_REPLY,
239  ({
240  rmp->ls_index = clib_host_to_net_u32 (ls_index);
241  }));
242  /* *INDENT-ON* */
243 }
244 
245 static void
247 {
248  vl_api_one_add_del_locator_reply_t *rmp;
249  int rv = 0;
250  locator_t locator, *locators = NULL;
252  u32 ls_index = ~0;
253  u8 *locator_name = NULL;
254 
255  clib_memset (&locator, 0, sizeof (locator));
256  clib_memset (a, 0, sizeof (a[0]));
257 
258  locator.sw_if_index = ntohl (mp->sw_if_index);
259  locator.priority = mp->priority;
260  locator.weight = mp->weight;
261  locator.local = 1;
262  vec_add1 (locators, locator);
263 
264  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
265  locator_name = format (0, "%s", mp->locator_set_name);
266  vec_terminate_c_string (locator_name);
267 
268  a->name = locator_name;
269  a->locators = locators;
270  a->is_add = mp->is_add;
271  a->local = 1;
272 
273  rv = vnet_lisp_add_del_locator (a, NULL, &ls_index);
274 
275  vec_free (locators);
276  vec_free (locator_name);
277 
278  REPLY_MACRO (VL_API_ONE_ADD_DEL_LOCATOR_REPLY);
279 }
280 
281 typedef struct
282 {
285 } __attribute__ ((__packed__)) lisp_nsh_api_t;
286 
287 static int
289 {
291 
292  switch (eid->type)
293  {
294  case EID_TYPE_API_PREFIX:
295  ip_prefix_decode (&eid->address.prefix, &prefix);
297  if (prefix.fp_proto == FIB_PROTOCOL_IP4)
298  gid_address_ip_set (dst, &prefix.fp_addr.ip4, AF_IP4);
299  if (prefix.fp_proto == FIB_PROTOCOL_IP6)
300  gid_address_ip_set (dst, &prefix.fp_addr.ip6, AF_IP6);
301  gid_address_ippref_len (dst) = prefix.fp_len;
303  break;
304  case EID_TYPE_API_MAC:
306  mac_address_decode (eid->address.mac,
307  (mac_address_t *) & gid_address_mac (dst));
308  break;
309  case EID_TYPE_API_NSH:
311  gid_address_nsh_spi (dst) = clib_net_to_host_u32 (eid->address.nsh.spi);
312  gid_address_nsh_si (dst) = eid->address.nsh.si;
313  break;
314  default:
315  /* unknown type */
316  return VNET_API_ERROR_INVALID_VALUE;
317  }
318 
319  gid_address_vni (dst) = vni;
320 
321  return 0;
322 }
323 
324 static void
325 fid_to_api_eid (fid_address_t * fid, vl_api_eid_t * eid)
326 {
327  fib_prefix_t fib_prefix;
328  u32 eid_type;
329 
330  switch (fid_addr_type (fid))
331  {
332  case FID_ADDR_IP_PREF:
333  eid_type = EID_TYPE_API_PREFIX;
334  ip_prefix_to_fib_prefix (&fid_addr_ippref (fid), &fib_prefix);
335  ip_prefix_encode (&fib_prefix, &eid->address.prefix);
336  break;
337  case FID_ADDR_MAC:
338  eid_type = EID_TYPE_API_MAC;
340  eid->address.mac);
341  break;
342  default:
343  /* unknown type */
344  return;
345  }
346 
347  eid->type = eid_type;
348 }
349 
350 static void
352 {
353  vl_api_one_add_del_local_eid_reply_t *rmp;
355  int rv = 0;
356  gid_address_t _eid, *eid = &_eid;
357  uword *p = NULL;
358  u32 locator_set_index = ~0, map_index = ~0;
360  u8 *name = NULL, *key = NULL;
361  clib_memset (a, 0, sizeof (a[0]));
362  clib_memset (eid, 0, sizeof (eid[0]));
363 
364  rv = unformat_one_eid_api (eid, clib_net_to_host_u32 (mp->vni), &mp->eid);
365  if (rv)
366  goto out;
367 
368  if (gid_address_type (eid) == GID_ADDR_NSH)
369  {
370  rv = VNET_API_ERROR_INVALID_VALUE;
371  goto out;
372  }
373 
374  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
375  name = format (0, "%s", mp->locator_set_name);
376  vec_terminate_c_string (name);
377  p = hash_get_mem (lcm->locator_set_index_by_name, name);
378  if (!p)
379  {
380  rv = VNET_API_ERROR_INVALID_VALUE;
381  goto out;
382  }
383  locator_set_index = p[0];
384 
385  if (mp->key.id != KEY_ID_API_HMAC_NO_KEY)
386  key = format (0, "%s", mp->key.key);
387 
388  /* XXX treat batch configuration */
389  a->is_add = mp->is_add;
390  gid_address_copy (&a->eid, eid);
391  a->locator_set_index = locator_set_index;
392  a->local = 1;
393  a->key = key;
394  a->key_id = mp->key.id;
395 
396  rv = vnet_lisp_add_del_local_mapping (a, &map_index);
397 
398 out:
399  vec_free (name);
400  vec_free (key);
401  gid_address_free (&a->eid);
402 
403  REPLY_MACRO (VL_API_ONE_ADD_DEL_LOCAL_EID_REPLY);
404 }
405 
406 static void
409 {
410  vl_api_one_eid_table_add_del_map_reply_t *rmp;
411  int rv = 0;
412  rv = vnet_lisp_eid_table_map (clib_net_to_host_u32 (mp->vni),
413  clib_net_to_host_u32 (mp->dp_table),
414  mp->is_l2, mp->is_add);
415 REPLY_MACRO (VL_API_ONE_EID_TABLE_ADD_DEL_MAP_REPLY)}
416 
417 static void
419 {
420  vl_api_one_add_del_map_server_reply_t *rmp;
421  int rv = 0;
423 
424  clib_memset (&addr, 0, sizeof (addr));
425 
426  ip_address_decode2 (&mp->ip_address, &addr);
427 
428  rv = vnet_lisp_add_del_map_server (&addr, mp->is_add);
429 
430  REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_SERVER_REPLY);
431 }
432 
433 static void
435  * mp)
436 {
437  vl_api_one_add_del_map_resolver_reply_t *rmp;
438  int rv = 0;
440 
441  clib_memset (a, 0, sizeof (a[0]));
442 
444 
445  a->is_add = mp->is_add;
446 
448 
449  REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_RESOLVER_REPLY);
450 }
451 
452 static void
455 {
456  vl_api_one_map_register_enable_disable_reply_t *rmp;
457  int rv = 0;
458 
460  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_REPLY);
461 }
462 
463 static void
466 {
467  vl_api_one_rloc_probe_enable_disable_reply_t *rmp;
468  int rv = 0;
469 
471  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_REPLY);
472 }
473 
474 static void
476 {
477  vl_api_one_enable_disable_reply_t *rmp;
478  int rv = 0;
479 
481  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_REPLY);
482 }
483 
484 static void
487 {
488  int rv = 0;
490 
491  /* *INDENT-OFF* */
492  REPLY_MACRO2(VL_API_SHOW_ONE_MAP_REQUEST_MODE_REPLY,
493  ({
495  }));
496  /* *INDENT-ON* */
497 }
498 
499 static void
501 {
502  vl_api_one_map_request_mode_reply_t *rmp;
503  int rv = 0;
504 
506 
507  REPLY_MACRO (VL_API_ONE_MAP_REQUEST_MODE_REPLY);
508 }
509 
510 static void
512  * mp)
513 {
514  vl_api_one_nsh_set_locator_set_reply_t *rmp;
515  int rv = 0;
516  u8 *ls_name = 0;
517 
518  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
519  ls_name = format (0, "%s", mp->ls_name);
520  vec_terminate_c_string (ls_name);
521  rv = vnet_lisp_nsh_set_locator_set (ls_name, mp->is_add);
522  vec_free (ls_name);
523 
524  REPLY_MACRO (VL_API_ONE_PITR_SET_LOCATOR_SET_REPLY);
525 }
526 
527 static void
529  * mp)
530 {
531  vl_api_one_pitr_set_locator_set_reply_t *rmp;
532  int rv = 0;
533  u8 *ls_name = 0;
534 
535  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
536  ls_name = format (0, "%s", mp->ls_name);
537  vec_terminate_c_string (ls_name);
538  rv = vnet_lisp_pitr_set_locator_set (ls_name, mp->is_add);
539  vec_free (ls_name);
540 
541  REPLY_MACRO (VL_API_ONE_PITR_SET_LOCATOR_SET_REPLY);
542 }
543 
544 static void
546 {
547  vl_api_one_use_petr_reply_t *rmp;
548  int rv = 0;
550 
551  ip_address_decode2 (&mp->ip_address, &addr);
552 
553  rv = vnet_lisp_use_petr (&addr, mp->is_add);
554 
555  REPLY_MACRO (VL_API_ONE_USE_PETR_REPLY);
556 }
557 
558 static void
560 {
563  mapping_t *m;
564  locator_set_t *ls = 0;
565  int rv = 0;
566  locator_t *loc = 0;
567  u8 status = 0;
569 
570  clib_memset (&addr, 0, sizeof (addr));
571  status = lcm->flags & LISP_FLAG_USE_PETR;
572  if (status)
573  {
575  if (~0 != m->locator_set_index)
576  {
577  ls =
579  loc = pool_elt_at_index (lcm->locator_pool, ls->locator_indices[0]);
580  gid_address_copy (&addr, &loc->address);
581  }
582  }
583 
584  /* *INDENT-OFF* */
585  REPLY_MACRO2 (VL_API_SHOW_ONE_USE_PETR_REPLY,
586  {
587  rmp->status = status;
588  ip_address_t *ip = &gid_address_ip (&addr);
589 
590  ip_address_encode2 (ip, &rmp->ip_address);
591  });
592  /* *INDENT-ON* */
593 }
594 
595 static void
598 {
599  vl_api_one_add_del_map_request_itr_rlocs_reply_t *rmp;
600  int rv = 0;
601  u8 *locator_set_name = NULL;
603 
604  mp->locator_set_name[sizeof (mp->locator_set_name) - 1] = 0;
605  locator_set_name = format (0, "%s", mp->locator_set_name);
606  vec_terminate_c_string (locator_set_name);
607 
608  a->is_add = mp->is_add;
609  a->locator_set_name = locator_set_name;
610 
612 
613  vec_free (locator_set_name);
614 
615  REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
616 }
617 
618 static void
621 {
622  locator_t *rlocs = 0;
623  vl_api_one_add_del_remote_mapping_reply_t *rmp;
624  int rv = 0;
625  gid_address_t _eid, *eid = &_eid;
626  u32 rloc_num = clib_net_to_host_u32 (mp->rloc_num);
627 
628  clib_memset (eid, 0, sizeof (eid[0]));
629 
630  rv = unformat_one_eid_api (eid, clib_net_to_host_u32 (mp->vni), &mp->deid);
631  if (rv)
632  goto send_reply;
633 
634  rlocs = unformat_one_locs (mp->rlocs, rloc_num);
635 
636  if (!mp->is_add)
637  {
639  clib_memset (a, 0, sizeof (a[0]));
640  gid_address_copy (&a->reid, eid);
641  a->is_add = 0;
643  if (rv)
644  {
645  goto out;
646  }
647  }
648 
649  /* NOTE: for now this works as a static remote mapping, i.e.,
650  * not authoritative and ttl infinite. */
651  if (mp->is_add)
652  {
653  vnet_lisp_add_del_mapping_args_t _m_args, *m_args = &_m_args;
654  clib_memset (m_args, 0, sizeof (m_args[0]));
655  gid_address_copy (&m_args->eid, eid);
656  m_args->action = mp->action;
657  m_args->is_static = 1;
658  m_args->ttl = ~0;
659  m_args->authoritative = 0;
660  rv = vnet_lisp_add_mapping (m_args, rlocs, NULL, NULL);
661  }
662  else
663  rv = vnet_lisp_del_mapping (eid, NULL);
664 
665  if (mp->del_all)
667 
668 out:
669  vec_free (rlocs);
670 send_reply:
671  REPLY_MACRO (VL_API_ONE_ADD_DEL_REMOTE_MAPPING_REPLY);
672 }
673 
674 static void
676 {
677  vl_api_one_add_del_adjacency_reply_t *rmp;
679 
680  int rv = 0;
681  clib_memset (a, 0, sizeof (a[0]));
682 
683  rv =
684  unformat_one_eid_api (&a->leid, clib_net_to_host_u32 (mp->vni),
685  &mp->leid);
686  rv |=
687  unformat_one_eid_api (&a->reid, clib_net_to_host_u32 (mp->vni),
688  &mp->reid);
689 
690  if (rv)
691  goto send_reply;
692 
693  a->is_add = mp->is_add;
695 
696 send_reply:
697  REPLY_MACRO (VL_API_ONE_ADD_DEL_ADJACENCY_REPLY);
698 }
699 
700 static void
702  locator_t * loc, vl_api_registration_t * reg,
703  u32 context)
704 {
706 
707  rmp = vl_msg_api_alloc (sizeof (*rmp));
708  clib_memset (rmp, 0, sizeof (*rmp));
709  rmp->_vl_msg_id = ntohs (VL_API_ONE_LOCATOR_DETAILS);
710  rmp->context = context;
711 
712  rmp->local = loc->local;
713  if (loc->local)
714  {
715  rmp->sw_if_index = ntohl (loc->sw_if_index);
716  }
717  else
718  {
719  ip_address_encode2 (&loc->address.ippref.addr, &rmp->ip_address);
720  }
721  rmp->priority = loc->priority;
722  rmp->weight = loc->weight;
723 
724  vl_api_send_msg (reg, (u8 *) rmp);
725 }
726 
727 static void
729 {
730  u8 *ls_name = 0;
733  locator_set_t *lsit = 0;
734  locator_t *loc = 0;
735  u32 ls_index = ~0, *locit = 0;
736  uword *p = 0;
737 
739  if (!reg)
740  return;
741 
742  if (mp->is_index_set)
743  ls_index = htonl (mp->ls_index);
744  else
745  {
746  /* make sure we get a proper C-string */
747  mp->ls_name[sizeof (mp->ls_name) - 1] = 0;
748  ls_name = format (0, "%s", mp->ls_name);
749  vec_terminate_c_string (ls_name);
750  p = hash_get_mem (lcm->locator_set_index_by_name, ls_name);
751  if (!p)
752  goto out;
753  ls_index = p[0];
754  }
755 
756  if (pool_is_free_index (lcm->locator_set_pool, ls_index))
757  return;
758 
759  lsit = pool_elt_at_index (lcm->locator_set_pool, ls_index);
760 
761  vec_foreach (locit, lsit->locator_indices)
762  {
763  loc = pool_elt_at_index (lcm->locator_pool, locit[0]);
764  send_one_locator_details (lcm, loc, reg, mp->context);
765  };
766 out:
767  vec_free (ls_name);
768 }
769 
770 static void
772  locator_set_t * lsit,
773  vl_api_registration_t * reg, u32 context,
774  u32 ls_index)
775 {
777  u8 *str = 0;
778 
779  rmp = vl_msg_api_alloc (sizeof (*rmp));
780  clib_memset (rmp, 0, sizeof (*rmp));
781  rmp->_vl_msg_id = ntohs (VL_API_ONE_LOCATOR_SET_DETAILS);
782  rmp->context = context;
783 
784  rmp->ls_index = htonl (ls_index);
785  if (lsit->local)
786  {
787  ASSERT (lsit->name != NULL);
788  strncpy ((char *) rmp->ls_name, (char *) lsit->name,
789  vec_len (lsit->name));
790  }
791  else
792  {
793  str = format (0, "<remote-%d>", ls_index);
794  strncpy ((char *) rmp->ls_name, (char *) str, vec_len (str));
795  vec_free (str);
796  }
797 
798  vl_api_send_msg (reg, (u8 *) rmp);
799 }
800 
801 static void
803 {
806  locator_set_t *lsit = NULL;
807  u8 filter;
808 
810  if (!reg)
811  return;
812 
813  filter = mp->filter;
814  /* *INDENT-OFF* */
815  pool_foreach (lsit, lcm->locator_set_pool,
816  ({
817  if (filter && !((1 == filter && lsit->local) ||
818  (2 == filter && !lsit->local)))
819  {
820  continue;
821  }
822  send_one_locator_set_details (lcm, lsit, reg, mp->context,
823  lsit - lcm->locator_set_pool);
824  }));
825  /* *INDENT-ON* */
826 }
827 
828 static void
830  vl_api_registration_t * reg, u32 context,
831  u8 filter)
832 {
834  locator_set_t *ls = 0;
835  vl_api_one_eid_table_details_t *rmp = NULL;
836  gid_address_t *gid = NULL;
837  u32 eid_type;
838  fib_prefix_t fib_prefix;
839 
840  if (mapit->pitr_set || mapit->nsh_set)
841  return;
842 
843  switch (filter)
844  {
845  case ONE_FILTER_API_ALL: /* all mappings */
846  break;
847 
848  case ONE_FILTER_API_LOCAL: /* local only */
849  if (!mapit->local)
850  return;
851  break;
852  case ONE_FILTER_API_REMOTE: /* remote only */
853  if (mapit->local)
854  return;
855  break;
856  default:
857  clib_warning ("Filter error, unknown filter: %d", filter);
858  return;
859  }
860 
861  gid = &mapit->eid;
862 
863  rmp = vl_msg_api_alloc (sizeof (*rmp));
864  clib_memset (rmp, 0, sizeof (*rmp));
865  rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_DETAILS);
866 
868  if (vec_len (ls->locator_indices) == 0)
869  rmp->locator_set_index = ~0;
870  else
871  rmp->locator_set_index = clib_host_to_net_u32 (mapit->locator_set_index);
872 
873  rmp->is_local = mapit->local;
874  rmp->ttl = clib_host_to_net_u32 (mapit->ttl);
875  rmp->action = mapit->action;
876  rmp->authoritative = mapit->authoritative;
877 
878  switch (gid_address_type (gid))
879  {
880  case GID_ADDR_SRC_DST:
881  fid_to_api_eid (&gid_address_sd_src (gid), &rmp->seid);
882  fid_to_api_eid (&gid_address_sd_dst (gid), &rmp->deid);
883  break;
884  case GID_ADDR_IP_PREFIX:
885  eid_type = EID_TYPE_API_PREFIX;
886  rmp->seid.type = eid_type;
887  ip_prefix_to_fib_prefix (&gid_address_ippref (gid), &fib_prefix);
888  ip_prefix_encode (&fib_prefix, &rmp->seid.address.prefix);
889  break;
890  case GID_ADDR_MAC:
891  eid_type = EID_TYPE_API_MAC;
892  rmp->seid.type = eid_type;
894  rmp->seid.address.mac);
895  break;
896  case GID_ADDR_NSH:
897  eid_type = EID_TYPE_API_NSH;
898  rmp->seid.type = eid_type;
899  rmp->seid.address.nsh.spi =
900  clib_host_to_net_u32 (gid_address_nsh_spi (gid));
901  rmp->seid.address.nsh.si = gid_address_nsh_si (gid);
902  break;
903  default:
904  /* unknown type */
905  return;
906  }
907 
908  rmp->context = context;
909  rmp->vni = clib_host_to_net_u32 (gid_address_vni (gid));
910  rmp->key.id = mapit->key_id;
911  memcpy (rmp->key.key, mapit->key, vec_len (mapit->key));
912  vl_api_send_msg (reg, (u8 *) rmp);
913 }
914 
915 static void
917 {
918  u32 mi;
921  mapping_t *mapit = NULL;
922  gid_address_t _eid, *eid = &_eid;
923 
925  if (!reg)
926  return;
927 
928  if (mp->eid_set)
929  {
930  clib_memset (eid, 0, sizeof (*eid));
931 
932  unformat_one_eid_api (eid, clib_net_to_host_u32 (mp->vni), &mp->eid);
933 
935  if ((u32) ~ 0 == mi)
936  return;
937 
938  mapit = pool_elt_at_index (lcm->mapping_pool, mi);
939  send_one_eid_table_details (mapit, reg, mp->context,
940  0 /* ignore filter */ );
941  }
942  else
943  {
944  /* *INDENT-OFF* */
945  pool_foreach (mapit, lcm->mapping_pool,
946  ({
947  send_one_eid_table_details(mapit, reg, mp->context,
948  mp->filter);
949  }));
950  /* *INDENT-ON* */
951  }
952 }
953 
954 static void
956  u32 context)
957 {
959 
960  rmp = vl_msg_api_alloc (sizeof (*rmp));
961  clib_memset (rmp, 0, sizeof (*rmp));
962  rmp->_vl_msg_id = ntohs (VL_API_ONE_MAP_SERVER_DETAILS);
963 
964 
965  ip_address_encode2 (ip, &rmp->ip_address);
966 
967  rmp->context = context;
968 
969  vl_api_send_msg (reg, (u8 *) rmp);
970 }
971 
972 static void
974 {
977  lisp_msmr_t *mr;
978 
980  if (!reg)
981  return;
982 
983  vec_foreach (mr, lcm->map_servers)
984  {
986  }
987 }
988 
989 static void
991  vl_api_registration_t * reg, u32 context)
992 {
994 
995  rmp = vl_msg_api_alloc (sizeof (*rmp));
996  clib_memset (rmp, 0, sizeof (*rmp));
997  rmp->_vl_msg_id = ntohs (VL_API_ONE_MAP_RESOLVER_DETAILS);
998 
999  ip_address_encode2 (ip, &rmp->ip_address);
1000  rmp->context = context;
1001 
1002  vl_api_send_msg (reg, (u8 *) rmp);
1003 }
1004 
1005 static void
1007 {
1008  vl_api_registration_t *reg;
1010  lisp_msmr_t *mr;
1011 
1013  if (!reg)
1014  return;
1015 
1016  vec_foreach (mr, lcm->map_resolvers)
1017  {
1019  }
1020 }
1021 
1022 static void
1024  u32 context)
1025 {
1027 
1028  rmp = vl_msg_api_alloc (sizeof (*rmp));
1029  clib_memset (rmp, 0, sizeof (*rmp));
1030  rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_MAP_DETAILS);
1031 
1032  rmp->vni = clib_host_to_net_u32 (p->key);
1033  rmp->dp_table = clib_host_to_net_u32 (p->value[0]);
1034  rmp->context = context;
1035  vl_api_send_msg (reg, (u8 *) rmp);
1036 }
1037 
1038 static void
1040 {
1041  vl_api_registration_t *reg;
1043  hash_pair_t *p;
1044  uword *vni_table = 0;
1045 
1047  if (!reg)
1048  return;
1049 
1050  if (mp->is_l2)
1051  {
1052  vni_table = lcm->bd_id_by_vni;
1053  }
1054  else
1055  {
1056  vni_table = lcm->table_id_by_vni;
1057  }
1058 
1059  /* *INDENT-OFF* */
1060  hash_foreach_pair (p, vni_table,
1061  ({
1062  send_eid_table_map_pair (p, reg, mp->context);
1063  }));
1064  /* *INDENT-ON* */
1065 }
1066 
1067 static void
1069 {
1071 
1072  rmp = vl_msg_api_alloc (sizeof (*rmp));
1073  clib_memset (rmp, 0, sizeof (*rmp));
1074  rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_VNI_DETAILS);
1075  rmp->context = context;
1076  rmp->vni = clib_host_to_net_u32 (vni);
1077  vl_api_send_msg (reg, (u8 *) rmp);
1078 }
1079 
1080 static void
1081 one_adjacency_copy (vl_api_one_adjacency_t * dst, lisp_adjacency_t * adjs)
1082 {
1083  lisp_adjacency_t *adj;
1084  vl_api_one_adjacency_t a;
1085  u32 i, n = vec_len (adjs);
1086  fib_prefix_t rfib_prefix, lfib_prefix;
1087  u32 eid_type;
1088 
1089  for (i = 0; i < n; i++)
1090  {
1091  adj = vec_elt_at_index (adjs, i);
1092  clib_memset (&a, 0, sizeof (a));
1093 
1094  switch (gid_address_type (&adj->reid))
1095  {
1096  case GID_ADDR_IP_PREFIX:
1097  eid_type = EID_TYPE_API_PREFIX;
1099  &rfib_prefix);
1101  &lfib_prefix);
1102  ip_prefix_encode (&rfib_prefix, &a.reid.address.prefix);
1103  ip_prefix_encode (&lfib_prefix, &a.leid.address.prefix);
1104  break;
1105  case GID_ADDR_MAC:
1106  eid_type = EID_TYPE_API_PREFIX;
1108  a.reid.address.mac);
1110  a.leid.address.mac);
1111  break;
1112  case GID_ADDR_NSH:
1113  eid_type = EID_TYPE_API_PREFIX;
1114  a.reid.address.nsh.spi =
1115  clib_host_to_net_u32 (gid_address_nsh_spi (&adj->reid));
1116  a.reid.address.nsh.si = gid_address_nsh_si (&adj->reid);
1117  a.leid.address.nsh.spi =
1118  clib_host_to_net_u32 (gid_address_nsh_spi (&adj->leid));
1119  a.leid.address.nsh.si = gid_address_nsh_si (&adj->leid);
1120  break;
1121  default:
1122  ALWAYS_ASSERT (0);
1123  }
1124  a.reid.type = eid_type;
1125  a.leid.type = eid_type;
1126  dst[i] = a;
1127  }
1128 }
1129 
1130 static void
1133 {
1135  int rv = 0;
1136 
1137  /* *INDENT-OFF* */
1138  REPLY_MACRO2 (VL_API_SHOW_ONE_RLOC_PROBE_STATE_REPLY,
1139  {
1141  });
1142  /* *INDENT-ON* */
1143 }
1144 
1145 static void
1148 {
1150  int rv = 0;
1151 
1152  /* *INDENT-OFF* */
1153  REPLY_MACRO2 (VL_API_SHOW_ONE_MAP_REGISTER_STATE_REPLY,
1154  {
1156  });
1157  /* *INDENT-ON* */
1158 }
1159 
1160 static void
1162 {
1164  lisp_adjacency_t *adjs = 0;
1165  int rv = 0;
1166  u32 size = ~0;
1167  u32 vni = clib_net_to_host_u32 (mp->vni);
1168 
1169  adjs = vnet_lisp_adjacencies_get_by_vni (vni);
1170  size = vec_len (adjs) * sizeof (vl_api_one_adjacency_t);
1171 
1172  /* *INDENT-OFF* */
1173  REPLY_MACRO4 (VL_API_ONE_ADJACENCIES_GET_REPLY, size,
1174  {
1175  rmp->count = clib_host_to_net_u32 (vec_len (adjs));
1176  one_adjacency_copy (rmp->adjacencies, adjs);
1177  });
1178  /* *INDENT-ON* */
1179 
1180  vec_free (adjs);
1181 }
1182 
1183 static void
1185 {
1186  hash_pair_t *p;
1187  u32 *vnis = 0;
1188  vl_api_registration_t *reg;
1190 
1192  if (!reg)
1193  return;
1194 
1195  /* *INDENT-OFF* */
1197  ({
1198  hash_set (vnis, p->key, 0);
1199  }));
1200 
1202  ({
1203  hash_set (vnis, p->key, 0);
1204  }));
1205 
1206  hash_foreach_pair (p, vnis,
1207  ({
1208  send_eid_table_vni (p->key, reg, mp->context);
1209  }));
1210  /* *INDENT-ON* */
1211 
1212  hash_free (vnis);
1213 }
1214 
1215 static void
1217 {
1218  vl_api_show_one_status_reply_t *rmp = NULL;
1219  int rv = 0;
1220 
1221  /* *INDENT-OFF* */
1222  REPLY_MACRO2(VL_API_SHOW_ONE_STATUS_REPLY,
1223  ({
1226  }));
1227  /* *INDENT-ON* */
1228 }
1229 
1230 static void
1233 {
1236  locator_set_t *loc_set = 0;
1237  u8 *tmp_str = 0;
1238  int rv = 0;
1239 
1240  if (~0 == lcm->mreq_itr_rlocs)
1241  {
1242  tmp_str = format (0, " ");
1243  }
1244  else
1245  {
1246  loc_set =
1248  tmp_str = format (0, "%s", loc_set->name);
1249  }
1250 
1251  /* *INDENT-OFF* */
1252  REPLY_MACRO2(VL_API_ONE_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1253  ({
1254  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1255  ARRAY_LEN(rmp->locator_set_name) - 1);
1256  }));
1257  /* *INDENT-ON* */
1258 
1259  vec_free (tmp_str);
1260 }
1261 
1262 static void
1264 {
1267  mapping_t *m;
1268  locator_set_t *ls = 0;
1269  u8 *tmp_str = 0;
1270  u8 is_set = 0;
1271  int rv = 0;
1272 
1273  if (lcm->nsh_map_index == (u32) ~ 0)
1274  {
1275  tmp_str = format (0, "N/A");
1276  }
1277  else
1278  {
1279  m = pool_elt_at_index (lcm->mapping_pool, lcm->nsh_map_index);
1280  if (~0 != m->locator_set_index)
1281  {
1282  ls =
1284  tmp_str = format (0, "%s", ls->name);
1285  is_set = 1;
1286  }
1287  else
1288  {
1289  tmp_str = format (0, "N/A");
1290  }
1291  }
1292  vec_add1 (tmp_str, 0);
1293 
1294  /* *INDENT-OFF* */
1295  REPLY_MACRO2(VL_API_SHOW_ONE_NSH_MAPPING_REPLY,
1296  ({
1297  rmp->is_set = is_set;
1298  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1299  ARRAY_LEN(rmp->locator_set_name) - 1);
1300  }));
1301  /* *INDENT-ON* */
1302 }
1303 
1304 static void
1306 {
1307  vl_api_show_one_pitr_reply_t *rmp = NULL;
1309  mapping_t *m;
1310  locator_set_t *ls = 0;
1311  u8 *tmp_str = 0;
1312  int rv = 0;
1313 
1314  u8 is_enable = (lcm->flags & LISP_FLAG_PITR_MODE)
1315  && lcm->pitr_map_index != ~0;
1316 
1317  if (!is_enable)
1318  {
1319  tmp_str = format (0, "N/A");
1320  }
1321  else
1322  {
1324  if (~0 != m->locator_set_index)
1325  {
1326  ls =
1328  tmp_str = format (0, "%s", ls->name);
1329  }
1330  else
1331  {
1332  tmp_str = format (0, "N/A");
1333  }
1334  }
1335  vec_add1 (tmp_str, 0);
1336 
1337  /* *INDENT-OFF* */
1338  REPLY_MACRO2(VL_API_SHOW_ONE_PITR_REPLY,
1339  ({
1340  rmp->status = lcm->flags & LISP_FLAG_PITR_MODE;
1341  strncpy((char *) rmp->locator_set_name, (char *) tmp_str,
1342  ARRAY_LEN(rmp->locator_set_name) - 1);
1343  }));
1344  /* *INDENT-ON* */
1345 }
1346 
1347 static void
1350 {
1352  vnet_api_error_t rv = 0;
1353 
1354  /* *INDENT-OFF* */
1355  REPLY_MACRO2 (VL_API_SHOW_ONE_STATS_ENABLE_DISABLE_REPLY,
1356  ({
1358  }));
1359  /* *INDENT-ON* */
1360 }
1361 
1362 static void
1365 {
1366  vl_api_one_enable_disable_reply_t *rmp = NULL;
1367 
1369  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_REPLY);
1370 }
1371 
1372 static void
1374 {
1375  vl_api_one_stats_flush_reply_t *rmp;
1376  u8 rv;
1377 
1378  rv = vnet_lisp_flush_stats ();
1379  REPLY_MACRO (VL_API_ONE_STATS_FLUSH_REPLY);
1380 }
1381 
1382 static void
1384 {
1386  lisp_api_stats_t *stats, *stat;
1387  u8 rv = 0;
1388 
1389  stats = vnet_lisp_get_stats ();
1390  vec_foreach (stat, stats)
1391  {
1392  /* *INDENT-OFF* */
1393  REPLY_DETAILS (VL_API_ONE_STATS_DETAILS,
1394  ({
1395  fid_to_api_eid (&stat->deid, &rmp->deid);
1396  fid_to_api_eid (&stat->seid, &rmp->seid);
1397  rmp->vni = clib_host_to_net_u32 (stat->vni);
1398 
1399  ip_address_encode2 (&stat->rmt_rloc, &rmp->rloc);
1400  ip_address_encode2 (&stat->loc_rloc, &rmp->lloc);
1401 
1402  rmp->pkt_count = clib_host_to_net_u32 (stat->counters.packets);
1403  rmp->bytes = clib_host_to_net_u32 (stat->counters.bytes);
1404  }));
1405  /* *INDENT-ON* */
1406  }
1407 }
1408 
1409 static void
1412 {
1413  vl_api_one_add_del_l2_arp_entry_reply_t *rmp;
1414  int rv = 0;
1415  gid_address_t _arp, *arp = &_arp;
1418  clib_memset (arp, 0, sizeof (*arp));
1419 
1421  gid_address_arp_bd (arp) = clib_net_to_host_u32 (mp->bd);
1422 
1423  ip4_address_decode (mp->entry.ip4, &ip4);
1425  mac_address_decode (mp->entry.mac, &mac);
1426 
1427  rv = vnet_lisp_add_del_l2_arp_ndp_entry (arp, mac.bytes, mp->is_add);
1428 
1429  REPLY_MACRO (VL_API_ONE_ADD_DEL_L2_ARP_ENTRY_REPLY);
1430 }
1431 
1432 static void
1434 {
1435  vl_api_one_add_del_ndp_entry_reply_t *rmp;
1436  int rv = 0;
1437  gid_address_t _g, *g = &_g;
1438  ip6_address_t ip6;
1440  clib_memset (g, 0, sizeof (*g));
1441 
1443  gid_address_ndp_bd (g) = clib_net_to_host_u32 (mp->bd);
1444 
1445  ip6_address_decode (mp->entry.ip6, &ip6);
1447  mac_address_decode (mp->entry.mac, &mac);
1448 
1449  rv = vnet_lisp_add_del_l2_arp_ndp_entry (g, mac.bytes, mp->is_add);
1450 
1451  REPLY_MACRO (VL_API_ONE_ADD_DEL_NDP_ENTRY_REPLY);
1452 }
1453 
1454 static void
1456 {
1458  int rv = 0;
1459  u32 i = 0;
1460  hash_pair_t *p;
1461 
1462  u32 *bds = vnet_lisp_ndp_bds_get ();
1463  u32 size = hash_elts (bds) * sizeof (u32);
1464 
1465  /* *INDENT-OFF* */
1466  REPLY_MACRO4 (VL_API_ONE_NDP_BD_GET_REPLY, size,
1467  {
1468  rmp->count = clib_host_to_net_u32 (hash_elts (bds));
1469  hash_foreach_pair (p, bds,
1470  ({
1471  rmp->bridge_domains[i++] = clib_host_to_net_u32 (p->key);
1472  }));
1473  });
1474  /* *INDENT-ON* */
1475 
1476  hash_free (bds);
1477 }
1478 
1479 static void
1481 {
1483  int rv = 0;
1484  u32 i = 0;
1485  hash_pair_t *p;
1486 
1487  u32 *bds = vnet_lisp_l2_arp_bds_get ();
1488  u32 size = hash_elts (bds) * sizeof (u32);
1489 
1490  /* *INDENT-OFF* */
1491  REPLY_MACRO4 (VL_API_ONE_L2_ARP_BD_GET_REPLY, size,
1492  {
1493  rmp->count = clib_host_to_net_u32 (hash_elts (bds));
1494  hash_foreach_pair (p, bds,
1495  ({
1496  rmp->bridge_domains[i++] = clib_host_to_net_u32 (p->key);
1497  }));
1498  });
1499  /* *INDENT-ON* */
1500 
1501  hash_free (bds);
1502 }
1503 
1504 static void
1506 {
1509  u32 i = 0;
1510  int rv = 0;
1511 
1512  u32 bd = clib_net_to_host_u32 (mp->bd);
1513 
1514  entries = vnet_lisp_l2_arp_entries_get_by_bd (bd);
1515  u32 size = vec_len (entries) * sizeof (vl_api_one_l2_arp_entry_t);
1516 
1517  /* *INDENT-OFF* */
1518  REPLY_MACRO4 (VL_API_ONE_L2_ARP_ENTRIES_GET_REPLY, size,
1519  {
1520  rmp->count = clib_host_to_net_u32 (vec_len (entries));
1521  vec_foreach (e, entries)
1522  {
1523  mac_address_encode ((mac_address_t *) e->mac, rmp->entries[i].mac);
1524  ip4_address_encode ((ip4_address_t *) &e->ip4, rmp->entries[i].ip4);
1525  i++;
1526  }
1527  });
1528  /* *INDENT-ON* */
1529 
1530  vec_free (entries);
1531 }
1532 
1533 static void
1536 {
1537  vl_api_one_map_register_fallback_threshold_reply_t *rmp;
1538  int rv = 0;
1539 
1540  mp->value = clib_net_to_host_u32 (mp->value);
1542  REPLY_MACRO (VL_API_ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY);
1543 }
1544 
1545 static void
1548 {
1550  int rv = 0;
1551 
1553 
1554  /* *INDENT-OFF* */
1555  REPLY_MACRO2 (VL_API_SHOW_ONE_MAP_REGISTER_FALLBACK_THRESHOLD_REPLY,
1556  ({
1557  rmp->value = clib_host_to_net_u32 (value);
1558  }));
1559  /* *INDENT-ON* */
1560 }
1561 
1562 static void
1565 {
1566  vl_api_one_set_transport_protocol_reply_t *rmp;
1567  int rv = 0;
1568 
1570 
1571  REPLY_MACRO (VL_API_ONE_SET_TRANSPORT_PROTOCOL_REPLY);
1572 }
1573 
1574 static void
1577 {
1579  int rv = 0;
1581 
1582  /* *INDENT-OFF* */
1583  REPLY_MACRO2 (VL_API_ONE_GET_TRANSPORT_PROTOCOL_REPLY,
1584  ({
1585  rmp->protocol = proto;
1586  }));
1587  /* *INDENT-ON* */
1588 }
1589 
1590 static void
1592 {
1594  lisp_api_ndp_entry_t *entries = 0, *e;
1595  u32 i = 0;
1596  int rv = 0;
1597 
1598  u32 bd = clib_net_to_host_u32 (mp->bd);
1599 
1600  entries = vnet_lisp_ndp_entries_get_by_bd (bd);
1601  u32 size = vec_len (entries) * sizeof (vl_api_one_ndp_entry_t);
1602 
1603  /* *INDENT-OFF* */
1604  REPLY_MACRO4 (VL_API_ONE_NDP_ENTRIES_GET_REPLY, size,
1605  {
1606  rmp->count = clib_host_to_net_u32 (vec_len (entries));
1607  vec_foreach (e, entries)
1608  {
1609  mac_address_encode ((mac_address_t *) e->mac, rmp->entries[i].mac);
1610  ip6_address_encode ((ip6_address_t *) &e->ip6, rmp->entries[i].ip6);
1611  i++;
1612  }
1613  });
1614  /* *INDENT-ON* */
1615 
1616  vec_free (entries);
1617 }
1618 
1619 static void
1622 {
1623  vl_api_one_enable_disable_xtr_mode_reply_t *rmp = 0;
1625 
1626  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_XTR_MODE_REPLY);
1627 }
1628 
1629 static void
1631 {
1633  int rv = 0;
1634 
1635  /* *INDENT-OFF* */
1636  REPLY_MACRO2 (VL_API_ONE_SHOW_XTR_MODE_REPLY,
1637  {
1639  });
1640  /* *INDENT-ON* */
1641 }
1642 
1643 static void
1646 {
1647  vl_api_one_enable_disable_pitr_mode_reply_t *rmp = 0;
1649 
1650  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_PITR_MODE_REPLY);
1651 }
1652 
1653 static void
1655 {
1657  int rv = 0;
1658 
1659  /* *INDENT-OFF* */
1660  REPLY_MACRO2 (VL_API_ONE_SHOW_PITR_MODE_REPLY,
1661  {
1663  });
1664  /* *INDENT-ON* */
1665 }
1666 
1667 static void
1670 {
1671  vl_api_one_enable_disable_petr_mode_reply_t *rmp = 0;
1673 
1674  REPLY_MACRO (VL_API_ONE_ENABLE_DISABLE_PETR_MODE_REPLY);
1675 }
1676 
1677 static void
1679 {
1681  int rv = 0;
1682 
1683  /* *INDENT-OFF* */
1684  REPLY_MACRO2 (VL_API_ONE_SHOW_PETR_MODE_REPLY,
1685  {
1687  });
1688  /* *INDENT-ON* */
1689 }
1690 
1691 /*
1692  * one_api_hookup
1693  * Add vpe's API message handlers to the table.
1694  * vlib has already mapped shared memory and
1695  * added the client registration handlers.
1696  * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
1697  */
1698 #define vl_msg_name_crc_list
1699 #include <vnet/vnet_all_api_h.h>
1700 #undef vl_msg_name_crc_list
1701 
1702 static void
1704 {
1705 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
1706  foreach_vl_msg_name_crc_one;
1707 #undef _
1708 }
1709 
1710 static clib_error_t *
1712 {
1713  api_main_t *am = vlibapi_get_main ();
1714 
1715 #define _(N,n) \
1716  vl_msg_api_set_handlers(VL_API_##N, #n, \
1717  vl_api_##n##_t_handler, \
1718  vl_noop_handler, \
1719  vl_api_##n##_t_endian, \
1720  vl_api_##n##_t_print, \
1721  sizeof(vl_api_##n##_t), 1);
1723 #undef _
1724 
1725  /*
1726  * Set up the (msg_name, crc, message-id) table
1727  */
1729 
1730  return 0;
1731 }
1732 
1734 
1735 /*
1736  * fd.io coding-style-patch-verification: ON
1737  *
1738  * Local Variables:
1739  * eval: (c-set-style "gnu")
1740  * End:
1741  */
static void vl_api_one_eid_table_dump_t_handler(vl_api_one_eid_table_dump_t *mp)
Definition: one_api.c:916
static int unformat_one_eid_api(gid_address_t *dst, u32 vni, vl_api_eid_t *eid)
Definition: one_api.c:288
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:212
bool is_enable[default=true]
Definition: one.api:931
vl_api_one_ndp_entry_t entries[count]
Definition: one.api:449
static void vl_api_one_eid_table_add_del_map_t_handler(vl_api_one_eid_table_add_del_map_t *mp)
Definition: one_api.c:408
Add/delete L2 ARP entries.
Definition: one.api:386
u16 vni
Definition: flow_types.api:160
Get ONE map request itr rlocs status.
Definition: one.api:841
u32 pitr_map_index
Definition: control.h:251
void ip_prefix_to_fib_prefix(const ip_prefix_t *ip_prefix, fib_prefix_t *fib_prefix)
convert from a LISP to a FIB prefix
Definition: ip_types.c:395
vnet_api_error_t
Definition: api_errno.h:162
gid_address_t leid
Definition: control.h:74
u8 vnet_lisp_get_pitr_mode(void)
Definition: control.c:5012
#define gid_address_type(_a)
Definition: lisp_types.h:203
Status of ONE PITR, enable or disable.
Definition: one.api:894
static void vl_api_one_enable_disable_pitr_mode_t_handler(vl_api_one_enable_disable_pitr_mode_t *mp)
Definition: one_api.c:1645
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
Definition: ip_types_api.c:216
vl_api_mac_address_t mac
Definition: l2.api:502
enable or disable ONE feature
Definition: one.api:161
static void vl_api_one_rloc_probe_enable_disable_t_handler(vl_api_one_rloc_probe_enable_disable_t *mp)
Definition: one_api.c:465
a
Definition: bitmap.h:538
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
Definition: ip_types_api.c:233
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
Definition: lisp_gpe.c:184
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
Definition: ip_types.c:205
lisp_api_l2_arp_entry_t * vnet_lisp_l2_arp_entries_get_by_bd(u32 bd)
Definition: control.c:946
bool is_add[default=true]
Definition: one.api:390
#define ntohs(x)
Definition: af_xdp.bpf.c:29
add or delete map request itr rlocs
Definition: one.api:549
Reply with list of bridge domains used by L2 ARP table.
Definition: one.api:517
lisp_msmr_t * map_resolvers
Definition: control.h:221
static void vl_api_one_stats_enable_disable_t_handler(vl_api_one_stats_enable_disable_t *mp)
Definition: one_api.c:1364
Get TTL for map register messages.
Definition: one.api:108
void mac_address_encode(const mac_address_t *in, u8 *out)
u32 vnet_lisp_set_transport_protocol(u8 protocol)
Definition: control.c:4888
configure or delete ONE NSH mapping
Definition: one.api:174
static void vl_api_one_add_del_local_eid_t_handler(vl_api_one_add_del_local_eid_t *mp)
Definition: one_api.c:351
static void send_one_locator_set_details(lisp_cp_main_t *lcm, locator_set_t *lsit, vl_api_registration_t *reg, u32 context, u32 ls_index)
Definition: one_api.c:771
#define REPLY_MACRO4(t, n, body)
static void vl_api_one_add_del_ndp_entry_t_handler(vl_api_one_add_del_ndp_entry_t *mp)
Definition: one_api.c:1433
eid_type
Definition: lisp_types.api:37
static void vl_api_one_enable_disable_petr_mode_t_handler(vl_api_one_enable_disable_petr_mode_t *mp)
Definition: one_api.c:1669
uword * table_id_by_vni
Definition: control.h:240
static void send_eid_table_vni(u32 vni, vl_api_registration_t *reg, u32 context)
Definition: one_api.c:1068
add or delete locator_set
Definition: one.api:29
vl_api_one_ndp_entry_t entry
Definition: one.api:434
static void vl_api_one_ndp_entries_get_t_handler(vl_api_one_ndp_entries_get_t *mp)
Definition: one_api.c:1591
static void vl_api_one_add_del_map_server_t_handler(vl_api_one_add_del_map_server_t *mp)
Definition: one_api.c:418
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
Request for ONE status.
Definition: one.api:818
enable/disable ONE map-register
Definition: one.api:274
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
dp_address_t seid
Definition: lisp_gpe.h:103
static void setup_message_id_table(api_main_t *am)
Definition: one_api.c:1703
u8 vnet_lisp_get_map_request_mode(void)
Definition: control.c:57
reply to one_eid_table_vni_dump
Definition: one.api:768
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
Definition: ip_types_api.c:117
ip_address_t loc_rloc
Definition: lisp_gpe.h:104
#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
add or delete ONE eid-table
Definition: one.api:81
vl_api_address_t ip_address
Definition: one.api:232
static void vl_api_one_locator_dump_t_handler(vl_api_one_locator_dump_t *mp)
Definition: one_api.c:728
static void vl_api_one_show_pitr_mode_t_handler(vl_api_one_show_pitr_mode_t *mp)
Definition: one_api.c:1654
vl_api_address_t ip_address
Definition: one.api:207
Request for map server summary status.
Definition: one.api:808
vl_api_address_t rloc
Definition: one.api:914
#define foreach_vpe_api_msg
Definition: one_api.c:80
vlib_main_t * vm
Definition: in2out_ed.c:1582
u32 nsh_map_index
Definition: control.h:258
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
bool is_add[default=true]
Definition: one.api:85
static void vl_api_one_set_transport_protocol_t_handler(vl_api_one_set_transport_protocol_t *mp)
Definition: one_api.c:1564
static void vl_api_show_one_status_t_handler(vl_api_show_one_status_t *mp)
Definition: one_api.c:1216
vl_api_address_t ip_address
Definition: one.api:138
vl_api_remote_locator_t rlocs[rloc_num]
Definition: one.api:370
ip_address_t address
Definition: control.h:89
vnet_api_error_t vnet_lisp_stats_enable_disable(u8 enable)
Definition: control.c:4849
bool is_enable[default=true]
Definition: one.api:165
vl_api_prefix_t prefix
Definition: ip.api:144
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
Reply for ONE NSH mapping.
Definition: one.api:871
static void vl_api_show_one_map_request_mode_t_handler(vl_api_show_one_map_request_mode_t *mp)
Definition: one_api.c:486
static clib_error_t * one_api_hookup(vlib_main_t *vm)
Definition: one_api.c:1711
vl_api_local_locator_t locators[locator_num]
Definition: one.api:36
void * vl_msg_api_alloc(int nbytes)
vhost_vring_addr_t addr
Definition: vhost_user.h:111
u8 vnet_lisp_stats_enable_disable_state(void)
Definition: control.c:4865
unsigned char u8
Definition: types.h:56
#define fid_addr_mac(_a)
Definition: lisp_types.h:85
u8 vnet_lisp_map_register_state_get(void)
Definition: control.c:376
vl_api_address_t ip_address
Definition: one.api:801
u8 vnet_lisp_get_petr_mode(void)
Definition: control.c:5019
int vnet_lisp_set_map_request_mode(u8 mode)
Definition: control.c:1510
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
configure or disable use of PETR
Definition: one.api:203
uword value[0]
Definition: hash.h:165
static void vl_api_one_get_transport_protocol_t_handler(vl_api_one_get_transport_protocol_t *mp)
Definition: one_api.c:1576
Request for L2 ARP entries from specified bridge domain.
Definition: one.api:400
Request for map request itr rlocs summary status.
Definition: one.api:849
ONE locator_set status.
Definition: one.api:598
lisp_msmr_t * map_servers
Definition: control.h:224
lisp_transport_protocol_t vnet_lisp_get_transport_protocol(void)
Definition: control.c:4901
int vnet_lisp_enable_disable_petr_mode(u8 is_enabled)
Definition: control.c:4974
vl_api_hmac_key_t key
Definition: one.api:89
static void vl_api_one_adjacencies_get_t_handler(vl_api_one_adjacencies_get_t *mp)
Definition: one_api.c:1161
static void send_one_eid_table_details(mapping_t *mapit, vl_api_registration_t *reg, u32 context, u8 filter)
Definition: one_api.c:829
int vnet_lisp_enable_disable_pitr_mode(u8 is_enabled)
Definition: control.c:4945
vl_api_address_t ip_address
Definition: one.api:603
static void send_one_map_resolver_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: one_api.c:990
static void vl_api_one_l2_arp_bd_get_t_handler(vl_api_one_l2_arp_bd_get_t *mp)
Definition: one_api.c:1480
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:513
static void vl_api_one_get_map_request_itr_rlocs_t_handler(vl_api_one_get_map_request_itr_rlocs_t *mp)
Definition: one_api.c:1232
Request for ONE map-request mode.
Definition: one.api:327
vl_api_ip6_address_t ip6
Definition: one.api:424
u8 * key
Definition: lisp_types.h:315
Request for ONE adjacencies.
Definition: one.api:724
ip_address_t rmt_rloc
Definition: lisp_gpe.h:105
Request for one_eid_table_map_details.
Definition: one.api:747
int vnet_lisp_flush_stats(void)
vl_api_interface_index_t sw_if_index
Definition: one.api:602
bool is_add[default=true]
Definition: one.api:137
#define gid_address_sd_src(_a)
Definition: lisp_types.h:220
static void vl_api_one_add_del_map_resolver_t_handler(vl_api_one_add_del_map_resolver_t *mp)
Definition: one_api.c:434
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Aggregate type for a prefix.
Definition: fib_types.h:203
void ip_prefix_normalize(ip_prefix_t *a)
Definition: ip_types.c:342
vl_api_hmac_key_t key
Definition: one.api:672
typedef eid
Definition: lisp_types.api:59
#define ALWAYS_ASSERT(truth)
static void vl_api_one_map_register_set_ttl_t_handler(vl_api_one_map_register_set_ttl_t *mp)
Definition: one_api.c:165
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
Definition: control.c:1036
Dumps all VNIs used in mappings.
Definition: one.api:758
lisp_api_ndp_entry_t * vnet_lisp_ndp_entries_get_by_bd(u32 bd)
Definition: control.c:982
static void vl_api_one_enable_disable_t_handler(vl_api_one_enable_disable_t *mp)
Definition: one_api.c:475
unsigned int u32
Definition: types.h:88
static void vl_api_one_add_del_adjacency_t_handler(vl_api_one_add_del_adjacency_t *mp)
Definition: one_api.c:675
static void vl_api_one_map_register_fallback_threshold_t_handler(vl_api_one_map_register_fallback_threshold_t *mp)
Definition: one_api.c:1535
bool is_enable[default=true]
Definition: one.api:991
uword * bd_id_by_vni
Definition: control.h:244
static void vl_api_one_map_resolver_dump_t_handler(vl_api_one_map_resolver_dump_t *mp)
Definition: one_api.c:1006
static lisp_cp_main_t * vnet_lisp_cp_get_main()
Definition: control.h:305
bool is_add[default=true]
Definition: one.api:208
u16 fp_len
The mask length.
Definition: fib_types.h:207
add or delete ONE adjacency adjacency
Definition: one.api:533
u32 bd
Definition: one.api:391
bool is_enable[default=true]
Definition: one.api:1011
u32 petr_map_index
Proxy ETR map index used for &#39;use-petr&#39;.
Definition: control.h:255
vl_api_eid_t seid
Definition: one.api:913
static void vl_api_one_add_del_map_request_itr_rlocs_t_handler(vl_api_one_add_del_map_request_itr_rlocs_t *mp)
Definition: one_api.c:597
static void send_eid_table_map_pair(hash_pair_t *p, vl_api_registration_t *reg, u32 context)
Definition: one_api.c:1023
Reply with list of bridge domains used by neighbor discovery.
Definition: one.api:494
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
Definition: control.c:2206
static void vl_api_one_map_register_enable_disable_t_handler(vl_api_one_map_register_enable_disable_t *mp)
Definition: one_api.c:454
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
static void send_one_locator_details(lisp_cp_main_t *lcm, locator_t *loc, vl_api_registration_t *reg, u32 context)
Definition: one_api.c:701
counter_t packets
packet counter
Definition: counter_types.h:28
#define gid_address_arp_ndp_ip(_a)
Definition: lisp_types.h:226
bool is_add[default=true]
Definition: one.api:192
static void vl_api_one_eid_table_vni_dump_t_handler(vl_api_one_eid_table_vni_dump_t *mp)
Definition: one_api.c:1184
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:226
vl_api_address_t lloc
Definition: one.api:915
vl_api_ip_proto_t proto
Definition: acl_types.api:50
#define gid_address_mac(_a)
Definition: lisp_types.h:209
bool is_add[default=true]
Definition: one.api:64
Set TTL for map register messages.
Definition: one.api:97
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 ONE PITR status.
Definition: one.api:883
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
static void vl_api_one_add_del_remote_mapping_t_handler(vl_api_one_add_del_remote_mapping_t *mp)
Definition: one_api.c:620
u8 authoritative
Definition: lisp_types.h:305
Request for ONE PETR status.
Definition: one.api:215
lisp_api_stats_t * vnet_lisp_get_stats(void)
Definition: control.c:4550
#define REPLY_MACRO(t)
vl_api_ip4_address_t ip4
Definition: one.api:376
set ONE map-request mode.
Definition: one.api:316
u8 vnet_lisp_get_xtr_mode(void)
Definition: control.c:5005
Reply for show_one_rloc_probe_state.
Definition: one.api:250
vl_api_address_t dst
Definition: gre.api:55
add or delete map-resolver
Definition: one.api:148
VLIB_API_INIT_FUNCTION(one_api_hookup)
#define gid_address_ippref(_a)
Definition: lisp_types.h:204
static void vl_api_show_one_map_register_fallback_threshold_t_handler(vl_api_show_one_map_register_fallback_threshold_t *mp)
Definition: one_api.c:1547
API main structure, used by both vpp and binary API clients.
Definition: api_common.h:227
dp_address_t deid
Definition: lisp_gpe.h:102
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
Definition: control.c:579
static void vl_api_one_ndp_bd_get_t_handler(vl_api_one_ndp_bd_get_t *mp)
Definition: one_api.c:1455
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
ONE map server details.
Definition: one.api:798
Request for map one locator status.
Definition: one.api:582
u32 * vnet_lisp_ndp_bds_get(void)
Definition: control.c:908
vl_api_address_t ip_address
Definition: one.api:781
vl_api_interface_index_t sw_if_index
Definition: one.api:66
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
Definition: control.c:2341
Shows relationship between vni and vrf/bd.
Definition: one.api:735
string locator_set_name[64]
Definition: one.api:87
vlib_counter_t counters
Definition: lisp_gpe.h:107
Dump ONE eid-table.
Definition: one.api:660
static void vl_api_one_use_petr_t_handler(vl_api_one_use_petr_t *mp)
Definition: one_api.c:545
#define gid_address_arp_bd
Definition: lisp_types.h:230
void gid_address_ip_set(gid_address_t *dst, void *src, u8 version)
Definition: lisp_types.c:1268
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:317
Get state of ONE map-register.
Definition: one.api:285
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:380
Request for ONE NSH mapping.
Definition: one.api:860
static void send_one_map_server_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
Definition: one_api.c:955
#define gid_address_ippref_len(_a)
Definition: lisp_types.h:205
vl_api_one_map_mode_t mode
Definition: one.api:342
Request for list of bridge domains used by L2 ARP table.
Definition: one.api:506
ONE adjacency reply.
Definition: one.api:711
u8 ttl
Definition: fib_types.api:26
#define clib_warning(format, args...)
Definition: error.h:59
u32 locator_set_index
Definition: lisp_types.h:298
vl_api_one_l2_arp_entry_t entries[count]
Definition: one.api:418
int vnet_lisp_map_register_enable_disable(u8 is_enable)
Definition: control.c:2140
u32 vnet_lisp_map_register_fallback_threshold_get(void)
Definition: control.c:1634
string ls_name[64]
Definition: one.api:587
Reply for show_one_map_request_mode.
Definition: one.api:338
#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
string locator_set_name[64]
Definition: one.api:899
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
#define gid_address_nsh_si(_a)
Definition: lisp_types.h:212
string name[64]
Definition: ip.api:44
static void vl_api_one_enable_disable_xtr_mode_t_handler(vl_api_one_enable_disable_xtr_mode_t *mp)
Definition: one_api.c:1621
static void vl_api_show_one_rloc_probe_state_t_handler(vl_api_show_one_rloc_probe_state_t *mp)
Definition: one_api.c:1132
static void vl_api_show_one_stats_enable_disable_t_handler(vl_api_show_one_stats_enable_disable_t *mp)
Definition: one_api.c:1349
#define fid_addr_ippref(_a)
Definition: lisp_types.h:82
u8 vnet_lisp_enable_disable_status(void)
Definition: control.c:2271
Reply with L2 ARP entries from specified bridge domain.
Definition: one.api:413
int vnet_lisp_enable_disable_xtr_mode(u8 is_enabled)
Definition: control.c:4908
Definition: control.h:107
bool is_enable[default=true]
Definition: one.api:971
struct _gid_address_t gid_address_t
vl_api_one_filter_t filter
Definition: one.api:640
static void vl_api_show_one_map_register_ttl_t_handler(vl_api_show_one_map_register_ttl_t *mp)
Definition: one_api.c:179
bool is_add[default=true]
Definition: one.api:432
u8 value
Definition: qos.api:54
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
Definition: control.c:633
static uword hash_elts(void *v)
Definition: hash.h:118
#define ASSERT(truth)
#define fid_addr_type(_a)
Definition: lisp_types.h:87
static void vl_api_show_one_map_register_state_t_handler(vl_api_show_one_map_register_state_t *mp)
Definition: one_api.c:1147
int vnet_lisp_clear_all_remote_adjacencies(void)
Definition: control.c:1388
map/unmap vni/bd_index to vrf
Definition: one.api:565
#define gid_address_sd_dst(_a)
Definition: lisp_types.h:221
gid_dictionary_t mapping_index_by_gid
Definition: control.h:169
#define REPLY_DETAILS(t, body)
Definition: one_api.c:65
locator_set_t * locator_set_pool
Definition: control.h:181
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
Definition: ip_types_api.c:111
static void vl_api_one_nsh_set_locator_set_t_handler(vl_api_one_nsh_set_locator_set_t *mp)
Definition: one_api.c:511
#define gid_address_ndp_bd
Definition: lisp_types.h:229
static void vl_api_one_show_xtr_mode_t_handler(vl_api_one_show_xtr_mode_t *mp)
Definition: one_api.c:1630
static void vl_api_one_add_del_l2_arp_entry_t_handler(vl_api_one_add_del_l2_arp_entry_t *mp)
Definition: one_api.c:1411
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
Definition: control.c:2131
static void vl_api_one_locator_set_dump_t_handler(vl_api_one_locator_set_dump_t *mp)
Definition: one_api.c:802
Get state of ONE RLOC probing.
Definition: one.api:239
Add/delete map server.
Definition: one.api:133
ONE PETR status, enable or disable.
Definition: one.api:227
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
static void vl_api_one_stats_dump_t_handler(vl_api_one_stats_dump_t *mp)
Definition: one_api.c:1383
Definition: control.h:101
u32 entries
vl_api_eid_t deid
Definition: one.api:912
int vnet_lisp_map_register_fallback_threshold_set(u32 value)
Definition: control.c:1621
typedef key
Definition: ipsec_types.api:85
vl_api_one_l2_arp_entry_t entry
Definition: one.api:392
bool is_add[default=true]
Definition: one.api:362
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
Definition: ip_types_api.c:261
add or delete remote static mapping
Definition: one.api:358
static void vl_api_one_eid_table_map_dump_t_handler(vl_api_one_eid_table_map_dump_t *mp)
Definition: one_api.c:1039
counter_t bytes
byte counter
Definition: counter_types.h:29
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
#define gid_address_vni(_a)
Definition: lisp_types.h:213
static void vl_api_show_one_nsh_mapping_t_handler(vl_api_show_one_nsh_mapping_t *mp)
Definition: one_api.c:1263
add or delete locator for locator set
Definition: one.api:60
vl_api_address_t ip_address
Definition: one.api:153
vl_api_address_t ip
Definition: l2.api:501
static void vl_api_one_add_del_locator_set_t_handler(vl_api_one_add_del_locator_set_t *mp)
Definition: one_api.c:194
Reply for locator_set add/del.
Definition: one.api:44
Request for map resolver summary status.
Definition: one.api:788
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
bool is_enable[default=true]
Definition: one.api:266
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
Definition: hash.h:373
u64 uword
Definition: types.h:112
static void vl_api_one_add_del_locator_t_handler(vl_api_one_add_del_locator_t *mp)
Definition: one_api.c:246
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
Definition: ip_types_api.c:129
enable/disable ONE RLOC probing
Definition: one.api:262
#define gid_address_nsh_spi(_a)
Definition: lisp_types.h:211
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
Definition: control.c:1339
u32 * vnet_lisp_l2_arp_bds_get(void)
Definition: control.c:884
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
static void fid_to_api_eid(fid_address_t *fid, vl_api_eid_t *eid)
Definition: one_api.c:325
int vnet_lisp_nsh_set_locator_set(u8 *locator_set_name, u8 is_add)
Definition: control.c:1531
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
Definition: lisp_types.c:1203
static void vl_api_one_map_request_mode_t_handler(vl_api_one_map_request_mode_t *mp)
Definition: one_api.c:500
gid_address_t eid
Definition: lisp_types.h:293
gid_address_t reid
Definition: control.h:75
static void vl_api_one_pitr_set_locator_set_t_handler(vl_api_one_pitr_set_locator_set_t *mp)
Definition: one_api.c:528
gid_address_t address
Definition: lisp_types.h:267
static void vl_api_one_l2_arp_entries_get_t_handler(vl_api_one_l2_arp_entries_get_t *mp)
Definition: one_api.c:1505
#define hash_get_mem(h, key)
Definition: hash.h:269
static void vl_api_one_show_petr_mode_t_handler(vl_api_one_show_petr_mode_t *mp)
Definition: one_api.c:1678
ONE locator_set status.
Definition: one.api:613
static api_main_t * vlibapi_get_main(void)
Definition: api_common.h:389
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
Definition: control.c:2278
static void vl_api_show_one_pitr_t_handler(vl_api_show_one_pitr_t *mp)
Definition: one_api.c:1305
int vnet_lisp_add_del_l2_arp_ndp_entry(gid_address_t *key, u8 *mac, u8 is_add)
Definition: control.c:997
bool is_add[default=true]
Definition: one.api:569
void ip4_address_encode(const ip4_address_t *in, vl_api_ip4_address_t out)
Definition: ip_types_api.c:123
bool is_add[default=true]
Definition: one.api:33
#define vec_foreach(var, vec)
Vector iterator.
Set ONE transport protocol.
Definition: one.api:459
static void vl_api_show_one_use_petr_t_handler(vl_api_show_one_use_petr_t *mp)
Definition: one_api.c:559
Request for eid table summary status.
Definition: one.api:687
string locator_set_name[64]
Definition: one.api:65
Request for locator_set summary status.
Definition: one.api:636
Contains current TTL for map register messages.
Definition: one.api:119
Request for list of bridge domains used by neighbor discovery.
Definition: one.api:483
static void vl_api_one_stats_flush_t_handler(vl_api_one_stats_flush_t *mp)
Definition: one_api.c:1373
bool is_add[default=true]
Definition: one.api:178
int vnet_lisp_map_register_set_ttl(u32 ttl)
Definition: control.c:2326
u32 vnet_lisp_map_register_get_ttl(void)
Definition: control.c:2334
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
Definition: control.c:1649
ONE map resolver status.
Definition: one.api:778
u32 mreq_itr_rlocs
Definition: control.h:237
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
bool is_add[default=true]
Definition: one.api:152
static locator_t * unformat_one_locs(vl_api_remote_locator_t *rmt_locs, u32 rloc_num)
Definition: one_api.c:141
u32 * locator_indices
Definition: lisp_types.h:287
Reply for show_one_map_register_state.
Definition: one.api:295
uword key
Definition: hash.h:162
LISP-GPE definitions.
configure or disable ONE PITR node
Definition: one.api:188
Definition: one.api:428
#define VALIDATE_SW_IF_INDEX(mp)
u32 bd
Definition: one.api:433
vl_api_one_map_mode_t mode
Definition: one.api:320
vl_api_one_adjacency_t adjacencies[count]
Definition: one.api:716
static void one_adjacency_copy(vl_api_one_adjacency_t *dst, lisp_adjacency_t *adjs)
Definition: one_api.c:1081
static void vl_api_one_map_server_dump_t_handler(vl_api_one_map_server_dump_t *mp)
Definition: one_api.c:973