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",
69 mp->_vl_msg_id = ntohs (VL_API_SW_IF_L2TPV3_TUNNEL_DETAILS);
104 send_sw_if_l2tpv3_tunnel_details (am, reg, session, lm, mp->context);
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);
165 vl_api_l2tpv3_set_tunnel_cookies_reply_t *rmp;
178 REPLY_MACRO (VL_API_L2TPV3_SET_TUNNEL_COOKIES_REPLY);
186 vl_api_l2tpv3_interface_enable_disable_reply_t *rmp;
195 REPLY_MACRO (VL_API_L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY);
203 vl_api_l2tpv3_set_lookup_key_reply_t *rmp;
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);
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)
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
ip6_address_t our_address
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
VLIB_API_INIT_FUNCTION(l2tp_api_hookup)
void * vl_msg_api_alloc(int nbytes)
ip6_address_t client_address
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define clib_memcpy(d, s, n)
#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
API main structure, used by both vpp and binary API clients.
uword * fib_index_by_table_id
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static void vl_api_l2tpv3_set_lookup_key_t_handler(vl_api_l2tpv3_set_lookup_key_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
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)
static void send_sw_if_l2tpv3_tunnel_details(vpe_api_main_t *am, vl_api_registration_t *reg, l2t_session_t *s, l2t_main_t *lm, u32 context)
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)
static clib_error_t * l2tp_api_hookup(vlib_main_t *vm)