40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_vpe_api_msg \ 48 _(GRE_ADD_DEL_TUNNEL, gre_add_del_tunnel) \ 49 _(GRE_TUNNEL_DUMP, gre_tunnel_dump) 63 rv = VNET_API_ERROR_SAME_SRC_DST;
66 memset (a, 0,
sizeof (*a));
104 memset (rmp, 0,
sizeof (*rmp));
105 rmp->_vl_msg_id = ntohs (VL_API_GRE_TUNNEL_DETAILS);
144 if (~0 == sw_if_index)
149 send_gre_tunnel_details(t, q, mp->context);
172 #define vl_msg_name_crc_list 174 #undef vl_msg_name_crc_list 179 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 180 foreach_vl_msg_name_crc_gre;
190 vl_msg_api_set_handlers(VL_API_##N, #n, \ 191 vl_api_##n##_t_handler, \ 193 vl_api_##n##_t_endian, \ 194 vl_api_##n##_t_print, \ 195 sizeof(vl_api_##n##_t), 1); fib_protocol_t fp_proto
protocol type
static clib_error_t * gre_api_hookup(vlib_main_t *vm)
#define REPLY_MACRO2(t, body)
VLIB_API_INIT_FUNCTION(gre_api_hookup)
u32 outer_fib_index
The FIB in which the src.dst address are present.
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
static void vl_api_gre_tunnel_dump_t_handler(vl_api_gre_tunnel_dump_t *mp)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static void vl_api_gre_add_del_tunnel_t_handler(vl_api_gre_add_del_tunnel_t *mp)
ip46_address_t tunnel_src
The tunnel's source/local address.
void * vl_msg_api_alloc(int nbytes)
A representation of a GRE tunnel.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
API main structure, used by both vpp and binary API clients.
u32 ft_table_id
Table ID (hash key) for this FIB.
static void setup_message_id_table(api_main_t *am)
#define clib_memcpy(a, b, c)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
static void send_gre_tunnel_details(gre_tunnel_t *t, unix_shared_memory_queue_t *q, u32 context)
gre_tunnel_t * tunnels
pool of tunnel instances
int vnet_gre_add_del_tunnel(vnet_gre_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define foreach_vpe_api_msg
Transparent Ethernet Bridging - the tunnel is in L2 mode.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
fib_prefix_t tunnel_dst
The tunnel's destination/remote address.
A protocol Independent FIB table.
struct _unix_shared_memory_queue unix_shared_memory_queue_t