33 #define vl_api_gpe_locator_pair_t_endian vl_noop_handler 34 #define vl_api_gpe_locator_pair_t_print vl_noop_handler 35 #define vl_api_gpe_add_del_fwd_entry_t_endian vl_noop_handler 36 #define vl_api_gpe_add_del_fwd_entry_t_print vl_noop_handler 47 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 54 #define foreach_vpe_api_msg \ 55 _(GPE_ADD_DEL_FWD_ENTRY, gpe_add_del_fwd_entry) \ 56 _(GPE_FWD_ENTRIES_GET, gpe_fwd_entries_get) \ 57 _(GPE_FWD_ENTRY_PATH_DUMP, gpe_fwd_entry_path_dump) \ 58 _(GPE_ENABLE_DISABLE, gpe_enable_disable) \ 59 _(GPE_ADD_DEL_IFACE, gpe_add_del_iface) \ 60 _(GPE_SET_ENCAP_MODE, gpe_set_encap_mode) \ 61 _(GPE_GET_ENCAP_MODE, gpe_get_encap_mode) 70 for (i = 0; i < rloc_num; i++)
74 memset (&pair, 0,
sizeof (pair));
81 for (i = rloc_num; i < rloc_num * 2; i++)
85 p = &pairs[i - rloc_num];
115 return VNET_API_ERROR_INVALID_VALUE;
132 const ip_address_t *
addr,
u8 weight)
138 memcpy (loc->
addr, addr, 4);
143 memcpy (loc->
addr, addr, 16);
174 memset (rmp, 0,
sizeof (*rmp));
178 clib_host_to_net_u16 (VL_API_GPE_FWD_ENTRY_PATH_DETAILS);
200 memset (dst, 0,
sizeof (*dst));
237 mp->
vni = clib_net_to_host_u32 (mp->
vni);
254 for (i = 0; i < mp->
count; i++)
290 mp->
vni = clib_net_to_host_u32 (mp->
vni);
304 memset (a, 0,
sizeof (a[0]));
318 if (rv || 0 == pairs)
409 #define vl_msg_name_crc_list 411 #undef vl_msg_name_crc_list 416 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 417 foreach_vl_msg_name_crc_lisp_gpe;
427 vl_msg_api_set_handlers(VL_API_##N, #n, \ 428 vl_api_##n##_t_handler, \ 430 vl_api_##n##_t_endian, \ 431 vl_api_##n##_t_print, \ 432 sizeof(vl_api_##n##_t), 1);
void lisp_gpe_tenant_l2_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
vl_api_gpe_locator_t lcl_loc
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
Set GPE encapsulation mode.
sll srl srl sll sra u16x4 i
#define gid_address_type(_a)
Reply for gpe_iface add/del.
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
Reply for gpe enable/disable.
#define REPLY_MACRO4(t, n, body)
static void gpe_fwd_entry_path_dump_t_net_to_host(vl_api_gpe_fwd_entry_path_dump_t *mp)
void lisp_gpe_tenant_l3_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
#define REPLY_MACRO2(t, body)
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
#define ip_prefix_len(_a)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static void vl_api_gpe_add_del_iface_t_handler(vl_api_gpe_add_del_iface_t *mp)
vl_api_gpe_fwd_entry_t entries[count]
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
#define ip_prefix_version(_a)
Reply for set_encap_mode.
static void setup_message_id_table(api_main_t *am)
static void vl_api_gpe_add_del_fwd_entry_t_handler(vl_api_gpe_add_del_fwd_entry_t *mp)
lisp_gpe_fwd_entry_type_t type
The forwarding entry type.
static void vl_api_gpe_get_encap_mode_t_handler(vl_api_gpe_get_encap_mode_t *mp)
u32 lisp_gpe_tenant_l2_iface_add_or_lock(u32 vni, u32 bd_id)
Add/create and lock a new or find and lock the existing L2 interface for the tenant.
#define ip_addr_version(_a)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Common utility functions for IPv4, IPv6 and L2 LISP-GPE tunnels.
lisp_api_gpe_fwd_entry_t * vnet_lisp_gpe_fwd_entries_get_by_vni(u32 vni)
#define gid_address_mac(_a)
Reply for set_encap_mode.
vl_api_gpe_locator_t locs[loc_num]
static void vl_api_gpe_set_encap_mode_t_handler(vl_api_gpe_set_encap_mode_t *mp)
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
void ip_prefix_normalize(ip_prefix_t *a)
#define gid_address_ippref(_a)
vl_api_gpe_locator_t rmt_loc
get GPE encapsulation mode
static void lisp_api_set_locator(vl_api_gpe_locator_t *loc, const ip_address_t *addr, u8 weight)
static void gpe_fwd_entries_copy(vl_api_gpe_fwd_entry_t *dst, lisp_api_gpe_fwd_entry_t *src)
u32 vni
VNI/tenant id in HOST byte order.
void * vl_msg_api_alloc(int nbytes)
void gid_address_ip_set(gid_address_t *dst, void *src, u8 version)
#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)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
lisp_gpe_tunnel_key_t * key
RLOC pair and rloc fib_index.
#define fid_addr_ippref(_a)
int vnet_lisp_gpe_add_del_fwd_entry(vnet_lisp_gpe_add_del_fwd_entry_args_t *a, u32 *hw_if_indexp)
Forwarding entry create/remove dispatcher.
struct _gid_address_t gid_address_t
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
#define fid_addr_type(_a)
A path on which to forward lisp traffic.
u8 weight
[UE]CMP weigt for the path
static void gpe_entry_t_host_to_net(vl_api_gpe_fwd_entry_t *e)
static clib_error_t * gpe_api_hookup(vlib_main_t *vm)
int vnet_gpe_set_encap_mode(gpe_encap_mode_t mode)
Set GPE encapsulation mode.
gid_address_t rmt_eid
remote eid
static void vl_api_gpe_fwd_entry_path_dump_t_handler(vl_api_gpe_fwd_entry_path_dump_t *mp)
#define foreach_vpe_api_msg
negative_fwd_actions_e action
action for negative mappings
#define gid_address_vni(_a)
struct lisp_gpe_fwd_entry_t_ * lisp_fwd_entry_pool
A Pool of all LISP forwarding entries.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
u32 dp_table
generic access
static void gpe_fwd_entries_get_t_net_to_host(vl_api_gpe_fwd_entries_get_t *mp)
locator_pair_t * locator_pairs
vector of locator pairs
lisp_fwd_path_t * paths
When the type is 'normal' The RLOC pair that form the route's paths.
Reply for gpe_fwd_entry add/del.
#define vec_foreach(var, vec)
Vector iterator.
static void vl_api_gpe_fwd_entries_get_t_handler(vl_api_gpe_fwd_entries_get_t *mp)
static void vl_api_gpe_enable_disable_t_handler(vl_api_gpe_enable_disable_t *mp)
VLIB_API_INIT_FUNCTION(gpe_api_hookup)
gid_address_t lcl_eid
local eid
static int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, u8 type, void *src, u8 len)
static locator_pair_t * unformat_gpe_loc_pairs(void *locs, u32 rloc_num)
u32 lisp_gpe_tenant_l3_iface_add_or_lock(u32 vni, u32 table_id)
Add/create and lock a new or find and lock the existing L3 interface for the tenant.
ip_address_t remote_rloc
remote RLOC.
static void gpe_add_del_fwd_entry_t_net_to_host(vl_api_gpe_add_del_fwd_entry_t *mp)
enable or disable gpe protocol
static void gpe_fwd_entries_get_reply_t_host_to_net(vl_api_gpe_fwd_entries_get_reply_t *mp)
struct _unix_shared_memory_queue unix_shared_memory_queue_t
index_t lisp_adj
The adjacency constructed for the locator pair.