41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_vpe_api_msg \ 49 _(SW_INTERFACE_SET_VXLAN_GBP_BYPASS, sw_interface_set_vxlan_gbp_bypass) \ 50 _(VXLAN_GBP_TUNNEL_ADD_DEL, vxlan_gbp_tunnel_add_del) \ 51 _(VXLAN_GBP_TUNNEL_DUMP, vxlan_gbp_tunnel_dump) 57 vl_api_sw_interface_set_vxlan_gbp_bypass_reply_t *rmp;
66 REPLY_MACRO (VL_API_SW_INTERFACE_SET_VXLAN_GBP_BYPASS_REPLY);
73 in = clib_net_to_host_u32 (in);
101 ntohl (mp->
tunnel.encap_table_id));
104 rv = VNET_API_ERROR_NO_SUCH_FIB;
116 .instance = ntohl (mp->
tunnel.instance),
117 .mcast_sw_if_index = ntohl (mp->
tunnel.mcast_sw_if_index),
118 .encap_fib_index = fib_index,
119 .vni = ntohl (mp->
tunnel.vni),
128 rv = VNET_API_ERROR_SAME_SRC_DST;
134 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
159 rmp->_vl_msg_id = ntohs (VL_API_VXLAN_GBP_TUNNEL_DETAILS);
163 rmp->
tunnel.encap_table_id =
189 if (~0 == sw_if_index)
194 send_vxlan_gbp_tunnel_details(t, reg, mp->context);
217 #define vl_msg_name_crc_list 219 #undef vl_msg_name_crc_list 224 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 225 foreach_vl_msg_name_crc_vxlan_gbp;
235 vl_msg_api_set_handlers(VL_API_##N, #n, \ 236 vl_api_##n##_t_handler, \ 238 vl_api_##n##_t_endian, \ 239 vl_api_##n##_t_print, \ 240 sizeof(vl_api_##n##_t), 1);
vl_api_vxlan_gbp_tunnel_t tunnel
static void vl_api_sw_interface_set_vxlan_gbp_bypass_t_handler(vl_api_sw_interface_set_vxlan_gbp_bypass_t *mp)
#define foreach_vpe_api_msg
Create or delete a VXLAN-GBP tunnel.
VLIB_API_INIT_FUNCTION(vxlan_gbp_api_hookup)
#define REPLY_MACRO2(t, body)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
int vnet_vxlan_gbp_tunnel_add_del(vnet_vxlan_gbp_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
static void setup_message_id_table(api_main_t *am)
enum vxlan_gbp_tunnel_mode_t_ vxlan_gbp_tunnel_mode_t
vxlan_gbp_main_t vxlan_gbp_main
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
void * vl_msg_api_alloc(int nbytes)
#define ip46_address_cmp(ip46_1, ip46_2)
static uword ip46_address_is_multicast(const ip46_address_t *a)
vl_api_vxlan_gbp_tunnel_t tunnel
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
API main structure, used by both vpp and binary API clients.
#define ip46_address_is_ip4(ip46)
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
static void vl_api_vxlan_gbp_tunnel_add_del_t_handler(vl_api_vxlan_gbp_tunnel_add_del_t *mp)
static void vl_api_vxlan_gbp_tunnel_dump_t_handler(vl_api_vxlan_gbp_tunnel_dump_t *mp)
static void send_vxlan_gbp_tunnel_details(vxlan_gbp_tunnel_t *t, vl_api_registration_t *reg, u32 context)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_vxlan_gbp_api_tunnel_mode_t mode
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
static int vxlan_gbp_tunnel_mode_decode(vl_api_vxlan_gbp_api_tunnel_mode_t in, vxlan_gbp_tunnel_mode_t *out)
Interface set vxlan-bypass request.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vxlan_gbp_tunnel_t * tunnels
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static clib_error_t * vxlan_gbp_api_hookup(vlib_main_t *vm)
void vnet_int_vxlan_gbp_bypass_mode(u32 sw_if_index, u8 is_ip6, u8 is_enable)
u32 * tunnel_index_by_sw_if_index
#define VALIDATE_SW_IF_INDEX(mp)