39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define foreach_vpe_api_msg \ 47 _(L2TPV3_CREATE_TUNNEL, l2tpv3_create_tunnel) \ 48 _(L2TPV3_SET_TUNNEL_COOKIES, l2tpv3_set_tunnel_cookies) \ 49 _(L2TPV3_INTERFACE_ENABLE_DISABLE, l2tpv3_interface_enable_disable) \ 50 _(L2TPV3_SET_LOOKUP_KEY, l2tpv3_set_lookup_key) \ 51 _(SW_IF_L2TPV3_TUNNEL_DUMP, sw_if_l2tpv3_tunnel_dump) 65 if_name =
format (if_name,
"%U",
70 mp->_vl_msg_id =
ntohs (VL_API_SW_IF_L2TPV3_TUNNEL_DETAILS);
106 send_sw_if_l2tpv3_tunnel_details (am, reg, session, lm, mp->context);
118 ip46_address_t client, our;
122 rv = VNET_API_ERROR_UNIMPLEMENTED;
136 rv = VNET_API_ERROR_NO_SUCH_FIB;
139 encap_fib_index = p[0];
143 encap_fib_index = ~0;
157 encap_fib_index, &sw_if_index);
171 vl_api_l2tpv3_set_tunnel_cookies_reply_t *rmp;
184 REPLY_MACRO (VL_API_L2TPV3_SET_TUNNEL_COOKIES_REPLY);
192 vl_api_l2tpv3_interface_enable_disable_reply_t *rmp;
201 REPLY_MACRO (VL_API_L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY);
209 vl_api_l2tpv3_set_lookup_key_reply_t *rmp;
213 rv = VNET_API_ERROR_INVALID_VALUE;
230 #define vl_msg_name_crc_list 232 #undef vl_msg_name_crc_list 237 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 238 foreach_vl_msg_name_crc_l2tp;
248 vl_msg_api_set_handlers(VL_API_##N, #n, \ 249 vl_api_##n##_t_handler, \ 251 vl_api_##n##_t_endian, \ 252 vl_api_##n##_t_print, \ 253 sizeof(vl_api_##n##_t), 1);
vl_api_address_t client_address
vl_api_l2t_lookup_key_t key
vl_api_address_t client_address
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)
vl_api_address_t our_address
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
int l2tpv3_interface_enable_disable(vnet_main_t *vnm, u32 sw_if_index, int enable_disable)
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
l2tpv3 tunnel interface create response
format_function_t format_vnet_sw_interface_name
vl_api_address_t our_address
vl_api_interface_index_t sw_if_index
#define foreach_vpe_api_msg
vl_api_interface_index_t sw_if_index
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)
vl_api_interface_index_t 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)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static api_main_t * vlibapi_get_main(void)
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
string interface_name[64]
vl_api_interface_index_t sw_if_index
#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)