30 #define vl_api_remote_locator_t_endian vl_noop_handler 31 #define vl_api_remote_locator_t_print vl_noop_handler 32 #define vl_api_local_locator_t_endian vl_noop_handler 33 #define vl_api_local_locator_t_print vl_noop_handler 35 #define vl_api_lisp_add_del_locator_set_t_endian vl_noop_handler 36 #define vl_api_lisp_add_del_locator_set_t_print vl_noop_handler 37 #define vl_api_lisp_add_del_remote_mapping_t_endian vl_noop_handler 38 #define vl_api_lisp_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 foreach_vpe_api_msg \ 62 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \ 63 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \ 64 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \ 65 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \ 66 _(LISP_ADD_DEL_MAP_SERVER, lisp_add_del_map_server) \ 67 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \ 68 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \ 69 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \ 70 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \ 71 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \ 72 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \ 73 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \ 74 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \ 75 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ 76 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \ 77 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ 78 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ 79 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \ 80 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ 81 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ 82 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \ 83 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \ 84 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \ 85 _(SHOW_LISP_STATUS, show_lisp_status) \ 86 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ 87 lisp_add_del_map_request_itr_rlocs) \ 88 _(LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs) \ 89 _(SHOW_LISP_PITR, show_lisp_pitr) \ 90 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \ 91 _(LISP_USE_PETR, lisp_use_petr) \ 92 _(SHOW_LISP_USE_PETR, show_lisp_use_petr) \ 101 for (i = 0; i < rloc_num; i++)
105 memset (&loc, 0,
sizeof (loc));
125 u32 ls_index = ~0, locator_num;
129 memset (a, 0,
sizeof (a[0]));
135 a->
name = locator_name;
138 locator_num = clib_net_to_host_u32 (mp->
locator_num);
140 memset (&locator, 0,
sizeof (locator));
141 for (i = 0; i < locator_num; i++)
163 rmp->
ls_index = clib_host_to_net_u32 (ls_index);
171 vl_api_lisp_add_del_locator_reply_t *rmp;
178 memset (&locator, 0,
sizeof (locator));
179 memset (a, 0,
sizeof (a[0]));
191 a->
name = locator_name;
228 return VNET_API_ERROR_INVALID_VALUE;
239 vl_api_lisp_add_del_local_eid_reply_t *rmp;
244 u32 locator_set_index = ~0, map_index = ~0;
247 memset (a, 0,
sizeof (a[0]));
248 memset (eid, 0,
sizeof (eid[0]));
261 rv = VNET_API_ERROR_INVALID_VALUE;
264 locator_set_index = p[0];
291 vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
294 clib_net_to_host_u32 (mp->
dp_table),
296 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
302 vl_api_lisp_add_del_map_server_reply_t *rmp;
306 memset (&addr, 0,
sizeof (addr));
311 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
318 vl_api_lisp_add_del_map_resolver_reply_t *rmp;
322 memset (a, 0,
sizeof (a[0]));
329 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
336 vl_api_lisp_map_register_enable_disable_reply_t *rmp;
347 vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
357 vl_api_lisp_enable_disable_reply_t *rmp;
382 vl_api_lisp_map_request_mode_reply_t *rmp;
394 vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
404 REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
410 vl_api_lisp_use_petr_reply_t *rmp;
432 memset (&addr, 0,
sizeof (addr));
433 status = lcm->
flags & LISP_FLAG_USE_PETR;
475 vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
477 u8 *locator_set_name =
NULL;
491 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
499 vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
502 u32 rloc_num = clib_net_to_host_u32 (mp->
rloc_num);
504 memset (eid, 0,
sizeof (eid[0]));
516 memset (a, 0,
sizeof (*a));
531 memset (m_args, 0,
sizeof (m_args[0]));
550 REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
556 vl_api_lisp_add_del_adjacency_reply_t *rmp;
560 memset (a, 0,
sizeof (a[0]));
585 memset (rmp, 0,
sizeof (*rmp));
586 rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_DETAILS);
613 u32 ls_index = ~0, *locit = 0;
658 memset (rmp, 0,
sizeof (*rmp));
659 rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_SET_DETAILS);
666 strncpy ((
char *) rmp->
ls_name, (
char *) lsit->
name,
671 str =
format (0,
"<remote-%d>", ls_index);
695 if (filter && !((1 == filter && lsit->local) ||
696 (2 == filter && !lsit->local)))
723 prefix_length[0] = 0;
769 ip_prefix_t *ip_prefix =
NULL;
785 clib_warning (
"Filter error, unknown filter: %d", filter);
798 memset (rmp, 0,
sizeof (*rmp));
799 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_DETAILS);
808 rmp->
ttl = clib_host_to_net_u32 (mapit->
ttl);
867 memset (eid, 0,
sizeof (*eid));
885 send_lisp_eid_table_details(mapit, reg, mp->context,
899 memset (rmp, 0,
sizeof (*rmp));
900 rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_SERVER_DETAILS);
948 memset (rmp, 0,
sizeof (*rmp));
949 rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_RESOLVER_DETAILS);
997 memset (rmp, 0,
sizeof (*rmp));
998 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_MAP_DETAILS);
1000 rmp->
vni = clib_host_to_net_u32 (p->
key);
1013 uword *vni_table = 0;
1042 memset (rmp, 0,
sizeof (*rmp));
1043 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS);
1045 rmp->
vni = clib_host_to_net_u32 (vni);
1056 for (i = 0; i < n; i++)
1059 memset (&a, 0,
sizeof (a));
1114 REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
1128 u32 vni = clib_net_to_host_u32 (mp->
vni);
1160 hash_set (vnis, p->key, 0);
1165 hash_set (vnis, p->key, 0);
1204 tmp_str =
format (0,
" ");
1214 REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1234 u8 is_enabled = (lcm->
flags & LISP_FLAG_PITR_MODE)
1239 tmp_str =
format (0,
"N/A");
1252 tmp_str =
format (0,
"N/A");
1274 #define vl_msg_name_crc_list 1276 #undef vl_msg_name_crc_list 1281 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1282 foreach_vl_msg_name_crc_lisp;
1292 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1293 vl_api_##n##_t_handler, \ 1295 vl_api_##n##_t_endian, \ 1296 vl_api_##n##_t_print, \ 1297 sizeof(vl_api_##n##_t), 1);
Reply for show_lisp_map_register_state.
static void send_lisp_eid_table_details(mapping_t *mapit, vl_api_registration_t *reg, u32 context, u8 filter)
vl_api_local_locator_t locators[locator_num]
#define gid_address_ip_version(_a)
static void send_eid_table_map_pair(hash_pair_t *p, vl_api_registration_t *reg, u32 context)
boost::asio::ip::address ip_address_t
enable/disable LISP RLOC probing
#define gid_address_type(_a)
static u8 fid_type_to_api_type(fid_address_t *fid)
u8 vnet_lisp_gpe_enable_disable_status(void)
Check if LISP-GPE is enabled.
static void vl_api_lisp_get_map_request_itr_rlocs_t_handler(vl_api_lisp_get_map_request_itr_rlocs_t *mp)
lisp_msmr_t * map_resolvers
VLIB_API_INIT_FUNCTION(lisp_api_hookup)
configure or disable LISP PITR node
Reply for locator_set add/del.
#define REPLY_MACRO4(t, n, body)
LISP map resolver status.
vl_api_lisp_adjacency_t adjacencies[count]
#define REPLY_MACRO2(t, body)
static void lisp_adjacency_copy(vl_api_lisp_adjacency_t *dst, lisp_adjacency_t *adjs)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void send_lisp_map_resolver_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
u8 vnet_lisp_get_map_request_mode(void)
#define ip_prefix_len(_a)
static void vl_api_lisp_add_del_map_server_t_handler(vl_api_lisp_add_del_map_server_t *mp)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Request for lisp_eid_table_map_details.
configure or disable use of PETR
static void vl_api_lisp_pitr_set_locator_set_t_handler(vl_api_lisp_pitr_set_locator_set_t *mp)
Request for LISP PETR status.
static void send_lisp_locator_details(lisp_cp_main_t *lcm, locator_t *loc, vl_api_registration_t *reg, u32 context)
static void vl_api_lisp_eid_table_add_del_map_t_handler(vl_api_lisp_eid_table_add_del_map_t *mp)
static void vl_api_lisp_add_del_locator_set_t_handler(vl_api_lisp_add_del_locator_set_t *mp)
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.
static void vl_api_lisp_locator_dump_t_handler(vl_api_lisp_locator_dump_t *mp)
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
void * vl_msg_api_alloc(int nbytes)
#define ip_prefix_version(_a)
u8 vnet_lisp_map_register_state_get(void)
int vnet_lisp_set_map_request_mode(u8 mode)
Reply for show_lisp_map_request_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.
Request for map resolver summary status.
static void vl_api_lisp_map_register_enable_disable_t_handler(vl_api_lisp_map_register_enable_disable_t *mp)
lisp_msmr_t * map_servers
add or delete LISP adjacency adjacency
memset(h->entries, 0, sizeof(h->entries[0])*entries)
#define foreach_vpe_api_msg
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void vl_api_lisp_rloc_probe_enable_disable_t_handler(vl_api_lisp_rloc_probe_enable_disable_t *mp)
static void vl_api_lisp_add_del_remote_mapping_t_handler(vl_api_lisp_add_del_remote_mapping_t *mp)
#define gid_address_sd_src(_a)
static void vl_api_show_lisp_map_register_state_t_handler(vl_api_show_lisp_map_register_state_t *mp)
#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)
Get LISP map request itr rlocs status.
Reply for show_lisp_rloc_probe_state.
add or delete map request itr rlocs
int vnet_lisp_eid_table_map(u32 vni, u32 dp_id, u8 is_l2, u8 is_add)
static lisp_cp_main_t * vnet_lisp_cp_get_main()
u32 petr_map_index
Proxy ETR map index used for 'use-petr'.
#define ip_addr_version(_a)
static void vl_api_lisp_use_petr_t_handler(vl_api_lisp_use_petr_t *mp)
clib_error_t * vnet_lisp_enable_disable(u8 is_enable)
static void vl_api_show_lisp_pitr_t_handler(vl_api_show_lisp_pitr_t *mp)
Get state of LISP map-register.
Get state of LISP RLOC probing.
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)
#define gid_address_mac(_a)
set LISP map-request mode.
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 LISP adjacencies.
void gid_address_free(gid_address_t *a)
add or delete lisp eid-table
static void vl_api_lisp_map_server_dump_t_handler(vl_api_lisp_map_server_dump_t *mp)
static void vl_api_lisp_add_del_adjacency_t_handler(vl_api_lisp_add_del_adjacency_t *mp)
void ip_prefix_normalize(ip_prefix_t *a)
#define gid_address_ippref(_a)
LISP PETR status, enable or disable.
API main structure, used by both vpp and binary API clients.
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
Request for lisp-gpe protocol status.
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
enable or disable LISP feature
Shows relationship between vni and vrf/bd.
void gid_address_ip_set(gid_address_t *dst, void *src, u8 version)
static void vl_api_show_lisp_status_t_handler(vl_api_show_lisp_status_t *mp)
#define vec_free(V)
Free vector's memory (no header).
#define gid_address_ippref_len(_a)
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
static void vl_api_lisp_locator_set_dump_t_handler(vl_api_lisp_locator_set_dump_t *mp)
int vnet_lisp_map_register_enable_disable(u8 is_enable)
add or delete map-resolver
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Request for map lisp locator status.
#define fid_addr_ippref(_a)
u8 vnet_lisp_enable_disable_status(void)
struct _gid_address_t gid_address_t
static clib_error_t * lisp_api_hookup(vlib_main_t *vm)
int vnet_lisp_add_del_map_server(ip_address_t *addr, u8 is_add)
#define fid_addr_type(_a)
Request for eid table summary status.
enable/disable LISP map-register
int vnet_lisp_clear_all_remote_adjacencies(void)
Request for locator_set summary status.
#define gid_address_sd_dst(_a)
static void vl_api_show_lisp_use_petr_t_handler(vl_api_show_lisp_use_petr_t *mp)
Reply for lisp_add_del_map_request_itr_rlocs.
static void send_lisp_map_server_details(ip_address_t *ip, vl_api_registration_t *reg, u32 context)
gid_dictionary_t mapping_index_by_gid
locator_set_t * locator_set_pool
Status of lisp pitr, enable or disable.
static void vl_api_lisp_map_resolver_dump_t_handler(vl_api_lisp_map_resolver_dump_t *mp)
int vnet_lisp_rloc_probe_enable_disable(u8 is_enable)
add or delete locator_set
vl_api_remote_locator_t rlocs[rloc_num]
static void lisp_fid_put_api(u8 *dst, fid_address_t *src, u8 *prefix_length)
static void vl_api_lisp_add_del_map_request_itr_rlocs_t_handler(vl_api_lisp_add_del_map_request_itr_rlocs_t *mp)
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
static void vl_api_lisp_add_del_local_eid_t_handler(vl_api_lisp_add_del_local_eid_t *mp)
int vnet_lisp_add_del_locator_set(vnet_lisp_add_del_locator_set_args_t *a, u32 *ls_result)
#define gid_address_ip(_a)
Status of lisp, enable or disable.
#define gid_address_vni(_a)
Request for map server summary status.
static void vl_api_lisp_eid_table_dump_t_handler(vl_api_lisp_eid_table_dump_t *mp)
static void vl_api_show_lisp_map_request_mode_t_handler(vl_api_show_lisp_map_request_mode_t *mp)
static locator_t * unformat_lisp_locs(vl_api_remote_locator_t *rmt_locs, u32 rloc_num)
static void send_eid_table_vni(u32 vni, vl_api_registration_t *reg, u32 context)
#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 send_lisp_locator_set_details(lisp_cp_main_t *lcm, locator_set_t *lsit, vl_api_registration_t *reg, u32 context, u32 ls_index)
add or delete locator for locator_set
int vnet_lisp_del_mapping(gid_address_t *eid, u32 *res_map_index)
Removes a mapping.
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
add or delete remote static mapping
static void setup_message_id_table(api_main_t *am)
static void vl_api_lisp_map_request_mode_t_handler(vl_api_lisp_map_request_mode_t *mp)
void gid_address_copy(gid_address_t *dst, gid_address_t *src)
#define hash_get_mem(h, key)
void mac_copy(void *dst, void *src)
static void vl_api_lisp_enable_disable_t_handler(vl_api_lisp_enable_disable_t *mp)
int vnet_lisp_add_del_map_resolver(vnet_lisp_add_del_map_resolver_args_t *a)
static void vl_api_lisp_eid_table_vni_dump_t_handler(vl_api_lisp_eid_table_vni_dump_t *mp)
#define vec_foreach(var, vec)
Vector iterator.
Dumps all VNIs used in mappings.
Request for map request itr rlocs summary status.
static void vl_api_lisp_add_del_locator_t_handler(vl_api_lisp_add_del_locator_t *mp)
Request for LISP map-request mode.
static int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, u8 type, void *src, u8 len)
static void vl_api_show_lisp_rloc_probe_state_t_handler(vl_api_show_lisp_rloc_probe_state_t *mp)
int vnet_lisp_use_petr(ip_address_t *ip, u8 is_add)
Configure Proxy-ETR.
reply to lisp_eid_table_vni_dump
static void vl_api_lisp_eid_table_map_dump_t_handler(vl_api_lisp_eid_table_map_dump_t *mp)
Request for lisp pitr status.
#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)