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;
107 rmp->_vl_msg_id = htons (VL_API_GRE_TUNNEL_DETAILS);
146 if (~0 == sw_if_index)
151 send_gre_tunnel_details(t, reg, mp->context);
174 #define vl_msg_name_crc_list 176 #undef vl_msg_name_crc_list 181 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 182 foreach_vl_msg_name_crc_gre;
192 vl_msg_api_set_handlers(VL_API_##N, #n, \ 193 vl_api_##n##_t_handler, \ 195 vl_api_##n##_t_endian, \ 196 vl_api_##n##_t_print, \ 197 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)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
u32 outer_fib_index
The FIB in which the src.dst address are present.
clib_memset(h->entries, 0, sizeof(h->entries[0])*entries)
void * vl_msg_api_alloc(int nbytes)
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
#define clib_memcpy(d, s, n)
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.
A representation of a GRE tunnel.
static void send_gre_tunnel_details(gre_tunnel_t *t, vl_api_registration_t *reg, u32 context)
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.
An API client registration, only in vpp/vlib.
u32 ft_table_id
Table ID (hash key) for this FIB.
static void setup_message_id_table(api_main_t *am)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Create or delete a GRE tunnel.
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
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.
u16 session_id
ERSPAN type 2 session ID, least significant 10 bits of u16.
A protocol Independent FIB table.