34 #define vl_api_lisp_add_del_locator_set_t_endian vl_noop_handler 35 #define vl_api_lisp_add_del_locator_set_t_print vl_noop_handler 36 #define vl_api_lisp_add_del_remote_mapping_t_endian vl_noop_handler 37 #define vl_api_lisp_add_del_remote_mapping_t_print vl_noop_handler 39 #define vl_api_one_add_del_locator_set_t_endian vl_noop_handler 40 #define vl_api_one_add_del_locator_set_t_print vl_noop_handler 41 #define vl_api_one_add_del_remote_mapping_t_endian vl_noop_handler 42 #define vl_api_one_add_del_remote_mapping_t_print vl_noop_handler 53 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 60 #define foreach_vpe_api_msg \ 61 _(LISP_ADD_DEL_LOCATOR_SET, lisp_add_del_locator_set) \ 62 _(LISP_ADD_DEL_LOCATOR, lisp_add_del_locator) \ 63 _(LISP_ADD_DEL_LOCAL_EID, lisp_add_del_local_eid) \ 64 _(LISP_ADD_DEL_MAP_RESOLVER, lisp_add_del_map_resolver) \ 65 _(LISP_ADD_DEL_MAP_SERVER, lisp_add_del_map_server) \ 66 _(LISP_ENABLE_DISABLE, lisp_enable_disable) \ 67 _(LISP_RLOC_PROBE_ENABLE_DISABLE, lisp_rloc_probe_enable_disable) \ 68 _(LISP_MAP_REGISTER_ENABLE_DISABLE, lisp_map_register_enable_disable) \ 69 _(LISP_ADD_DEL_REMOTE_MAPPING, lisp_add_del_remote_mapping) \ 70 _(LISP_ADD_DEL_ADJACENCY, lisp_add_del_adjacency) \ 71 _(LISP_PITR_SET_LOCATOR_SET, lisp_pitr_set_locator_set) \ 72 _(LISP_MAP_REQUEST_MODE, lisp_map_request_mode) \ 73 _(LISP_EID_TABLE_ADD_DEL_MAP, lisp_eid_table_add_del_map) \ 74 _(LISP_LOCATOR_SET_DUMP, lisp_locator_set_dump) \ 75 _(LISP_LOCATOR_DUMP, lisp_locator_dump) \ 76 _(LISP_EID_TABLE_DUMP, lisp_eid_table_dump) \ 77 _(LISP_MAP_RESOLVER_DUMP, lisp_map_resolver_dump) \ 78 _(LISP_MAP_SERVER_DUMP, lisp_map_server_dump) \ 79 _(LISP_EID_TABLE_MAP_DUMP, lisp_eid_table_map_dump) \ 80 _(LISP_EID_TABLE_VNI_DUMP, lisp_eid_table_vni_dump) \ 81 _(LISP_ADJACENCIES_GET, lisp_adjacencies_get) \ 82 _(SHOW_LISP_RLOC_PROBE_STATE, show_lisp_rloc_probe_state) \ 83 _(SHOW_LISP_MAP_REGISTER_STATE, show_lisp_map_register_state) \ 84 _(SHOW_LISP_STATUS, show_lisp_status) \ 85 _(LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS, \ 86 lisp_add_del_map_request_itr_rlocs) \ 87 _(LISP_GET_MAP_REQUEST_ITR_RLOCS, lisp_get_map_request_itr_rlocs) \ 88 _(SHOW_LISP_PITR, show_lisp_pitr) \ 89 _(SHOW_LISP_MAP_REQUEST_MODE, show_lisp_map_request_mode) \ 90 _(LISP_USE_PETR, lisp_use_petr) \ 91 _(SHOW_LISP_USE_PETR, show_lisp_use_petr) \ 98 vl_api_remote_locator_t *r;
100 for (i = 0; i < rloc_num; i++)
106 loc.address.ippref.len =
109 loc.priority = r->priority;
110 loc.weight = r->weight;
125 vl_api_local_locator_t *ls_loc;
126 u32 ls_index = ~0, locator_num;
127 u8 *locator_name = NULL;
136 a->
name = locator_name;
139 locator_num = clib_net_to_host_u32 (mp->
locator_num);
142 for (i = 0; i < locator_num; i++)
148 locator.
priority = ls_loc->priority;
149 locator.
weight = ls_loc->weight;
164 rmp->
ls_index = clib_host_to_net_u32 (ls_index);
172 vl_api_lisp_add_del_locator_reply_t *rmp;
177 u8 *locator_name = NULL;
192 a->
name = locator_name;
208 vl_api_lisp_add_del_local_eid_reply_t *rmp;
213 u32 locator_set_index = ~0, map_index = ~0;
229 rv = VNET_API_ERROR_INVALID_VALUE;
232 locator_set_index = p[0];
243 a->
key_id = clib_net_to_host_u16 (mp->
key.id);
259 vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
262 clib_net_to_host_u32 (mp->
dp_table),
264 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
270 vl_api_lisp_add_del_map_server_reply_t *rmp;
279 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
286 vl_api_lisp_add_del_map_resolver_reply_t *rmp;
297 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
304 vl_api_lisp_map_register_enable_disable_reply_t *rmp;
315 vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
325 vl_api_lisp_enable_disable_reply_t *rmp;
350 vl_api_lisp_map_request_mode_reply_t *rmp;
362 vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
372 REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
378 vl_api_lisp_use_petr_reply_t *rmp;
401 status = lcm->
flags & LISP_FLAG_USE_PETR;
427 vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
429 u8 *locator_set_name = NULL;
443 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
451 vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
454 u32 rloc_num = clib_net_to_host_u32 (mp->
rloc_num);
501 REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
507 vl_api_lisp_add_del_adjacency_reply_t *rmp;
535 rmp->_vl_msg_id =
ntohs (VL_API_LISP_LOCATOR_DETAILS);
561 u32 ls_index = ~0, *locit = 0;
607 rmp->_vl_msg_id =
ntohs (VL_API_LISP_LOCATOR_SET_DETAILS);
614 strncpy ((
char *) rmp->
ls_name, (
char *) lsit->
name,
619 str =
format (0,
"<remote-%d>", ls_index);
643 if (filter && !((1 == filter && lsit->local) ||
644 (2 == filter && !lsit->local)))
678 clib_warning (
"Filter error, unknown filter: %d", filter);
690 rmp->_vl_msg_id =
ntohs (VL_API_LISP_EID_TABLE_DETAILS);
699 rmp->
ttl = clib_host_to_net_u32 (mapit->
ttl);
720 rmp->
key.id = clib_host_to_net_u16 (mapit->
key_id);
757 send_lisp_eid_table_details(mapit, reg, mp->context,
772 rmp->_vl_msg_id =
ntohs (VL_API_LISP_MAP_SERVER_DETAILS);
805 rmp->_vl_msg_id =
ntohs (VL_API_LISP_MAP_RESOLVER_DETAILS);
838 rmp->_vl_msg_id =
ntohs (VL_API_LISP_EID_TABLE_MAP_DETAILS);
840 rmp->
vni = clib_host_to_net_u32 (p->
key);
853 uword *vni_table = 0;
883 rmp->_vl_msg_id =
ntohs (VL_API_LISP_EID_TABLE_VNI_DETAILS);
885 rmp->
vni = clib_host_to_net_u32 (vni);
893 vl_api_lisp_adjacency_t
a;
896 for (i = 0; i < n; i++)
931 REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
945 u32 vni = clib_net_to_host_u32 (mp->
vni);
948 size =
vec_len (adjs) *
sizeof (vl_api_lisp_adjacency_t);
977 hash_set (vnis, p->key, 0);
982 hash_set (vnis, p->key, 0);
1021 tmp_str =
format (0,
" ");
1031 REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1051 u8 is_enabled = (lcm->
flags & LISP_FLAG_PITR_MODE)
1056 tmp_str =
format (0,
"N/A");
1069 tmp_str =
format (0,
"N/A");
1091 #define vl_msg_name_crc_list 1093 #undef vl_msg_name_crc_list 1098 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 1099 foreach_vl_msg_name_crc_lisp;
1109 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1110 vl_api_##n##_t_handler, \ 1112 vl_api_##n##_t_endian, \ 1113 vl_api_##n##_t_print, \ 1114 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]
static void send_eid_table_map_pair(hash_pair_t *p, vl_api_registration_t *reg, u32 context)
void lisp_gid_put_api(vl_api_eid_t *eid, const gid_address_t *gid)
enable/disable LISP RLOC probing
#define gid_address_type(_a)
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
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)
vl_api_interface_index_t sw_if_index
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)
vl_api_address_t ip_address
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).
bool is_add[default=true]
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)
bool is_add[default=true]
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)
lisp_msmr_t * map_servers
string locator_set_name[64]
add or delete LISP adjacency adjacency
bool is_add[default=true]
#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)
bool is_enabled[default=true]
static void vl_api_lisp_add_del_remote_mapping_t_handler(vl_api_lisp_add_del_remote_mapping_t *mp)
bool is_add[default=true]
#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.
bool is_add[default=true]
static void vl_api_lisp_adjacencies_get_t_handler(vl_api_lisp_adjacencies_get_t *mp)
bool is_add[default=true]
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'.
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.
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)
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)
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.
bool is_petr_enable[default=true]
string locator_set_name[64]
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
Request for lisp-gpe protocol status.
vl_api_address_t ip_address
int vnet_lisp_add_del_mreq_itr_rlocs(vnet_lisp_add_del_mreq_itr_rloc_args_t *a)
enable or disable LISP feature
bool is_add[default=true]
Shows relationship between vni and vrf/bd.
bool is_add[default=true]
sll srl srl sll sra u16x4 i
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 clib_warning(format, args...)
bool is_enabled[default=true]
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.
bool is_enable[default=true]
u8 vnet_lisp_enable_disable_status(void)
string locator_set_name[64]
vl_api_lisp_locator_set_filter_t filter
struct _gid_address_t gid_address_t
vl_api_address_t ip_address
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)
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
vl_api_address_t ip_address
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 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)
bool is_add[default=true]
vl_api_address_t ip_address
void lisp_fid_put_api(vl_api_eid_t *eid, const fid_address_t *fid)
static void vl_api_lisp_add_del_local_eid_t_handler(vl_api_lisp_add_del_local_eid_t *mp)
bool is_add[default=true]
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)
vl_api_interface_index_t sw_if_index
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)
vl_api_address_t ip_address
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)
u8 ip_address_max_len(u8 version)
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)
bool is_enable[default=true]
#define hash_get_mem(h, key)
string locator_set_name[64]
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)
bool is_enable[default=true]
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.
vl_api_address_t ip_address
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 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.
string locator_set_name[64]
reply to lisp_eid_table_vni_dump
bool is_add[default=true]
int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, const vl_api_eid_t *eid)
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.
string locator_set_name[64]
#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)