|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
50 #define foreach_vpe_api_msg \
51 _ (SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \
52 _ (VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \
53 _ (VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) \
54 _ (VXLAN_ADD_DEL_TUNNEL_V2, vxlan_add_del_tunnel_v2) \
55 _ (VXLAN_ADD_DEL_TUNNEL_V3, vxlan_add_del_tunnel_v3) \
56 _ (VXLAN_TUNNEL_V2_DUMP, vxlan_tunnel_v2_dump) \
57 _ (VXLAN_OFFLOAD_RX, vxlan_offload_rx)
62 vl_api_vxlan_offload_rx_reply_t *rmp;
69 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
77 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX_2;
85 rv = VNET_API_ERROR_INVALID_ADDRESS_FAMILY;
97 rv = VNET_API_ERROR_NO_SUCH_FIB;
103 rv = VNET_API_ERROR_UNSPECIFIED;
116 vl_api_sw_interface_set_vxlan_bypass_reply_t *rmp;
125 REPLY_MACRO (VL_API_SW_INTERFACE_SET_VXLAN_BYPASS_REPLY);
135 if (
a->encap_fib_index == ~0)
137 return VNET_API_ERROR_NO_SUCH_FIB;
142 return VNET_API_ERROR_INVALID_VALUE;
148 return VNET_API_ERROR_SAME_SRC_DST;
153 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
170 .vni = ntohl (mp->
vni),
178 a.dst_port =
a.is_ip6 ? UDP_DST_PORT_vxlan6 : UDP_DST_PORT_vxlan,
179 a.src_port =
a.is_ip6 ? UDP_DST_PORT_vxlan6 : UDP_DST_PORT_vxlan,
201 .vni = ntohl (mp->
vni),
230 .vni = ntohl (mp->
vni),
257 rmp->_vl_msg_id =
ntohs (VL_API_VXLAN_TUNNEL_DETAILS);
269 rmp->
vni = htonl (t->
vni);
318 rmp->_vl_msg_id =
ntohs (VL_API_VXLAN_TUNNEL_V2_DETAILS);
332 rmp->
vni = htonl (t->
vni);
378 #define vl_msg_name_crc_list
380 #undef vl_msg_name_crc_list
385 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
386 foreach_vl_msg_name_crc_vxlan;
396 vl_msg_api_set_handlers(VL_API_##N, #n, \
397 vl_api_##n##_t_handler, \
399 vl_api_##n##_t_endian, \
400 vl_api_##n##_t_print, \
401 sizeof(vl_api_##n##_t), 1);
405 am->api_trace_cfg[VL_API_VXLAN_ADD_DEL_TUNNEL].size += 16 *
sizeof (
u32);
Interface set vxlan-bypass request.
vnet_interface_main_t * im
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
bool is_add[default=true]
vl_api_interface_index_t sw_if_index
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
vl_api_interface_index_t sw_if_index
#define REPLY_MACRO2(t, body)
void vnet_int_vxlan_bypass_mode(u32 sw_if_index, u8 is_ip6, u8 is_enable)
vl_api_address_t src_address
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static uword ip46_address_is_multicast(const ip46_address_t *a)
vl_api_address_t dst_address
vl_api_interface_index_t sw_if_index
static void vl_api_sw_interface_set_vxlan_bypass_t_handler(vl_api_sw_interface_set_vxlan_bypass_t *mp)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vl_api_interface_index_t sw_if_index
static clib_error_t * vxlan_api_hookup(vlib_main_t *vm)
u32 * tunnel_index_by_sw_if_index
static int ip46_address_cmp(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
vl_api_interface_index_t mcast_sw_if_index
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_address_t src_address
vl_api_interface_index_t mcast_sw_if_index
VLIB_API_INIT_FUNCTION(vxlan_api_hookup)
vl_api_interface_index_t mcast_sw_if_index
static void vl_api_vxlan_add_del_tunnel_v2_t_handler(vl_api_vxlan_add_del_tunnel_v2_t *mp)
int vnet_vxlan_add_del_tunnel(vnet_vxlan_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
vl_api_address_t dst_address
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
#define vec_elt(v, i)
Get vector value at index i.
u32 instance[default=0xffffffff]
vl_api_interface_index_t mcast_sw_if_index
#define pool_foreach(VAR, POOL)
Iterate through pool.
bool is_add[default=true]
bool is_l3[default=false]
Offload vxlan rx request.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vl_api_address_t src_address
static void setup_message_id_table(api_main_t *am)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
u32 ft_table_id
Table ID (hash key) for this FIB.
An API client registration, only in vpp/vlib.
static uword vnet_hw_interface_is_valid(vnet_main_t *vnm, u32 hw_if_index)
vl_api_interface_index_t sw_if_index
u32 vnet_vxlan_get_tunnel_index(u32 sw_if_index)
static api_main_t * vlibapi_get_main(void)
vl_api_address_t dst_address
struct fib_table_t_ * fibs
vl_api_interface_index_t hw_if_index
vl_api_interface_index_t mcast_sw_if_index
#define BAD_SW_IF_INDEX_LABEL
bool enable[default=true]
Create or delete a VXLAN tunnel.
API main structure, used by both vpp and binary API clients.
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
static void send_vxlan_tunnel_details(vxlan_tunnel_t *t, vl_api_registration_t *reg, u32 context)
vl_api_interface_index_t sw_if_index
static void vl_api_vxlan_offload_rx_t_handler(vl_api_vxlan_offload_rx_t *mp)
static void vl_api_vxlan_add_del_tunnel_t_handler(vl_api_vxlan_add_del_tunnel_t *mp)
struct fib_table_t_ * fibs
Vector of FIBs.
vl_api_address_t dst_address
vl_api_interface_index_t sw_if_index
int vnet_vxlan_add_del_rx_flow(u32 hw_if_index, u32 t_index, int is_add)
bool enable[default=true]
vl_api_address_t src_address
u32 instance[default=0xffffffff]
static void send_vxlan_tunnel_v2_details(vxlan_tunnel_t *t, vl_api_registration_t *reg, u32 context)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vl_api_address_t src_address
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
vl_api_interface_index_t sw_if_index
Create or delete a VXLAN tunnel.
static void vl_api_vxlan_tunnel_dump_t_handler(vl_api_vxlan_tunnel_dump_t *mp)
bool is_add[default=true]
static void vl_api_vxlan_add_del_tunnel_v3_t_handler(vl_api_vxlan_add_del_tunnel_v3_t *mp)
static void vl_api_vxlan_tunnel_v2_dump_t_handler(vl_api_vxlan_tunnel_v2_dump_t *mp)
static int vxlan_add_del_tunnel_clean_input(vnet_vxlan_add_del_tunnel_args_t *a, u32 encap_vrf_id)
Create or delete a VXLAN tunnel.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index
#define foreach_vpe_api_msg
vl_api_interface_index_t sw_if_index
vl_api_address_t dst_address
void * vl_msg_api_alloc(int nbytes)