40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_vpe_api_msg \ 48 _(SW_INTERFACE_SET_VXLAN_BYPASS, sw_interface_set_vxlan_bypass) \ 49 _(VXLAN_ADD_DEL_TUNNEL, vxlan_add_del_tunnel) \ 50 _(VXLAN_TUNNEL_DUMP, vxlan_tunnel_dump) 56 vl_api_sw_interface_set_vxlan_bypass_reply_t *rmp;
65 REPLY_MACRO (VL_API_SW_INTERFACE_SET_VXLAN_BYPASS_REPLY);
79 rv = VNET_API_ERROR_NO_SUCH_FIB;
88 .encap_fib_index = fib_index,
90 .vni = ntohl (mp->
vni),
98 rv = VNET_API_ERROR_SAME_SRC_DST;
104 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
108 u32 sw_if_index = ~0;
129 memset (rmp, 0,
sizeof (*rmp));
130 rmp->_vl_msg_id = ntohs (VL_API_VXLAN_TUNNEL_DETAILS);
146 rmp->
vni = htonl (t->
vni);
169 if (~0 == sw_if_index)
174 send_vxlan_tunnel_details(t, reg, mp->context);
197 #define vl_msg_name_crc_list 199 #undef vl_msg_name_crc_list 204 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 205 foreach_vl_msg_name_crc_vxlan;
215 vl_msg_api_set_handlers(VL_API_##N, #n, \ 216 vl_api_##n##_t_handler, \ 218 vl_api_##n##_t_endian, \ 219 vl_api_##n##_t_print, \ 220 sizeof(vl_api_##n##_t), 1);
static void vl_api_sw_interface_set_vxlan_bypass_t_handler(vl_api_sw_interface_set_vxlan_bypass_t *mp)
static uword ip46_address_is_multicast(ip46_address_t *a)
int size
for sanity checking
#define REPLY_MACRO2(t, body)
Interface set vxlan-bypass request.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define foreach_vpe_api_msg
static void setup_message_id_table(api_main_t *am)
void * vl_msg_api_alloc(int nbytes)
#define ip46_address_cmp(ip46_1, ip46_2)
trace_cfg_t * api_trace_cfg
Current trace configuration.
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
VLIB_API_INIT_FUNCTION(vxlan_api_hookup)
static void vl_api_vxlan_add_del_tunnel_t_handler(vl_api_vxlan_add_del_tunnel_t *mp)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static clib_error_t * vxlan_api_hookup(vlib_main_t *vm)
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
int vnet_vxlan_add_del_tunnel(vnet_vxlan_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
u32 ft_table_id
Table ID (hash key) for this FIB.
Create or delete a VXLAN tunnel.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static ip46_address_t to_ip46(u32 is_ipv6, u8 *buf)
void vnet_int_vxlan_bypass_mode(u32 sw_if_index, u8 is_ip6, u8 is_enable)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
u32 * tunnel_index_by_sw_if_index
static void vl_api_vxlan_tunnel_dump_t_handler(vl_api_vxlan_tunnel_dump_t *mp)
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
static void send_vxlan_tunnel_details(vxlan_tunnel_t *t, vl_api_registration_t *reg, u32 context)
struct fib_table_t_ * fibs
#define VALIDATE_SW_IF_INDEX(mp)