40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_vpe_api_msg \ 48 _(SW_INTERFACE_SET_VXLAN_GPE_BYPASS, sw_interface_set_vxlan_gpe_bypass) \ 49 _(VXLAN_GPE_ADD_DEL_TUNNEL, vxlan_gpe_add_del_tunnel) \ 50 _(VXLAN_GPE_TUNNEL_DUMP, vxlan_gpe_tunnel_dump) 56 vl_api_sw_interface_set_vxlan_gpe_bypass_reply_t *rmp;
65 REPLY_MACRO (VL_API_SW_INTERFACE_SET_VXLAN_GPE_BYPASS_REPLY);
75 u32 encap_fib_index, decap_fib_index;
85 rv = VNET_API_ERROR_NO_SUCH_FIB;
88 encap_fib_index = p[0];
93 if (protocol == VXLAN_GPE_INPUT_NEXT_IP4_INPUT)
98 rv = VNET_API_ERROR_NO_SUCH_INNER_FIB;
101 decap_fib_index = p[0];
112 rv = VNET_API_ERROR_SAME_SRC_DST;
115 memset (a, 0,
sizeof (*a));
155 memset (rmp, 0,
sizeof (*rmp));
156 rmp->_vl_msg_id = ntohs (VL_API_VXLAN_GPE_TUNNEL_DETAILS);
159 memcpy (rmp->
local, &(t->
local.ip6.as_u8), 16);
166 memcpy (rmp->
local, &(t->
local.ip4.as_u8), 4);
172 rmp->
vni = htonl (t->
vni);
197 if (~0 == sw_if_index)
202 send_vxlan_gpe_tunnel_details(t, q, mp->context);
226 #define vl_msg_name_crc_list 228 #undef vl_msg_name_crc_list 233 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 234 foreach_vl_msg_name_crc_vxlan_gpe;
244 vl_msg_api_set_handlers(VL_API_##N, #n, \ 245 vl_api_##n##_t_handler, \ 247 vl_api_##n##_t_endian, \ 248 vl_api_##n##_t_print, \ 249 sizeof(vl_api_##n##_t), 1);
static void vl_api_sw_interface_set_vxlan_gpe_bypass_t_handler(vl_api_sw_interface_set_vxlan_gpe_bypass_t *mp)
int size
for sanity checking
#define REPLY_MACRO2(t, body)
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
int vnet_vxlan_gpe_add_del_tunnel(vnet_vxlan_gpe_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
Add or Del a VXLAN GPE tunnel.
trace_cfg_t * api_trace_cfg
Current trace configuration.
static void vl_api_vxlan_gpe_add_del_tunnel_t_handler(vl_api_vxlan_gpe_add_del_tunnel_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
ip46_address_t local
tunnel local address
void * vl_msg_api_alloc(int nbytes)
void vnet_int_vxlan_gpe_bypass_mode(u32 sw_if_index, u8 is_ip6, u8 is_enable)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
Struct for VXLAN GPE tunnel.
vxlan_gpe_main_t vxlan_gpe_main
u8 protocol
encapsulated protocol
ip46_address_t remote
tunnel remote address
u32 vni
VXLAN GPE VNI in HOST byte order, shifted left 8 bits.
API main structure, used by both vpp and binary API clients.
#define BAD_SW_IF_INDEX_LABEL
Struct for VXLAN GPE add/del args.
u32 ft_table_id
Table ID (hash key) for this FIB.
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static clib_error_t * vxlan_gpe_api_hookup(vlib_main_t *vm)
static void setup_message_id_table(api_main_t *am)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
Interface set vxlan-gpe-bypass request.
Struct for VXLAN GPE node state.
vxlan_gpe_tunnel_t * tunnels
vector of encap tunnel instances
u32 decap_fib_index
FIB indices - inner IP packet lookup here.
VLIB_API_INIT_FUNCTION(vxlan_gpe_api_hookup)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void vl_api_vxlan_gpe_tunnel_dump_t_handler(vl_api_vxlan_gpe_tunnel_dump_t *mp)
static void send_vxlan_gpe_tunnel_details(vxlan_gpe_tunnel_t *t, unix_shared_memory_queue_t *q, u32 context)
u32 encap_fib_index
FIB indices - tunnel partner lookup here.
ip4_main_t ip4_main
Global ip4 main structure.
u32 sw_if_index
vnet intfc sw_if_index
struct fib_table_t_ * fibs
Vector of FIBs.
#define VXLAN_GPE_TUNNEL_IS_IPV4
Flags for vxlan_gpe_tunnel_t.
struct fib_table_t_ * fibs
#define foreach_vpe_api_msg
#define VALIDATE_SW_IF_INDEX(mp)
struct _unix_shared_memory_queue unix_shared_memory_queue_t