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) 65 rv = VNET_API_ERROR_NO_SUCH_FIB;
74 rv = VNET_API_ERROR_SAME_SRC_DST;
77 memset (a, 0,
sizeof (*a));
105 memset (rmp, 0,
sizeof (*rmp));
106 rmp->_vl_msg_id = ntohs (VL_API_GRE_TUNNEL_DETAILS);
133 if (~0 == sw_if_index)
138 send_gre_tunnel_details(t, q, mp->context);
161 #define vl_msg_name_crc_list 163 #undef vl_msg_name_crc_list 168 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 169 foreach_vl_msg_name_crc_gre;
179 vl_msg_api_set_handlers(VL_API_##N, #n, \ 180 vl_api_##n##_t_handler, \ 182 vl_api_##n##_t_endian, \ 183 vl_api_##n##_t_print, \ 184 sizeof(vl_api_##n##_t), 1);
static clib_error_t * gre_api_hookup(vlib_main_t *vm)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
#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.
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
ip4_address_t tunnel_dst
The tunnel's destination/remote address.
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)
A representation of a GRE tunnel.
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
void * vl_msg_api_alloc(int nbytes)
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)
ip4_address_t tunnel_src
The tunnel's source/local address.
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.
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
struct _unix_shared_memory_queue unix_shared_memory_queue_t