31 #include <vnet/gre/gre.api_enum.h> 32 #include <vnet/gre/gre.api_types.h> 34 #define REPLY_MSG_ID_BASE gre_main.msg_id_base 43 case GRE_API_TUNNEL_TYPE_##n: \ 44 *out = GRE_TUNNEL_TYPE_##n; \ 50 return (VNET_API_ERROR_INVALID_VALUE);
53 static vl_api_gre_tunnel_type_t
61 case GRE_TUNNEL_TYPE_##n: \ 62 out = GRE_API_TUNNEL_TYPE_##n; \ 84 if (itype[0] != itype[1])
86 rv = VNET_API_ERROR_INVALID_PROTOCOL;
92 rv = VNET_API_ERROR_SAME_SRC_DST;
113 a->instance = ntohl (mp->
tunnel.instance);
115 a->outer_table_id = ntohl (mp->
tunnel.outer_table_id);
141 rmp->
tunnel.outer_table_id =
168 if (~0 == sw_if_index)
199 #include <vnet/gre/gre.api.c> fib_protocol_t fp_proto
protocol type
static clib_error_t * gre_api_hookup(vlib_main_t *vm)
vl_api_wireguard_peer_flags_t flags
#define pool_foreach(VAR, POOL)
Iterate through pool.
static int gre_tunnel_type_decode(vl_api_gre_tunnel_type_t in, gre_tunnel_type_t *out)
#define REPLY_MACRO2(t, body)
VLIB_API_INIT_FUNCTION(gre_api_hookup)
int vnet_gre_tunnel_add_del(vnet_gre_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
u32 outer_fib_index
The FIB in which the src.dst address are present.
static void send_gre_tunnel_details(gre_tunnel_t *t, vl_api_gre_tunnel_dump_t *mp)
static vl_api_gre_tunnel_type_t gre_tunnel_type_encode(gre_tunnel_type_t in)
Dump details of all or just a single GRE tunnel.
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)
vl_api_interface_index_t sw_if_index
Details response for one of the requested GRE tunnels.
ip46_address_t tunnel_src
The tunnel's source/local address.
ip46_type_t ip_address_decode(const vl_api_address_t *in, ip46_address_t *out)
Decode/Encode for struct/union types.
A representation of a GRE tunnel.
Add or delete a single GRE tunnel.
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
int tunnel_mode_decode(vl_api_tunnel_mode_t in, tunnel_mode_t *out)
enum tunnel_encap_decap_flags_t_ tunnel_encap_decap_flags_t
static u8 ip46_address_is_equal(const ip46_address_t *ip46_1, const ip46_address_t *ip46_2)
vl_api_gre_tunnel_t tunnel
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
#define REPLY_MACRO_DETAILS2(t, body)
vl_api_gre_tunnel_t tunnel
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_interface_index_t sw_if_index
static void vl_api_gre_tunnel_add_del_t_handler(vl_api_gre_tunnel_add_del_t *mp)
vl_api_tunnel_mode_t tunnel_mode_encode(tunnel_mode_t in)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
gre_tunnel_t * tunnels
pool of tunnel instances
Add or delete a single GRE tunnel.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
enum gre_tunnel_type_t_ gre_tunnel_type_t
The GRE tunnel type.
fib_prefix_t tunnel_dst
The tunnel's destination/remote address.
int tunnel_encap_decap_flags_decode(vl_api_tunnel_encap_decap_flags_t f, tunnel_encap_decap_flags_t *o)
Conversion functions to/from (decode/encode) API types to VPP internal types.
u16 session_id
ERSPAN type 2 session ID, least significant 10 bits of u16.
vl_api_interface_index_t sw_if_index