31 #define vl_api_lisp_add_del_locator_set_t_endian vl_noop_handler 32 #define vl_api_lisp_add_del_locator_set_t_print vl_noop_handler 33 #define vl_api_lisp_add_del_remote_mapping_t_endian vl_noop_handler 34 #define vl_api_lisp_add_del_remote_mapping_t_print vl_noop_handler 36 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler 37 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler 38 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler 39 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler 50 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 57 #define foreach_vpe_api_msg \ 58 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \ 59 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \ 60 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \ 61 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \ 62 _(LISP_ADD_DEL_MAP_SERVER, lisp_add_del_map_server) \ 63 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \ 64 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \ 65 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \ 66 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \ 67 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \ 68 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \ 69 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \ 70 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \ 71 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ 72 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \ 73 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ 74 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ 75 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \ 76 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ 77 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ 78 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \ 79 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \ 80 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \ 81 _(SHOW_LISP_STATUS, show_lisp_status) \ 82 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ 83 lisp_add_del_map_request_itr_rlocs) \ 84 _(LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs) \ 85 _(SHOW_LISP_PITR, show_lisp_pitr) \ 86 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \ 87 _(LISP_USE_PETR, lisp_use_petr) \ 88 _(SHOW_LISP_USE_PETR, show_lisp_use_petr) \ 95 vl_api_remote_locator_t *r;
97 for (i = 0; i < rloc_num; i++)
105 loc.priority = r->priority;
106 loc.weight = r->weight;
121 vl_api_local_locator_t *ls_loc;
122 u32 ls_index = ~0, locator_num;
132 a->
name = locator_name;
135 locator_num = clib_net_to_host_u32 (mp->
locator_num);
138 for (i = 0; i < locator_num; i++)
144 locator.
priority = ls_loc->priority;
145 locator.
weight = ls_loc->weight;
160 rmp->
ls_index = clib_host_to_net_u32 (ls_index);
168 vl_api_lisp_add_del_locator_reply_t *rmp;
188 a->
name = locator_name;
225 return VNET_API_ERROR_INVALID_VALUE;
236 vl_api_lisp_add_del_local_eid_reply_t *rmp;
241 u32 locator_set_index = ~0, map_index = ~0;
258 rv = VNET_API_ERROR_INVALID_VALUE;
261 locator_set_index = p[0];
288 vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
291 clib_net_to_host_u32 (mp->
dp_table),
293 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
299 vl_api_lisp_add_del_map_server_reply_t *rmp;
308 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
315 vl_api_lisp_add_del_map_resolver_reply_t *rmp;
326 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
333 vl_api_lisp_map_register_enable_disable_reply_t *rmp;
344 vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
354 vl_api_lisp_enable_disable_reply_t *rmp;
379 vl_api_lisp_map_request_mode_reply_t *rmp;
391 vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
401 REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
407 vl_api_lisp_use_petr_reply_t *rmp;
430 status = lcm->
flags & LISP_FLAG_USE_PETR;
472 vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
474 u8 *locator_set_name =
NULL;
488 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
496 vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
499 u32 rloc_num = clib_net_to_host_u32 (mp->
rloc_num);
547 REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
553 vl_api_lisp_add_del_adjacency_reply_t *rmp;
583 rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_DETAILS);
610 u32 ls_index = ~0, *locit = 0;
656 rmp->_vl_msg_id = ntohs (VL_API_LISP_LOCATOR_SET_DETAILS);
663 strncpy ((
char *) rmp->
ls_name, (
char *) lsit->
name,
668 str =
format (0,
"<remote-%d>", ls_index);
692 if (filter && !((1 == filter && lsit->local) ||
693 (2 == filter && !lsit->local)))
720 prefix_length[0] = 0;
782 clib_warning (
"Filter error, unknown filter: %d", filter);
796 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_DETAILS);
805 rmp->
ttl = clib_host_to_net_u32 (mapit->
ttl);
882 send_lisp_eid_table_details(mapit, reg, mp->context,
897 rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_SERVER_DETAILS);
946 rmp->_vl_msg_id = ntohs (VL_API_LISP_MAP_RESOLVER_DETAILS);
995 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_MAP_DETAILS);
997 rmp->
vni = clib_host_to_net_u32 (p->
key);
1010 uword *vni_table = 0;
1040 rmp->_vl_msg_id = ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS);
1042 rmp->
vni = clib_host_to_net_u32 (vni);
1050 vl_api_lisp_adjacency_t
a;
1053 for (i = 0; i < n; i++)
1111 REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
1125 u32 vni = clib_net_to_host_u32 (mp->
vni);
1128 size =
vec_len (adjs) *
sizeof (vl_api_lisp_adjacency_t);
1157 hash_set (vnis, p->key, 0);
1162 hash_set (vnis, p->key, 0);
1201 tmp_str =
format (0,
" ");
1211 REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1231 u8 is_enabled = (lcm->
flags & LISP_FLAG_PITR_MODE)
1236 tmp_str =
format (0,
"N/A");
1249 tmp_str =
format (0,
"N/A");
1271 #define vl_msg_name_crc_list 1273 #undef vl_msg_name_crc_list 1278 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1279 foreach_vl_msg_name_crc_lisp;
1289 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1290 vl_api_##n##_t_handler, \ 1292 vl_api_##n##_t_endian, \ 1293 vl_api_##n##_t_print, \ 1294 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)
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.
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
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)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void lisp_adjacency_copy(vl_api_lisp_adjacency_t *dst, lisp_adjacency_t *adjs)
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)
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)
#define ip_addr_version(_a)
void * vl_msg_api_alloc(int nbytes)
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)
#define clib_memcpy(d, s, n)
lisp_msmr_t * map_servers
add or delete LISP adjacency adjacency
#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)
void ip_prefix_normalize(ip_prefix_t *a)
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'.
void ip_address_copy_addr(void *dst, const ip_address_t *src)
static void vl_api_lisp_use_petr_t_handler(vl_api_lisp_use_petr_t *mp)
vl_api_fib_path_type_t type
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.
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)
#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...)
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)
#define ip_prefix_len(_a)
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 ip_prefix_version(_a)
#define hash_get_mem(h, key)
void mac_copy(void *dst, void *src)
static api_main_t * vlibapi_get_main(void)
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)