33 #include <lisp/lisp-gpe/lisp_types_api.h> 37 #include <lisp/lisp-gpe/lisp_gpe.api_enum.h> 38 #include <lisp/lisp-gpe/lisp_gpe.api_types.h> 44 #define REPLY_MSG_ID_BASE gpe_base_msg_id 53 vl_api_gpe_locator_t *r;
55 for (i = 0; i < rloc_num; i++)
58 r = &((vl_api_gpe_locator_t *) locs)[
i];
62 pair.weight = r->weight;
66 for (i = rloc_num; i < rloc_num * 2; i++)
69 r = &((vl_api_gpe_locator_t *) locs)[
i];
70 p = &pairs[i - rloc_num];
122 clib_host_to_net_u16 (VL_API_GPE_FWD_ENTRY_PATH_DETAILS);
155 &dst[i].leid.address.prefix);
157 &dst[i].reid.address.prefix);
161 dst[i].leid.address.mac);
163 dst[i].reid.address.mac);
178 mp->
vni = clib_net_to_host_u32 (mp->
vni);
184 e->fwd_entry_index = clib_host_to_net_u32 (e->fwd_entry_index);
185 e->dp_table = clib_host_to_net_u32 (e->dp_table);
186 e->vni = clib_host_to_net_u32 (e->vni);
194 vl_api_gpe_fwd_entry_t *e;
196 for (i = 0; i < mp->
count; i++)
216 REPLY_MACRO4 (VL_API_GPE_FWD_ENTRY_VNIS_GET_REPLY, size,
221 rmp->
vnis[i++] = clib_host_to_net_u32 (p->
key);
240 size =
vec_len (e) *
sizeof (vl_api_gpe_fwd_entry_t);
257 mp->
vni = clib_net_to_host_u32 (mp->
vni);
308 vl_api_gpe_enable_disable_reply_t *rmp;
321 vl_api_gpe_add_del_iface_reply_t *rmp;
325 vni = clib_net_to_host_u32 (mp->
vni);
326 dp_table = clib_net_to_host_u32 (mp->
dp_table);
355 vl_api_gpe_set_encap_mode_reply_t *rmp;
380 vl_api_gpe_add_del_native_fwd_rpath_reply_t *rmp;
388 sizeof (ip6_address_t));
397 clib_net_to_host_u32 (mp->
table_id));
400 rv = VNET_API_ERROR_INVALID_VALUE;
409 REPLY_MACRO (VL_API_GPE_ADD_DEL_NATIVE_FWD_RPATH_REPLY);
434 e->fib_index = clib_host_to_net_u32 (e->fib_index);
435 e->nh_sw_if_index = clib_host_to_net_u32 (e->nh_sw_if_index);
443 vl_api_gpe_native_fwd_rpath_t *e;
445 for (i = 0; i < mp->
count; i++)
462 u8 rpath_index = mp->
is_ip4 ? 1 : 0;
465 *
sizeof (vl_api_gpe_native_fwd_rpath_t);
468 REPLY_MACRO4 (VL_API_GPE_NATIVE_FWD_RPATHS_GET_REPLY, size,
485 #include <lisp/lisp-gpe/lisp_gpe.api.c>
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.
static void vl_api_gpe_add_del_native_fwd_rpath_t_handler(vl_api_gpe_add_del_native_fwd_rpath_t *mp)
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
A representation of a path as described by a route producer.
u32 * vnet_lisp_gpe_get_fwd_entry_vnis(void)
void mac_address_encode(const mac_address_t *in, u8 *out)
#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.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#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)
void ip_prefix_encode2(const ip_prefix_t *in, vl_api_prefix_t *out)
dpo_proto_t frp_proto
The protocol of the address below.
vl_api_gpe_fwd_entry_t entries[count]
void * vl_msg_api_alloc(int nbytes)
static void gpe_native_fwd_rpaths_get_reply_t_host_to_net(vl_api_gpe_native_fwd_rpaths_get_reply_t *mp)
#define clib_memcpy(d, s, n)
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
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)
bool is_enable[default=true]
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)
bool is_add[default=true]
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)
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)
int vnet_gpe_add_del_native_fwd_rpath(vnet_gpe_native_fwd_rpath_args_t *a)
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)
vl_api_interface_index_t nh_sw_if_index
static void gpe_fwd_entries_copy(vl_api_gpe_fwd_entry_t *dst, lisp_api_gpe_fwd_entry_t *src)
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)
u32 vni
VNI/tenant id in HOST byte order.
bool is_add[default=true]
u32 fwd_entry_index
forwarding entry index of
u32 ft_table_id
Table ID (hash key) for this FIB.
sll srl srl sll sra u16x4 i
#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 clib_warning(format, args...)
#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)
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.
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)
negative_fwd_actions_e action
action for negative mappings
bool is_add[default=true]
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.
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
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 gpe_native_fwd_rpaths_copy(vl_api_gpe_native_fwd_rpath_t *dst, fib_route_path_t *src)
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 locator_pair_t * unformat_gpe_loc_pairs(void *locs, u32 rloc_num)
int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, const vl_api_eid_t *eid)
ip_address_t remote_rloc
remote RLOC.
static u32 gpe_base_msg_id
Base message ID fot the plugin.
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.
index_t lisp_adj
The adjacency constructed for the locator pair.