35 #define vl_print(handle, ...) vlib_cli_output(handle, __VA_ARGS__) 42 #define foreach_vpe_api_msg \ 43 _(IPIP_ADD_TUNNEL, ipip_add_tunnel) \ 44 _(IPIP_DEL_TUNNEL, ipip_del_tunnel) \ 45 _(IPIP_6RD_ADD_TUNNEL, ipip_6rd_add_tunnel) \ 46 _(IPIP_6RD_DEL_TUNNEL, ipip_6rd_del_tunnel) \ 47 _(IPIP_TUNNEL_DUMP, ipip_tunnel_dump) 54 u32 fib_index, sw_if_index = ~0;
75 rv = VNET_API_ERROR_NO_SUCH_FIB;
83 fib_index, mp->
tc_tos, &sw_if_index);
97 vl_api_ipip_del_tunnel_reply_t *rmp;
113 memset (rmp, 0,
sizeof (*rmp));
114 rmp->_vl_msg_id = htons (VL_API_IPIP_TUNNEL_DETAILS);
151 if (sw_if_index == ~0)
155 ({ send_ipip_tunnel_details(t, reg, mp->context); }));
170 u32 sixrd_tunnel_index, ip4_fib_index, ip6_fib_index;
176 if (~0 == ip4_fib_index || ~0 == ip6_fib_index)
179 rv = VNET_API_ERROR_NO_SUCH_FIB;
189 ip4_fib_index, ip6_fib_index,
190 &sixrd_tunnel_index);
204 vl_api_ipip_6rd_del_tunnel_reply_t *rmp;
218 #define vl_msg_name_crc_list 220 #undef vl_msg_name_crc_list 225 #define _(id, n, crc) vl_msg_api_add_msg_name_crc(am, #n "_" #crc, id); 226 foreach_vl_msg_name_crc_ipip;
236 vl_msg_api_set_handlers(VL_API_##N, #n, vl_api_##n##_t_handler, \ 237 vl_noop_handler, vl_api_##n##_t_endian, \ 238 vl_api_##n##_t_print, sizeof(vl_api_##n##_t), 1); int sixrd_add_tunnel(ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip4_address_t *ip4_src, bool security_check, u32 ip4_fib_index, u32 ip6_fib_index, u32 *sw_if_index)
Create an IPv4 over IPv6 automatic tunnel (6RD)
A representation of a IPIP tunnel.
int ipip_add_tunnel(ipip_transport_t transport, u32 instance, ip46_address_t *src, ip46_address_t *dst, u32 fib_index, u8 tc_tos, u32 *sw_if_indexp)
ip46_address_t tunnel_src
#define REPLY_MACRO2(t, body)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_ipip_6rd_add_tunnel_t_handler(vl_api_ipip_6rd_add_tunnel_t *mp)
static void vl_api_ipip_6rd_del_tunnel_t_handler(vl_api_ipip_6rd_del_tunnel_t *mp)
void * vl_msg_api_alloc(int nbytes)
Delete an IP{v4,v6} over IP{v4,v6} tunnel.
static clib_error_t * ipip_api_hookup(vlib_main_t *vm)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Create an IP{v4,v6} over IP{v4,v6} tunnel.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static void send_ipip_tunnel_details(ipip_tunnel_t *t, vl_api_registration_t *reg, u32 context)
static void vl_api_ipip_tunnel_dump_t_handler(vl_api_ipip_tunnel_dump_t *mp)
ipip_tunnel_t * ipip_tunnel_db_find_by_sw_if_index(u32 sw_if_index)
int sixrd_del_tunnel(u32 sw_if_index)
#define ip46_address_initializer
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
#define foreach_vpe_api_msg
u32 ft_table_id
Table ID (hash key) for this FIB.
#define clib_memcpy(a, b, c)
static void vl_api_ipip_del_tunnel_t_handler(vl_api_ipip_del_tunnel_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
ipip_transport_t transport
static void vl_api_ipip_add_tunnel_t_handler(vl_api_ipip_add_tunnel_t *mp)
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
static void setup_message_id_table(api_main_t *am)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
int ipip_del_tunnel(u32 sw_if_index)
VLIB_API_INIT_FUNCTION(ipip_api_hookup)
ip46_address_t tunnel_dst
Delete an IPv4 over IPv6 automatic tunnel (6RD)
A protocol Independent FIB table.