18 #ifndef included_gre_h 19 #define included_gre_h 32 #define gre_error(n,s) GRE_ERROR_##n, 71 #define GRE_TUNNEL_TYPE_NAMES { \ 72 [GRE_TUNNEL_TYPE_L3] = "L3", \ 73 [GRE_TUNNEL_TYPE_TEB] = "TEB", \ 76 #define GRE_TUNNEL_N_TYPES ((gre_tunnel_type_t)GRE_TUNNEL_TYPE_TEB+1) 247 }) ip4_and_gre_header_t;
257 }) ip6_and_gre_header_t;
275 u32 hw_if_index,
u32 flags);
304 #define GRE_OUTPUT_NEXT_LOOKUP 1
vlib_node_registration_t gre4_input_node
(constructor) VLIB_REGISTER_NODE (gre4_input_node)
uword * tunnel_by_key6
Hash mapping ipv6 src/dst addr pair to tunnel.
format_function_t format_gre_header_with_length
fib_node_index_t fib_entry_index
The FIB entry sourced by the tunnel for its destination prefix.
Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible...
gre_tunnel_tyoe_t_
The GRE tunnel type.
typedef CLIB_PACKED(struct{ip4_header_t ip4;gre_header_t gre;}) ip4_and_gre_header_t
IPv4 and GRE header.
uword * protocol_info_by_protocol
static void gre_mk_key4(const ip4_address_t *src, const ip4_address_t *dst, u32 fib_index, gre_tunnel_key4_t *key)
gre_protocol_t protocol
GRE protocol type in host byte order.
char * name
Name (a c string).
A GRE payload protocol registration.
u32 outer_fib_index
The FIB in which the src.dst address are present.
#define GRE_TUNNEL_N_TYPES
static void gre_mk_key6(const ip6_address_t *src, const ip6_address_t *dst, u32 fib_index, gre_tunnel_key6_t *key)
struct _vlib_node_registration vlib_node_registration_t
struct _vnet_device_class vnet_device_class_t
u32 * tunnel_index_by_sw_if_index
Mapping from sw_if_index to tunnel index.
u32 sibling_index
The tunnel is a child of the FIB entry for its desintion.
void gre_tunnel_stack(adj_index_t ai)
gre_tunnel_stack
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Aggregrate type for a prefix.
enum gre_tunnel_tyoe_t_ gre_tunnel_type_t
The GRE tunnel type.
adj_index_t l2_adj_index
an L2 tunnel always rquires an L2 midchain.
unformat_function_t unformat_gre_header
ip46_address_t tunnel_src
The tunnel's source/local address.
uword * tunnel_by_key4
Hash mapping ipv4 src/dst addr pair to tunnel.
A representation of a GRE tunnel.
ip6_address_t gtk_src
Source and destination IP addresses.
unformat_function_t unformat_gre_protocol_net_byte_order
static int gre_match_key4(const gre_tunnel_key4_t *key1, const gre_tunnel_key4_t *key2)
u32 node_index
Node which handles this type.
vnet_device_class_t gre_device_teb_class
static int gre_match_key6(const gre_tunnel_key6_t *key1, const gre_tunnel_key6_t *key2)
An node in the FIB graph.
Key for a IPv4 GRE Tunnel.
union gre_tunnel_key_t_ gre_tunnel_key_t
Union of the two possible key types.
format_function_t format_gre_protocol
u32 fib_node_index_t
A typedef of a node index.
u32 adj_index_t
An index for adjacencies.
u32 gtk_fib_index
The FIB table the src,dst addresses are in.
u32 next_index
Next index for this type.
void gre_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
gre_tunnel_t * tunnels
pool of tunnel instances
Union of the two possible key types.
vnet_hw_interface_class_t gre_hw_interface_class
u32 l2_tx_arc
on a L2 tunnel this is the VLIB arc from the L2-tx to the l2-midchain
fib_node_t node
Linkage into the FIB object graph.
vnet_device_class_t gre_device_class
clib_error_t * gre_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
int vnet_gre_add_del_tunnel(vnet_gre_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
u32 gtk_fib_index
The FIB table the src,dst addresses are in.
struct _vnet_hw_interface_class vnet_hw_interface_class_t
Transparent Ethernet Bridging - the tunnel is in L2 mode.
void gre_register_input_type(vlib_main_t *vm, gre_protocol_t protocol, u32 node_index)
unformat_function_t unformat_pg_gre_header
void gre_register_input_protocol(vlib_main_t *vm, gre_protocol_t protocol, u32 node_index)
gre_tunnel_key_t * key
The hash table's key stored in separate memory since the tunnel_t memory can realloc.
vlib_node_registration_t gre6_input_node
(constructor) VLIB_REGISTER_NODE (gre6_input_node)
unformat_function_t unformat_gre_protocol_host_byte_order
fib_prefix_t tunnel_dst
The tunnel's destination/remote address.
static gre_protocol_info_t * gre_get_protocol_info(gre_main_t *em, gre_protocol_t protocol)
gre_protocol_info_t * protocol_infos
GRE payload protocol registrations.
format_function_t format_gre_header