30 #include <l2tp/l2tp.api_enum.h> 31 #include <l2tp/l2tp.api_types.h> 37 #define REPLY_MSG_ID_BASE l2tp_base_msg_id 53 if_name =
format (if_name,
"%U",
107 ip46_address_t client, our;
111 rv = VNET_API_ERROR_UNIMPLEMENTED;
125 rv = VNET_API_ERROR_NO_SUCH_FIB;
128 encap_fib_index = p[0];
132 encap_fib_index = ~0;
146 encap_fib_index, &sw_if_index);
160 vl_api_l2tpv3_set_tunnel_cookies_reply_t *rmp;
173 REPLY_MACRO (VL_API_L2TPV3_SET_TUNNEL_COOKIES_REPLY);
181 vl_api_l2tpv3_interface_enable_disable_reply_t *rmp;
190 REPLY_MACRO (VL_API_L2TPV3_INTERFACE_ENABLE_DISABLE_REPLY);
198 vl_api_l2tpv3_set_lookup_key_reply_t *rmp;
202 rv = VNET_API_ERROR_INVALID_VALUE;
219 #include <l2tp/l2tp.api.c> 235 #include <vpp/app/version.h> 239 .version = VPP_BUILD_VER,
240 .description =
"Layer 2 Tunneling Protocol v3 (L2TP)",
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)
#define pool_foreach(VAR, POOL)
Iterate through pool.
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
description fragment has unexpected format
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
vl_api_interface_index_t sw_if_index
static u32 l2tp_base_msg_id
Base message ID fot the plugin.
#define REPLY_MSG_ID_BASE
ip6_to_l2_lookup_t lookup_type
uword * fib_index_by_table_id
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
#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)
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 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)