|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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;
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);
287 a->locator_pairs = pairs;
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);
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));
395 a->rpath.frp_fib_index =
397 clib_net_to_host_u32 (mp->
table_id));
398 if (~0 ==
a->rpath.frp_fib_index)
400 rv = VNET_API_ERROR_INVALID_VALUE;
405 a->rpath.frp_weight = 1;
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;
462 u8 rpath_index = mp->
is_ip4 ? 1 : 0;
465 *
sizeof (vl_api_gpe_native_fwd_rpath_t);
485 #include <lisp/lisp-gpe/lisp_gpe.api.c>
u32 frp_fib_index
The FIB index to lookup the nexthop Only valid for recursive paths.
static void gpe_native_fwd_rpaths_copy(vl_api_gpe_native_fwd_rpath_t *dst, fib_route_path_t *src)
ip_address_t remote_rloc
remote RLOC.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void gpe_fwd_entry_path_dump_t_net_to_host(vl_api_gpe_fwd_entry_path_dump_t *mp)
clib_error_t * vnet_lisp_gpe_enable_disable(vnet_lisp_gpe_enable_disable_args_t *a)
Enable/disable LISP-GPE.
#define REPLY_MACRO2(t, body)
void ip_prefix_encode2(const ip_prefix_t *in, vl_api_prefix_t *out)
#define clib_memcpy(d, s, n)
enable or disable gpe protocol
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_gpe_fwd_entries_get_t_handler(vl_api_gpe_fwd_entries_get_t *mp)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
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)
static void gpe_native_fwd_rpath_t_host_to_net(vl_api_gpe_native_fwd_rpath_t *e)
#define REPLY_MACRO4(t, n, body)
ip46_address_t frp_addr
The next-hop address.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 frp_sw_if_index
The interface.
struct lisp_gpe_fwd_entry_t_ * lisp_fwd_entry_pool
A Pool of all LISP forwarding entries.
dpo_proto_t frp_proto
The protocol of the address below.
vnet_hw_if_output_node_runtime_t * r
static void vl_api_gpe_set_encap_mode_t_handler(vl_api_gpe_set_encap_mode_t *mp)
static void lisp_api_set_locator(vl_api_gpe_locator_t *loc, const ip_address_t *addr, u8 weight)
int unformat_lisp_eid_api(gid_address_t *dst, u32 vni, const vl_api_eid_t *eid)
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
static void vl_api_gpe_native_fwd_rpaths_get_t_handler(vl_api_gpe_native_fwd_rpaths_get_t *mp)
vl_api_gpe_locator_t rmt_loc
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
static void setup_message_id_table(api_main_t *am)
A protocol Independent FIB table.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Set GPE encapsulation mode.
static void gpe_add_del_fwd_entry_t_net_to_host(vl_api_gpe_add_del_fwd_entry_t *mp)
u32 ft_table_id
Table ID (hash key) for this FIB.
vl_api_gpe_locator_t lcl_loc
An API client registration, only in vpp/vlib.
#define fid_addr_type(_a)
static void vl_api_gpe_enable_disable_t_handler(vl_api_gpe_enable_disable_t *mp)
void lisp_gpe_tenant_l2_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
void lisp_gpe_tenant_l3_iface_unlock(u32 vni)
Release the lock held on the tenant's L3 interface.
u32 * vnet_lisp_gpe_get_fwd_entry_vnis(void)
lisp_gpe_main_t lisp_gpe_main
LISP-GPE global state.
sll srl srl sll sra u16x4 i
const lisp_gpe_tunnel_t * lisp_gpe_tunnel_get(index_t lgti)
Reply for set_encap_mode.
fib_route_path_t * native_fwd_rpath[2]
Native fwd data structures.
int vnet_gpe_set_encap_mode(gpe_encap_mode_t mode)
Set GPE encapsulation mode.
bool is_enable[default=true]
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)
bool is_add[default=true]
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
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.
static uword hash_elts(void *v)
static void gpe_fwd_entries_get_t_net_to_host(vl_api_gpe_fwd_entries_get_t *mp)
#define vec_free(V)
Free vector's memory (no header).
static void vl_api_gpe_fwd_entry_path_dump_t_handler(vl_api_gpe_fwd_entry_path_dump_t *mp)
static void gpe_native_fwd_rpaths_get_reply_t_host_to_net(vl_api_gpe_native_fwd_rpaths_get_reply_t *mp)
const lisp_gpe_adjacency_t * lisp_gpe_adjacency_get(index_t lai)
lisp_fwd_path_t * paths
When the type is 'normal' The RLOC pair that form the route's paths.
static void vl_api_gpe_get_encap_mode_t_handler(vl_api_gpe_get_encap_mode_t *mp)
A path on which to forward lisp traffic.
fib_protocol_t dpo_proto_to_fib(dpo_proto_t dpo_proto)
void mac_address_encode(const mac_address_t *in, u8 *out)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
lisp_gpe_tunnel_key_t * key
RLOC pair and rloc fib_index.
static void vl_api_gpe_fwd_entry_vnis_get_t_handler(vl_api_gpe_fwd_entry_vnis_get_t *mp)
bool is_add[default=true]
A representation of a path as described by a route producer.
#define vec_foreach(var, vec)
Vector iterator.
#define fid_addr_ippref(_a)
vl_api_gpe_locator_t locs[loc_num]
static void vl_api_gpe_add_del_fwd_entry_t_handler(vl_api_gpe_add_del_fwd_entry_t *mp)
VLIB_API_INIT_FUNCTION(gpe_api_hookup)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static locator_pair_t * unformat_gpe_loc_pairs(void *locs, u32 rloc_num)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
Common utility functions for IPv4, IPv6 and L2 LISP-GPE adjacencys.
gpe_encap_mode_t vnet_gpe_get_encap_mode(void)
@ LISP_GPE_FWD_ENTRY_TYPE_NEGATIVE
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.
vl_api_gpe_fwd_entry_t entries[count]
int vnet_gpe_add_del_native_fwd_rpath(vnet_gpe_native_fwd_rpath_args_t *a)
static clib_error_t * gpe_api_hookup(vlib_main_t *vm)
#define clib_warning(format, args...)
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 tunnel_index
The index of the LISP GPE tunnel that provides the transport in the underlay.
bool is_add[default=true]
get GPE encapsulation mode
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static void vl_api_gpe_add_del_native_fwd_rpath_t_handler(vl_api_gpe_add_del_native_fwd_rpath_t *mp)
static void gpe_fwd_entries_get_reply_t_host_to_net(vl_api_gpe_fwd_entries_get_reply_t *mp)
static void gpe_entry_t_host_to_net(vl_api_gpe_fwd_entry_t *e)
lisp_gpe_fwd_entry_type_t type
The forwarding entry type.
vl_api_gpe_native_fwd_rpath_t entries[count]
static void vl_api_gpe_add_del_iface_t_handler(vl_api_gpe_add_del_iface_t *mp)
static u32 gpe_base_msg_id
Base message ID fot the plugin.
void * vl_msg_api_alloc(int nbytes)