FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
gre.h File Reference
+ Include dependency graph for gre.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gre_protocol_info_t
 A GRE payload protocol registration. More...
 
struct  gre_tunnel_key4_t_
 Key for a IPv4 GRE Tunnel. More...
 
struct  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. More...
 
union  gre_tunnel_key_t_
 Union of the two possible key types. More...
 
struct  gre_tunnel_t
 A representation of a GRE tunnel. More...
 
struct  gre_main_t
 GRE related global data. More...
 
struct  vnet_gre_add_del_tunnel_args_t
 

Macros

#define gre_error(n, s)   GRE_ERROR_##n,
 
#define GRE_TUNNEL_TYPE_NAMES
 
#define GRE_TUNNEL_N_TYPES   ((gre_tunnel_type_t)GRE_TUNNEL_TYPE_TEB+1)
 
#define GRE_OUTPUT_NEXT_LOOKUP   1
 

Typedefs

typedef enum gre_tunnel_tyoe_t_ gre_tunnel_type_t
 The GRE tunnel type. More...
 
typedef struct gre_tunnel_key4_t_ gre_tunnel_key4_t
 Key for a IPv4 GRE Tunnel. More...
 
typedef 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. More...
 
typedef union gre_tunnel_key_t_ gre_tunnel_key_t
 Union of the two possible key types. More...
 

Enumerations

enum  gre_error_t { GRE_N_ERROR }
 
enum  gre_tunnel_tyoe_t_ { GRE_TUNNEL_TYPE_L3, GRE_TUNNEL_TYPE_TEB }
 The GRE tunnel type. More...
 

Functions

typedef CLIB_PACKED (struct{ip4_header_t ip4;gre_header_t gre;}) ip4_and_gre_header_t
 IPv4 and GRE header. More...
 
typedef CLIB_PACKED (struct{ip6_header_t ip6;gre_header_t gre;}) ip6_and_gre_header_t
 IPv6 and GRE header. More...
 
static gre_protocol_info_tgre_get_protocol_info (gre_main_t *em, gre_protocol_t protocol)
 
void gre_register_input_type (vlib_main_t *vm, gre_protocol_t protocol, u32 node_index)
 
clib_error_tgre_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
void gre_tunnel_stack (adj_index_t ai)
 gre_tunnel_stack More...
 
