|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
18 #ifndef included_gre_h
19 #define included_gre_h
34 #define gre_error(n,s) GRE_ERROR_##n,
48 #define foreach_gre_tunnel_type \
58 #define _(n, s) GRE_TUNNEL_TYPE_##n,
161 #define GTK_SESSION_ID_MAX (0x3ff)
300 }) ip4_and_gre_header_t;
310 }) ip6_and_gre_header_t;
362 #define GRE_OUTPUT_NEXT_LOOKUP 1
389 key->gtk_common.type = ttype;
390 key->gtk_common.mode = tmode;
391 key->gtk_common.fib_index = fib_index;
405 const ip6_address_t *
dst,
412 key->gtk_common.type = ttype;
413 key->gtk_common.mode = tmode;
414 key->gtk_common.fib_index = fib_index;
static uword ip6_address_is_equal(const ip6_address_t *a, const ip6_address_t *b)
struct gre_tunnel_key_common_t_ gre_tunnel_key_common_t
Elements of the GRE key that are common for v6 and v6 addresses.
Used for GRE header seq number generation for ERSPAN encap.
Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible.
char * name
Name (a c string).
enum tunnel_encap_decap_flags_t_ tunnel_encap_decap_flags_t
typedef CLIB_PACKED(struct { ip4_header_t ip4;gre_header_t gre;}) ip4_and_gre_header_t
IPv4 and GRE header.
struct _vnet_device_class vnet_device_class_t
static void gre_mk_sn_key(const gre_tunnel_t *gt, gre_sn_key_t *key)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
void gre_register_input_protocol(vlib_main_t *vm, gre_protocol_t protocol, u32 node_index, gre_tunnel_type_t tunnel_type)
uword * tunnel_by_key6
Hash mapping to tunnels with ipv6 src/dst addr.
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
static void gre_mk_key6(const ip6_address_t *src, const ip6_address_t *dst, u32 fib_index, gre_tunnel_type_t ttype, tunnel_mode_t tmode, u16 session_id, gre_tunnel_key6_t *key)
uword * protocol_info_by_protocol
A GRE payload protocol registration.
gre_protocol_t protocol
GRE protocol type in host byte order.
tunnel_encap_decap_flags_t flags
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static int gre_match_key6(const gre_tunnel_key6_t *key1, const gre_tunnel_key6_t *key2)
gre_tunnel_type_t_
The GRE tunnel type.
unformat_function_t unformat_pg_gre_header
unformat_function_t unformat_gre_header
#define foreach_gre_tunnel_type
L3: GRE (i.e.
clib_error_t * gre_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static int gre_match_key4(const gre_tunnel_key4_t *key1, const gre_tunnel_key4_t *key2)
fib_prefix_t tunnel_dst
The tunnel's destination/remote address.
struct mgre_walk_ctx_t_ mgre_walk_ctx_t
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
adj_index_t l2_adj_index
an L2 tunnel always rquires an L2 midchain.
unformat_function_t unformat_gre_protocol_host_byte_order
enum gre_tunnel_type_t_ gre_tunnel_type_t
The GRE tunnel type.
ip6_address_t gtk_src
Source and destination IP addresses.
unformat_function_t unformat_gre_protocol_net_byte_order
gre_tunnel_type_t tunnel_type
GRE tunnel type.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
A representation of a GRE tunnel.
u16 session_id
ERSPAN type 2 session ID, least significant 10 bits of u16.
u32 node_index
Node which handles this type.
vlib_node_registration_t gre_teb_encap_node
(constructor) VLIB_REGISTER_NODE (gre_teb_encap_node)
STATIC_ASSERT_SIZEOF(gre_tunnel_key_common_t, sizeof(u64))
vlib_node_registration_t gre_erspan_encap_node
(constructor) VLIB_REGISTER_NODE (gre_erspan_encap_node)
ip46_address_t tunnel_src
The tunnel's source/local address.
void gre_tunnel_stack(adj_index_t ai)
gre_tunnel_stack
Key for a IPv4 GRE Tunnel.
struct _vlib_node_registration vlib_node_registration_t
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
gre_tunnel_key_common_t gtk_common
address independent attributes
gre_protocol_info_t * protocol_infos
GRE payload protocol registrations.
u32 next_index
Next index for this type.
tunnel_encap_decap_flags_t flags
next_info_t * next_by_protocol
vnet_hw_interface_class_t gre_hw_interface_class
int vnet_gre_tunnel_add_del(vnet_gre_tunnel_add_del_args_t *a, u32 *sw_if_indexp)
uword * seq_num_by_key
Hash mapping tunnel src/dst addr and fib-idx to sequence number.
vl_api_ip_proto_t protocol
format_function_t format_gre_protocol
vlib_node_registration_t gre6_input_node
(constructor) VLIB_REGISTER_NODE (gre6_input_node)
static void gre_mk_key4(ip4_address_t src, ip4_address_t dst, u32 fib_index, gre_tunnel_type_t ttype, tunnel_mode_t tmode, u16 session_id, gre_tunnel_key4_t *key)
struct gre_tunnel_key6_t_ gre_tunnel_key6_t
Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible.
adj_walk_rc_t mgre_mk_incomplete_walk(adj_index_t ai, void *data)
Union of the two possible key types.
u32 adj_index_t
An index for adjacencies.
static gre_protocol_info_t * gre_get_protocol_info(gre_main_t *em, gre_protocol_t protocol)
gre_tunnel_t * tunnels
pool of tunnel instances
enum tunnel_mode_t_ tunnel_mode_t
format_function_t format_gre_header
gre_sn_t * gre_sn
GRE header sequence number (SN) used for ERSPAN type 2 header, must be bumped automically to be threa...
u8 * format_gre_tunnel_type(u8 *s, va_list *args)
adj_walk_rc_t mgre_mk_complete_walk(adj_index_t ai, void *data)
Elements of the GRE key that are common for v6 and v6 addresses.
vlib_node_registration_t gre4_input_node
(constructor) VLIB_REGISTER_NODE (gre4_input_node)
Hash key for GRE header seq number generation for ERSPAN encap.
u32 outer_fib_index
The FIB in which the src.dst address are present.
uword * tunnel_by_key4
Hash mapping to tunnels with ipv4 src/dst addr.
union gre_tunnel_key_t_ gre_tunnel_key_t
Union of the two possible key types.
void gre_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
vl_api_interface_index_t sw_if_index
gre_tunnel_key_common_t gtk_common
address independent attributes
vnet_hw_interface_class_t mgre_hw_interface_class
struct _vnet_hw_interface_class vnet_hw_interface_class_t
Aggregate type for a prefix.
struct gre_tunnel_key4_t_ gre_tunnel_key4_t
Key for a IPv4 GRE Tunnel.
vnet_device_class_t gre_device_class
vl_api_wireguard_peer_flags_t flags
format_function_t format_gre_header_with_length