38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define foreach_vpe_api_msg \ 46 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \ 47 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \ 48 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \ 49 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \ 50 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) 64 if_name =
format (if_name,
"%U",
68 memset (mp, 0,
sizeof (*mp));
69 mp->_vl_msg_id = ntohs (VL_API_SW_IF_L2TPV3_TUNNEL_DETAILS);
104 send_sw_if_l2tpv3_tunnel_details (am, q, session, lm, mp->context);
114 u32 sw_if_index = (
u32) ~ 0;
119 rv = VNET_API_ERROR_UNIMPLEMENTED;
133 rv = VNET_API_ERROR_NO_SUCH_FIB;
136 encap_fib_index = p[0];
140 encap_fib_index = ~0;
151 encap_fib_index, &sw_if_index);
178 REPLY_MACRO (VL_API_L2TPV3_SET_TUNNEL_COOKIES_REPLY);
195 REPLY_MACRO (VL_API_L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY);
207 rv = VNET_API_ERROR_INVALID_VALUE;
224 #define vl_msg_name_crc_list 226 #undef vl_msg_name_crc_list 231 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 232 foreach_vl_msg_name_crc_l2tp;
242 vl_msg_api_set_handlers(VL_API_##N, #n, \ 243 vl_api_##n##_t_handler, \ 245 vl_api_##n##_t_endian, \ 246 vl_api_##n##_t_print, \ 247 sizeof(vl_api_##n##_t), 1);
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
vnet_main_t * vnet_get_main(void)
static void vl_api_l2tpv3_interface_enable_disable_t_handler(vl_api_l2tpv3_interface_enable_disable_t *mp)
L2TP tunnel set cookies response.
#define REPLY_MACRO2(t, body)
ip6_address_t our_address
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
VLIB_API_INIT_FUNCTION(l2tp_api_hookup)
ip6_address_t client_address
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
int l2tpv3_interface_enable_disable(vnet_main_t *vnm, u32 sw_if_index, int enable_disable)
l2tpv3 tunnel interface create response
format_function_t format_vnet_sw_interface_name
#define foreach_vpe_api_msg
ip6_to_l2_lookup_t lookup_type
uword * fib_index_by_table_id
#define BAD_SW_IF_INDEX_LABEL
void * vl_msg_api_alloc(int nbytes)
static void send_sw_if_l2tpv3_tunnel_details(vpe_api_main_t *am, unix_shared_memory_queue_t *q, l2t_session_t *s, l2t_main_t *lm, u32 context)
#define clib_memcpy(a, b, c)
static void vl_api_l2tpv3_set_lookup_key_t_handler(vl_api_l2tpv3_set_lookup_key_t *mp)
static void setup_message_id_table(api_main_t *am)
int create_l2tpv3_ipv6_tunnel(l2t_main_t *lm, ip6_address_t *client_address, ip6_address_t *our_address, u32 local_session_id, u32 remote_session_id, u64 local_cookie, u64 remote_cookie, int l2_sublayer_present, u32 encap_fib_index, u32 *sw_if_index)
static void vl_api_l2tpv3_create_tunnel_t_handler(vl_api_l2tpv3_create_tunnel_t *mp)
static void vl_api_sw_if_l2tpv3_tunnel_dump_t_handler(vl_api_sw_if_l2tpv3_tunnel_dump_t *mp)
static void vl_api_l2tpv3_set_tunnel_cookies_t_handler(vl_api_l2tpv3_set_tunnel_cookies_t *mp)
l2tpv3 tunnel interface create request
vpe_api_main_t vpe_api_main
#define VALIDATE_SW_IF_INDEX(mp)
int l2tpv3_set_tunnel_cookies(l2t_main_t *lm, u32 sw_if_index, u64 new_local_cookie, u64 new_remote_cookie)
struct _unix_shared_memory_queue unix_shared_memory_queue_t
static clib_error_t * l2tp_api_hookup(vlib_main_t *vm)