void gre_update_adj (vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
 
void gre_register_input_protocol (vlib_main_t *vm, gre_protocol_t protocol, u32 node_index)
 
int vnet_gre_add_del_tunnel (vnet_gre_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
 
static void gre_mk_key4 (const ip4_address_t *src, const ip4_address_t *dst, u32 fib_index, gre_tunnel_key4_t *key)
 
static int gre_match_key4 (const gre_tunnel_key4_t *key1, const gre_tunnel_key4_t *key2)
 
static void gre_mk_key6 (const ip6_address_t *src, const ip6_address_t *dst, u32 fib_index, gre_tunnel_key6_t *key)
 
static int gre_match_key6 (const gre_tunnel_key6_t *key1, const gre_tunnel_key6_t *key2)
 

Variables

vnet_hw_interface_class_t gre_hw_interface_class
 
gre_main_t gre_main
 
format_function_t format_gre_protocol
 
format_function_t format_gre_header
 
format_function_t format_gre_header_with_length
 
vlib_node_registration_t gre4_input_node
 (constructor) VLIB_REGISTER_NODE (gre4_input_node) More...
 
vlib_node_registration_t gre6_input_node
 (constructor) VLIB_REGISTER_NODE (gre6_input_node) More...
 
vnet_device_class_t gre_device_class
 
vnet_device_class_t gre_device_teb_class
 
unformat_function_t unformat_gre_protocol_host_byte_order
 
unformat_function_t unformat_gre_protocol_net_byte_order
 
unformat_function_t unformat_gre_header
 
unformat_function_t unformat_pg_gre_header
 

Macro Definition Documentation

#define gre_error (   n,
 
)    GRE_ERROR_##n,

Definition at line 32 of file gre.h.

#define GRE_OUTPUT_NEXT_LOOKUP   1

Definition at line 304 of file gre.h.

#define GRE_TUNNEL_N_TYPES   ((gre_tunnel_type_t)GRE_TUNNEL_TYPE_TEB+1)

Definition at line 76 of file gre.h.

#define GRE_TUNNEL_TYPE_NAMES
Value:
{ \
[GRE_TUNNEL_TYPE_L3] = "L3", \
[GRE_TUNNEL_TYPE_TEB] = "TEB", \
}
L3 GRE (i.e.
Definition: gre.h:64
Transparent Ethernet Bridging - the tunnel is in L2 mode.
Definition: gre.h:68

Definition at line 71 of file gre.h.

Typedef Documentation

Key for a IPv4 GRE Tunnel.

Key for a IPv6 GRE Tunnel We use a different type so that the V4 key hash is as small as possible.

Union of the two possible key types.

The GRE tunnel type.

Enumeration Type Documentation

Enumerator
GRE_N_ERROR 

Definition at line 30 of file gre.h.

The GRE tunnel type.

Enumerator
GRE_TUNNEL_TYPE_L3 

L3 GRE (i.e.

this tunnel is in L3 mode)

GRE_TUNNEL_TYPE_TEB 

Transparent Ethernet Bridging - the tunnel is in L2 mode.

Definition at line 59 of file gre.h.

Function Documentation

typedef CLIB_PACKED ( struct{ip4_header_t ip4;gre_header_t gre;}  )

IPv4 and GRE header.

typedef CLIB_PACKED ( struct{ip6_header_t ip6;gre_header_t gre;}  )

IPv6 and GRE header.

static gre_protocol_info_t* gre_get_protocol_info ( gre_main_t em,
gre_protocol_t  protocol 
)
inlinestatic

Definition at line 261 of file gre.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* gre_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)

Definition at line 482 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int gre_match_key4 ( const gre_tunnel_key4_t key1,
const gre_tunnel_key4_t key2 
)
inlinestatic

Definition at line 330 of file gre.h.

+ Here is the caller graph for this function:

static int gre_match_key6 ( const gre_tunnel_key6_t key1,
const gre_tunnel_key6_t key2 
)
inlinestatic

Definition at line 348 of file gre.h.

+ Here is the caller graph for this function:

static void gre_mk_key4 ( const ip4_address_t src,
const ip4_address_t dst,
u32  fib_index,
gre_tunnel_key4_t key 
)
inlinestatic

Definition at line 320 of file gre.h.

+ Here is the caller graph for this function:

static void gre_mk_key6 ( const ip6_address_t src,
const ip6_address_t dst,
u32  fib_index,
gre_tunnel_key6_t key 
)
inlinestatic

Definition at line 338 of file gre.h.

+ Here is the caller graph for this function:

void gre_register_input_protocol ( vlib_main_t vm,
gre_protocol_t  protocol,
u32  node_index 
)

Definition at line 625 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gre_register_input_type ( vlib_main_t vm,
gre_protocol_t  protocol,
u32  node_index 
)

+ Here is the caller graph for this function:

void gre_tunnel_stack ( adj_index_t  ai)

gre_tunnel_stack

'stack' (resolve the recursion for) the tunnel's midchain adjacency

Definition at line 138 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gre_update_adj ( vnet_main_t vnm,
u32  sw_if_index,
adj_index_t  ai 
)

Definition at line 292 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_gre_add_del_tunnel ( vnet_gre_add_del_tunnel_args_t a,
u32 sw_if_indexp 
)

Definition at line 472 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_gre_header

Definition at line 282 of file gre.h.

format_function_t format_gre_header_with_length

Definition at line 283 of file gre.h.

format_function_t format_gre_protocol

Definition at line 281 of file gre.h.

vlib_node_registration_t gre4_input_node

(constructor) VLIB_REGISTER_NODE (gre4_input_node)

Definition at line 575 of file node.c.

vlib_node_registration_t gre6_input_node

(constructor) VLIB_REGISTER_NODE (gre6_input_node)

Definition at line 598 of file node.c.

vnet_device_class_t gre_device_class
vnet_device_class_t gre_device_teb_class
vnet_hw_interface_class_t gre_hw_interface_class
gre_main_t gre_main

Definition at line 22 of file gre.c.

unformat_function_t unformat_gre_header

Definition at line 296 of file gre.h.

unformat_function_t unformat_gre_protocol_host_byte_order

Definition at line 292 of file gre.h.

unformat_function_t unformat_gre_protocol_net_byte_order

Definition at line 293 of file gre.h.

unformat_function_t unformat_pg_gre_header

Definition at line 297 of file gre.h.