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_FWD_ENTRY_VNIS_GET, gpe_fwd_entry_vnis_get) \ 61 _(GPE_SET_ENCAP_MODE, gpe_set_encap_mode) \ 62 _(GPE_GET_ENCAP_MODE, gpe_get_encap_mode) \ 63 _(GPE_ADD_DEL_NATIVE_FWD_RPATH, gpe_add_del_native_fwd_rpath) \ 64 _(GPE_NATIVE_FWD_RPATHS_GET, gpe_native_fwd_rpaths_get) 73 for (i = 0; i < rloc_num; i++)
77 memset (&pair, 0,
sizeof (pair));
84 for (i = rloc_num; i < rloc_num * 2; i++)
88 p = &pairs[i - rloc_num];
118 return VNET_API_ERROR_INVALID_VALUE;
135 const ip_address_t *
addr,
u8 weight)
141 memcpy (loc->
addr, addr, 4);
146 memcpy (loc->
addr, addr, 16);
177 memset (rmp, 0,
sizeof (*rmp));
181 clib_host_to_net_u16 (VL_API_GPE_FWD_ENTRY_PATH_DETAILS);
203 memset (&dst[i], 0,
sizeof (*dst));
242 mp->
vni = clib_net_to_host_u32 (mp->
vni);
250 e->
vni = clib_host_to_net_u32 (e->
vni);
260 for (i = 0; i < mp->
count; i++)
280 REPLY_MACRO4 (VL_API_GPE_FWD_ENTRY_VNIS_GET_REPLY, size,
285 rmp->
vnis[i++] = clib_host_to_net_u32 (p->
key);
321 mp->
vni = clib_net_to_host_u32 (mp->
vni);
335 memset (a, 0,
sizeof (a[0]));
374 vl_api_gpe_enable_disable_reply_t *rmp;
387 vl_api_gpe_add_del_iface_reply_t *rmp;
391 vni = clib_net_to_host_u32 (mp->
vni);
392 dp_table = clib_net_to_host_u32 (mp->
dp_table);
421 vl_api_gpe_set_encap_mode_reply_t *rmp;
446 vl_api_gpe_add_del_native_fwd_rpath_reply_t *rmp;
450 memset (a, 0,
sizeof (a[0]));
461 clib_net_to_host_u32 (mp->
table_id));
464 rv = VNET_API_ERROR_INVALID_VALUE;
473 REPLY_MACRO (VL_API_GPE_ADD_DEL_NATIVE_FWD_RPATH_REPLY);
486 memset (&dst[i], 0,
sizeof (*dst));
513 for (i = 0; i < mp->
count; i++)
530 u8 rpath_index = mp->
is_ip4 ? 0 : 1;
536 REPLY_MACRO4 (VL_API_GPE_NATIVE_FWD_RPATHS_GET_REPLY, size,
554 #define vl_msg_name_crc_list 556 #undef vl_msg_name_crc_list 561 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 562 foreach_vl_msg_name_crc_lisp_gpe;
572 vl_msg_api_set_handlers(VL_API_##N, #n, \ 573 vl_api_##n##_t_handler, \ 575 vl_api_##n##_t_endian, \ 576 vl_api_##n##_t_print, \ 577 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)
ip46_address_t frp_addr
The next-hop address.
Set GPE encapsulation mode.
sll srl srl sll sra u16x4 i
static void vl_api_gpe_add_del_native_fwd_rpath_t_handler(vl_api_gpe_add_del_native_fwd_rpath_t *mp)
#define gid_address_type(_a)
A representation of a path as described by a route producer.
u32 * vnet_lisp_gpe_get_fwd_entry_vnis(void)
#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).
static void vl_api_gpe_add_del_iface_t_handler(vl_api_gpe_add_del_iface_t *mp)
dpo_proto_t frp_proto
The protocol of the address below.
vl_api_gpe_fwd_entry_t entries[count]
static void gpe_native_fwd_rpaths_copy(vl_api_gpe_native_fwd_rpath_t *dst, fib_route_path_t *src, u8 is_ip4)
void ip_address_set(ip_address_t *dst, const void *src, u8 version)
#define ip_prefix_version(_a)
static void gpe_native_fwd_rpaths_get_reply_t_host_to_net(vl_api_gpe_native_fwd_rpaths_get_reply_t *mp)
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
static void setup_message_id_table(api_main_t *am)
u32 frp_sw_if_index
The interface.
vl_api_gpe_native_fwd_rpath_t entries[count]
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.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
void * vl_msg_api_alloc(int nbytes)
#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)
u32 lisp_gpe_tenant_l3_iface_add_or_lock(u32 vni, u32 table_id, u8 with_default_route)
Add/create and lock a new or find and lock the existing L3 interface for the tenant.
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)
Reply for get native fwd rpath.
int vnet_gpe_add_del_native_fwd_rpath(vnet_gpe_native_fwd_rpath_args_t *a)
void ip_prefix_normalize(ip_prefix_t *a)
#define gid_address_ippref(_a)
API main structure, used by both vpp and binary API clients.
u8 is_negative
type of mapping
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.
u32 fwd_entry_index
forwarding entry index of
u32 ft_table_id
Table ID (hash key) for this FIB.
void gid_address_ip_set(gid_address_t *dst, void *src, u8 version)
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_gpe_fwd_entry_vnis_get_t_handler(vl_api_gpe_fwd_entry_vnis_get_t *mp)
#define gid_address_ippref_len(_a)
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
#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
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
static uword hash_elts(void *v)
#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)
static void vl_api_gpe_native_fwd_rpaths_get_t_handler(vl_api_gpe_native_fwd_rpaths_get_t *mp)
static void gpe_native_fwd_rpath_t_host_to_net(vl_api_gpe_native_fwd_rpath_t *e)
#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)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
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
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
lisp_fwd_path_t * paths
When the type is 'normal' The RLOC pair that form the route's paths.
fib_route_path_t * native_fwd_rpath[2]
Native fwd data structures.
#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)
u8 frp_weight
[un]equal cost path weight
gid_address_t lcl_eid
local eid
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
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)
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)
A protocol Independent FIB table.
struct _unix_shared_memory_queue unix_shared_memory_queue_t
index_t lisp_adj
The adjacency constructed for the locator pair.