30 #define vl_api_one_remote_locator_t_endian vl_noop_handler 31 #define vl_api_one_remote_locator_t_print vl_noop_handler 32 #define vl_api_one_local_locator_t_endian vl_noop_handler 33 #define vl_api_one_local_locator_t_print vl_noop_handler 35 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler 36 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler 37 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler 38 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler 40 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler 41 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler 42 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler 43 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler 54 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 61 #define REPLY_DETAILS(t, body) \ 63 unix_shared_memory_queue_t * q; \ 64 rv = vl_msg_api_pd_handler (mp, rv); \ 65 q = vl_api_client_index_to_input_queue (mp->client_index); \ 69 rmp = vl_msg_api_alloc (sizeof (*rmp)); \ 70 rmp->_vl_msg_id = ntohs((t)); \ 71 rmp->context = mp->context; \ 72 do {body;} while (0); \ 73 vl_msg_api_send_shmem (q, (u8 *)&rmp); \ 76 #define foreach_vpe_api_msg \ 77 _(ONE_ADD_DEL_LOCATOR_SET, one_add_del_locator_set) \ 78 _(ONE_ADD_DEL_LOCATOR, one_add_del_locator) \ 79 _(ONE_ADD_DEL_LOCAL_EID, one_add_del_local_eid) \ 80 _(ONE_ADD_DEL_MAP_RESOLVER, one_add_del_map_resolver) \ 81 _(ONE_ADD_DEL_MAP_SERVER, one_add_del_map_server) \ 82 _(ONE_ENABLE_DISABLE, one_enable_disable) \ 83 _(ONE_RLOC_PROBE_ENABLE_DISABLE, one_rloc_probe_enable_disable) \ 84 _(ONE_MAP_REGISTER_ENABLE_DISABLE, one_map_register_enable_disable) \ 85 _(ONE_ADD_DEL_REMOTE_MAPPING, one_add_del_remote_mapping) \ 86 _(ONE_ADD_DEL_ADJACENCY, one_add_del_adjacency) \ 87 _(ONE_PITR_SET_LOCATOR_SET, one_pitr_set_locator_set) \ 88 _(ONE_MAP_REQUEST_MODE, one_map_request_mode) \ 89 _(ONE_EID_TABLE_ADD_DEL_MAP, one_eid_table_add_del_map) \ 90 _(ONE_LOCATOR_SET_DUMP, one_locator_set_dump) \ 91 _(ONE_LOCATOR_DUMP, one_locator_dump) \ 92 _(ONE_EID_TABLE_DUMP, one_eid_table_dump) \ 93 _(ONE_MAP_RESOLVER_DUMP, one_map_resolver_dump) \ 94 _(ONE_MAP_SERVER_DUMP, one_map_server_dump) \ 95 _(ONE_EID_TABLE_MAP_DUMP, one_eid_table_map_dump) \ 96 _(ONE_EID_TABLE_VNI_DUMP, one_eid_table_vni_dump) \ 97 _(ONE_ADJACENCIES_GET, one_adjacencies_get) \ 98 _(SHOW_ONE_RLOC_PROBE_STATE, show_one_rloc_probe_state) \ 99 _(SHOW_ONE_MAP_REGISTER_STATE, show_one_map_register_state) \ 100 _(SHOW_ONE_STATUS, show_one_status) \ 101 _(ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ 102 one_add_del_map_request_itr_rlocs) \ 103 _(ONE_GET_MAP_REQUEST_ITR_RLOCS, one_get_map_request_itr_rlocs) \ 104 _(SHOW_ONE_PITR, show_one_pitr) \ 105 _(SHOW_ONE_MAP_REQUEST_MODE, show_one_map_request_mode) \ 106 _(ONE_USE_PETR, one_use_petr) \ 107 _(SHOW_ONE_USE_PETR, show_one_use_petr) \ 108 _(SHOW_ONE_STATS_ENABLE_DISABLE, show_one_stats_enable_disable) \ 109 _(ONE_STATS_ENABLE_DISABLE, one_stats_enable_disable) \ 110 _(ONE_STATS_DUMP, one_stats_dump) \ 120 for (i = 0; i < rloc_num; i++)
124 memset (&loc, 0,
sizeof (loc));
144 u32 ls_index = ~0, locator_num;
148 memset (a, 0,
sizeof (a[0]));
152 a->
name = locator_name;
155 locator_num = clib_net_to_host_u32 (mp->
locator_num);
157 memset (&locator, 0,
sizeof (locator));
158 for (i = 0; i < locator_num; i++)
180 rmp->
ls_index = clib_host_to_net_u32 (ls_index);
195 memset (&locator, 0,
sizeof (locator));
196 memset (a, 0,
sizeof (a[0]));
206 a->
name = locator_name;
243 return VNET_API_ERROR_INVALID_VALUE;
259 u32 locator_set_index = ~0, map_index = ~0;
262 memset (a, 0,
sizeof (a[0]));
263 memset (eid, 0,
sizeof (eid[0]));
274 rv = VNET_API_ERROR_INVALID_VALUE;
277 locator_set_index = p[0];
307 clib_net_to_host_u32 (mp->
dp_table),
309 REPLY_MACRO (VL_API_ONE_EID_TABLE_ADD_DEL_MAP_REPLY)}
318 memset (&addr, 0,
sizeof (addr));
334 memset (a, 0,
sizeof (a[0]));
341 REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_RESOLVER_REPLY);
414 REPLY_MACRO (VL_API_ONE_PITR_SET_LOCATOR_SET_REPLY);
449 memset (&addr, 0,
sizeof (addr));
450 status = lcm->
flags & LISP_FLAG_USE_PETR;
494 u8 *locator_set_name =
NULL;
506 REPLY_MACRO (VL_API_ONE_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
517 u32 rloc_num = clib_net_to_host_u32 (mp->
rloc_num);
519 memset (eid, 0,
sizeof (eid[0]));
551 REPLY_MACRO (VL_API_ONE_ADD_DEL_REMOTE_MAPPING_REPLY);
561 memset (a, 0,
sizeof (a[0]));
586 memset (rmp, 0,
sizeof (*rmp));
587 rmp->_vl_msg_id = ntohs (VL_API_ONE_LOCATOR_DETAILS);
614 u32 ls_index = ~0, *locit = 0;
654 u32 context,
u32 ls_index)
660 memset (rmp, 0,
sizeof (*rmp));
661 rmp->_vl_msg_id = ntohs (VL_API_ONE_LOCATOR_SET_DETAILS);
668 strncpy ((
char *) rmp->
ls_name, (
char *) lsit->
name,
673 str =
format (0,
"<remote-%d>", ls_index);
699 if (filter && !((1 == filter && lsit->local) ||
700 (2 == filter && !lsit->local)))
727 prefix_length[0] = 0;
765 u32 context,
u8 filter)
773 ip_prefix_t *ip_prefix =
NULL;
789 clib_warning (
"Filter error, unknown filter: %d", filter);
798 memset (rmp, 0,
sizeof (*rmp));
799 rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_DETAILS);
808 rmp->
ttl = clib_host_to_net_u32 (mapit->
ttl);
869 memset (eid, 0,
sizeof (*eid));
887 send_one_eid_table_details(mapit, q, mp->context,
901 memset (rmp, 0,
sizeof (*rmp));
902 rmp->_vl_msg_id = ntohs (VL_API_ONE_MAP_SERVER_DETAILS);
952 memset (rmp, 0,
sizeof (*rmp));
953 rmp->_vl_msg_id = ntohs (VL_API_ONE_MAP_RESOLVER_DETAILS);
1003 memset (rmp, 0,
sizeof (*rmp));
1004 rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_MAP_DETAILS);
1006 rmp->
vni = clib_host_to_net_u32 (p->
key);
1018 uword *vni_table = 0;
1049 memset (rmp, 0,
sizeof (*rmp));
1050 rmp->_vl_msg_id = ntohs (VL_API_ONE_EID_TABLE_VNI_DETAILS);
1052 rmp->
vni = clib_host_to_net_u32 (vni);
1063 for (i = 0; i < n; i++)
1066 memset (&a, 0,
sizeof (a));
1121 REPLY_MACRO2 (VL_API_SHOW_ONE_MAP_REGISTER_STATE_REPLY,
1135 u32 vni = clib_net_to_host_u32 (mp->
vni);
1168 hash_set (vnis, p->key, 0);
1173 hash_set (vnis, p->key, 0);
1226 tmp_str =
format (0,
" ");
1236 REPLY_MACRO2(VL_API_ONE_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1265 tmp_str =
format (0,
"N/A");
1278 tmp_str =
format (0,
"N/A");
1301 REPLY_MACRO2 (VL_API_SHOW_ONE_STATS_ENABLE_DISABLE_REPLY,
1363 rmp->
vni = clib_host_to_net_u32 (stat->
vni);
1383 #define vl_msg_name_crc_list 1385 #undef vl_msg_name_crc_list 1390 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1391 foreach_vl_msg_name_crc_one;
1401 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1402 vl_api_##n##_t_handler, \ 1404 vl_api_##n##_t_endian, \ 1405 vl_api_##n##_t_print, \ 1406 sizeof(vl_api_##n##_t), 1);
static void one_fid_put_api(u8 *dst, fid_address_t *src, u8 *prefix_length)
static void vl_api_one_eid_table_dump_t_handler(vl_api_one_eid_table_dump_t *mp)
static void vl_api_one_eid_table_add_del_map_t_handler(vl_api_one_eid_table_add_del_map_t *mp)
#define gid_address_ip_version(_a)
Get ONE map request itr rlocs status.
sll srl srl sll sra u16x4 i
#define gid_address_type(_a)
Status of ONE PITR, enable or disable.
enable or disable ONE feature
static void vl_api_one_rloc_probe_enable_disable_t_handler(vl_api_one_rloc_probe_enable_disable_t *mp)
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
add or delete map request itr rlocs
lisp_msmr_t * map_resolvers
static void vl_api_one_stats_enable_disable_t_handler(vl_api_one_stats_enable_disable_t *mp)
static void vl_api_one_add_del_local_eid_t_handler(vl_api_one_add_del_local_eid_t *mp)
#define REPLY_MACRO4(t, n, body)
Reply for gpe enable/disable.
add or delete locator_set
static void vl_api_one_add_del_map_server_t_handler(vl_api_one_add_del_map_server_t *mp)
#define REPLY_MACRO2(t, body)
enable/disable ONE map-register
static void setup_message_id_table(api_main_t *am)
u8 vnet_lisp_get_map_request_mode(void)
#define ip_prefix_len(_a)
reply to one_eid_table_vni_dump
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
add or delete ONE eid-table
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void send_one_locator_details(lisp_cp_main_t *lcm, locator_t *loc, unix_shared_memory_queue_t *q, u32 context)
static void vl_api_one_locator_dump_t_handler(vl_api_one_locator_dump_t *mp)
Request for map server summary status.
#define foreach_vpe_api_msg
static void vl_api_show_one_status_t_handler(vl_api_show_one_status_t *mp)
vnet_api_error_t vnet_lisp_stats_enable_disable(u8 enable)
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
static void vl_api_show_one_map_request_mode_t_handler(vl_api_show_one_map_request_mode_t *mp)
static clib_error_t * one_api_hookup(vlib_main_t *vm)
#define ip_prefix_version(_a)
u8 vnet_lisp_stats_enable_disable_state(void)
u8 vnet_lisp_map_register_state_get(void)
static void send_one_map_server_details(ip_address_t *ip, unix_shared_memory_queue_t *q, u32 context)
int vnet_lisp_set_map_request_mode(u8 mode)
int vnet_lisp_add_del_adjacency(vnet_lisp_add_del_adjacency_args_t *a)
Adds adjacency or removes forwarding entry associated to remote mapping.
configure or disable use of PETR
Request for map request itr rlocs summary status.
lisp_msmr_t * map_servers
static void vl_api_one_adjacencies_get_t_handler(vl_api_one_adjacencies_get_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void vl_api_one_get_map_request_itr_rlocs_t_handler(vl_api_one_get_map_request_itr_rlocs_t *mp)
Request for ONE map-request mode.
Request for ONE adjacencies.
Request for one_eid_table_map_details.
#define gid_address_sd_src(_a)
static void vl_api_one_add_del_map_resolver_t_handler(vl_api_one_add_del_map_resolver_t *mp)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
Dumps all VNIs used in mappings.
static void vl_api_one_enable_disable_t_handler(vl_api_one_enable_disable_t *mp)
static void vl_api_one_add_del_adjacency_t_handler(vl_api_one_add_del_adjacency_t *mp)
static void vl_api_one_map_resolver_dump_t_handler(vl_api_one_map_resolver_dump_t *mp)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
static int unformat_one_eid_api(gid_address_t *dst, u32 vni, u8 type, void *src, u8 len)
add or delete ONE adjacency adjacency
Reply for one_add_del_adjacency.
vl_api_one_local_locator_t locators[locator_num]
u32 petr_map_index
Proxy ETR map index.
#define ip_addr_version(_a)
static void vl_api_one_add_del_map_request_itr_rlocs_t_handler(vl_api_one_add_del_map_request_itr_rlocs_t *mp)
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
u32 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
static void vl_api_one_map_register_enable_disable_t_handler(vl_api_one_map_register_enable_disable_t *mp)
void ip_address_copy_addr(void *dst, const ip_address_t *src)
int vnet_lisp_pitr_set_locator_set(u8 *locator_set_name, u8 is_add)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 vnet_lisp_rloc_probe_state_get(void)
counter_t packets
packet counter
static void vl_api_one_eid_table_vni_dump_t_handler(vl_api_one_eid_table_vni_dump_t *mp)
static void send_one_map_resolver_details(ip_address_t *ip, unix_shared_memory_queue_t *q, u32 context)
#define gid_address_mac(_a)
static u8 fid_type_to_api_type(fid_address_t *fid)
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.
Request for ONE PITR status.
void gid_address_free(gid_address_t *a)
static void vl_api_one_add_del_remote_mapping_t_handler(vl_api_one_add_del_remote_mapping_t *mp)
Request for ONE PETR status.
lisp_api_stats_t * vnet_lisp_get_stats(void)
Reply for map_resolver add/del.
set ONE map-request mode.
Reply for show_one_rloc_probe_state.
int vnet_lisp_add_del_mapping(gid_address_t *eid, locator_t *rlocs, u8 action, u8 authoritative, u32 ttl, u8 is_add, u8 is_static, u32 *res_map_index)
Adds/removes/updates mapping.
add or delete map-resolver
void ip_prefix_normalize(ip_prefix_t *a)
VLIB_API_INIT_FUNCTION(one_api_hookup)
#define gid_address_ippref(_a)
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
#define BAD_SW_IF_INDEX_LABEL
Request for map one locator status.
void * vl_msg_api_alloc(int nbytes)
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
Shows relationship between vni and vrf/bd.
vl_api_one_remote_locator_t rlocs[rloc_num]
static void vl_api_one_use_petr_t_handler(vl_api_one_use_petr_t *mp)
void gid_address_ip_set(gid_address_t *dst, void *src, u8 version)
Get state of ONE map-register.
Reply for one_rloc_probe_enable_disable.
#define vec_free(V)
Free vector's memory (no header).
#define gid_address_ippref_len(_a)
#define clib_warning(format, args...)
static void send_eid_table_vni(u32 vni, unix_shared_memory_queue_t *q, u32 context)
#define clib_memcpy(a, b, c)
Reply for one_add_del_remote_mapping.
#define fid_addr_ip_version(_a)
int vnet_lisp_map_register_enable_disable(u8 is_enable)
Reply for one_add_del_map_server.
Reply for show_one_map_request_mode.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void vl_api_show_one_rloc_probe_state_t_handler(vl_api_show_one_rloc_probe_state_t *mp)
static void vl_api_show_one_stats_enable_disable_t_handler(vl_api_show_one_stats_enable_disable_t *mp)
#define fid_addr_ippref(_a)
u8 vnet_lisp_enable_disable_status(void)
struct _gid_address_t gid_address_t
Reply for local_eid add/del.
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
#define fid_addr_type(_a)
static void vl_api_show_one_map_register_state_t_handler(vl_api_show_one_map_register_state_t *mp)
int vnet_lisp_clear_all_remote_adjacencies(void)
map/unmap vni/bd_index to vrf
#define gid_address_sd_dst(_a)
gid_dictionary_t mapping_index_by_gid
#define REPLY_DETAILS(t, body)
locator_set_t * locator_set_pool
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
static void vl_api_one_locator_set_dump_t_handler(vl_api_one_locator_set_dump_t *mp)
Get state of ONE RLOC probing.
ONE PETR status, enable or disable.
Reply for locator add/del.
static void vl_api_one_stats_dump_t_handler(vl_api_one_stats_dump_t *mp)
Reply for one_pitr_set_locator_set.
Reply for one_map_register_enable_disable.
add or delete remote static mapping
static void vl_api_one_eid_table_map_dump_t_handler(vl_api_one_eid_table_map_dump_t *mp)
counter_t bytes
byte counter
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
#define gid_address_ip(_a)
#define gid_address_vni(_a)
Reply for one_map_request_mode.
add or delete locator for locator set
static void vl_api_one_add_del_locator_set_t_handler(vl_api_one_add_del_locator_set_t *mp)
Reply for locator_set add/del.
Request for map resolver summary status.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
static void vl_api_one_add_del_locator_t_handler(vl_api_one_add_del_locator_t *mp)
enable/disable ONE RLOC probing
int vnet_lisp_add_del_locator(vnet_lisp_add_del_locator_set_args_t *a, locator_set_t *ls, u32 *ls_result)
uword * locator_set_index_by_name
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
static void vl_api_one_map_request_mode_t_handler(vl_api_one_map_request_mode_t *mp)
static void vl_api_one_pitr_set_locator_set_t_handler(vl_api_one_pitr_set_locator_set_t *mp)
#define hash_get_mem(h, key)
void mac_copy(void *dst, void *src)
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
static void vl_api_show_one_pitr_t_handler(vl_api_show_one_pitr_t *mp)
#define vec_foreach(var, vec)
Vector iterator.
#define fid_addr_prefix_length(_a)
static void vl_api_show_one_use_petr_t_handler(vl_api_show_one_use_petr_t *mp)
Request for eid table summary status.
Request for locator_set summary status.
static void send_one_locator_set_details(lisp_cp_main_t *lcm, locator_set_t *lsit, unix_shared_memory_queue_t *q, u32 context, u32 ls_index)
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
Reply for one_eid_table_add_del_map.
static void send_eid_table_map_pair(hash_pair_t *p, unix_shared_memory_queue_t *q, u32 context)
static locator_t * unformat_one_locs(vl_api_one_remote_locator_t *rmt_locs, u32 rloc_num)
Reply for one_add_del_map_request_itr_rlocs.
Reply for show_one_map_register_state.
static void lisp_fid_addr_to_api(fid_address_t *fid, u8 *dst, u8 *api_eid_type, u8 *prefix_length)
configure or disable ONE PITR node
#define VALIDATE_SW_IF_INDEX(mp)
struct _unix_shared_memory_queue unix_shared_memory_queue_t
vl_api_one_adjacency_t adjacencies[count]
static void one_adjacency_copy(vl_api_one_adjacency_t *dst, lisp_adjacency_t *adjs)
static void vl_api_one_map_server_dump_t_handler(vl_api_one_map_server_dump_t *mp)
static void send_one_eid_table_details(mapping_t *mapit, unix_shared_memory_queue_t *q, u32 context, u8 filter)