33 #include <lisp/lisp-cp/lisp.api_enum.h> 34 #include <lisp/lisp-cp/lisp.api_types.h> 40 #define REPLY_MSG_ID_BASE lisp_base_msg_id 49 vl_api_remote_locator_t *r;
51 for (i = 0; i < rloc_num; i++)
57 loc.address.ippref.len =
60 loc.priority = r->priority;
61 loc.weight = r->weight;
76 vl_api_local_locator_t *ls_loc;
77 u32 ls_index = ~0, locator_num;
78 u8 *locator_name = NULL;
87 a->
name = locator_name;
90 locator_num = clib_net_to_host_u32 (mp->
locator_num);
93 for (i = 0; i < locator_num; i++)
100 locator.
weight = ls_loc->weight;
115 rmp->
ls_index = clib_host_to_net_u32 (ls_index);
123 vl_api_lisp_add_del_locator_reply_t *rmp;
128 u8 *locator_name = NULL;
143 a->
name = locator_name;
159 vl_api_lisp_add_del_local_eid_reply_t *rmp;
164 u32 locator_set_index = ~0, map_index = ~0;
180 rv = VNET_API_ERROR_INVALID_VALUE;
183 locator_set_index = p[0];
194 a->
key_id = clib_net_to_host_u16 (mp->
key.id);
210 vl_api_lisp_eid_table_add_del_map_reply_t *rmp;
213 clib_net_to_host_u32 (mp->
dp_table),
215 REPLY_MACRO (VL_API_LISP_EID_TABLE_ADD_DEL_MAP_REPLY)}
221 vl_api_lisp_add_del_map_server_reply_t *rmp;
230 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_SERVER_REPLY);
237 vl_api_lisp_add_del_map_resolver_reply_t *rmp;
248 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_RESOLVER_REPLY);
255 vl_api_lisp_map_register_enable_disable_reply_t *rmp;
266 vl_api_lisp_rloc_probe_enable_disable_reply_t *rmp;
276 vl_api_lisp_enable_disable_reply_t *rmp;
301 vl_api_lisp_map_request_mode_reply_t *rmp;
313 vl_api_lisp_pitr_set_locator_set_reply_t *rmp;
323 REPLY_MACRO (VL_API_LISP_PITR_SET_LOCATOR_SET_REPLY);
329 vl_api_lisp_use_petr_reply_t *rmp;
352 status = lcm->
flags & LISP_FLAG_USE_PETR;
378 vl_api_lisp_add_del_map_request_itr_rlocs_reply_t *rmp;
380 u8 *locator_set_name = NULL;
394 REPLY_MACRO (VL_API_LISP_ADD_DEL_MAP_REQUEST_ITR_RLOCS_REPLY);
402 vl_api_lisp_add_del_remote_mapping_reply_t *rmp;
405 u32 rloc_num = clib_net_to_host_u32 (mp->
rloc_num);
452 REPLY_MACRO (VL_API_LISP_ADD_DEL_REMOTE_MAPPING_REPLY);
458 vl_api_lisp_add_del_adjacency_reply_t *rmp;
512 u32 ls_index = ~0, *locit = 0;
566 strncpy ((
char *) rmp->
ls_name, (
char *) lsit->
name,
571 str =
format (0,
"<remote-%d>", ls_index);
595 if (filter && !((1 == filter && lsit->
local) ||
596 (2 == filter && !lsit->
local)))
630 clib_warning (
"Filter error, unknown filter: %d", filter);
651 rmp->
ttl = clib_host_to_net_u32 (mapit->
ttl);
672 rmp->
key.id = clib_host_to_net_u16 (mapit->
key_id);
795 rmp->
vni = clib_host_to_net_u32 (p->
key);
808 uword *vni_table = 0;
841 rmp->
vni = clib_host_to_net_u32 (vni);
849 vl_api_lisp_adjacency_t
a;
852 for (i = 0; i < n; i++)
887 REPLY_MACRO2 (VL_API_SHOW_LISP_MAP_REGISTER_STATE_REPLY,
901 u32 vni = clib_net_to_host_u32 (mp->
vni);
904 size =
vec_len (adjs) *
sizeof (vl_api_lisp_adjacency_t);
933 hash_set (vnis, p->key, 0);
938 hash_set (vnis, p->key, 0);
977 tmp_str =
format (0,
" ");
987 REPLY_MACRO2(VL_API_LISP_GET_MAP_REQUEST_ITR_RLOCS_REPLY,
1007 u8 is_enabled = (lcm->
flags & LISP_FLAG_PITR_MODE)
1012 tmp_str =
format (0,
"N/A");
1025 tmp_str =
format (0,
"N/A");
1047 #include <lisp/lisp-cp/lisp.api.c>
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 pool_foreach(VAR, POOL)
Iterate through pool.
#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 u32 lisp_base_msg_id
Base message ID fot the plugin.
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]
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)
bool is_add[default=true]
description fragment has unexpected format
#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)
vl_api_lisp_locator_set_filter_t filter
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.
lisp_adjacency_t * vnet_lisp_adjacencies_get_by_vni(u32 vni)
Returns vector of adjacencies.
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.
static void setup_message_id_table(api_main_t *am)
#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...)
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)
#define REPLY_MSG_ID_BASE
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 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 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)