FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
gre.c File Reference
+ Include dependency graph for gre.c:

Go to the source code of this file.

Data Structures

struct  ip4_and_gre_union_t
 IPv4 and GRE header union. More...
 
struct  ip6_and_gre_union_t
 
struct  gre_tx_trace_t
 

Macros

#define is_v4_packet(_h)   ((*(u8*) _h) & 0xF0) == 0x40
 
#define gre_error(n, s)   s,
 

Enumerations

enum  gre_encap_next_t { GRE_ENCAP_NEXT_L2_MIDCHAIN, GRE_ENCAP_N_NEXT }
 

Functions

u8format_gre_tx_trace (u8 *s, va_list *args)
 
u8format_gre_protocol (u8 *s, va_list *args)
 
u8format_gre_header_with_length (u8 *s, va_list *args)
 
u8format_gre_header (u8 *s, va_list *args)
 
uword unformat_gre_protocol_host_byte_order (unformat_input_t *input, va_list *args)
 
uword unformat_gre_protocol_net_byte_order (unformat_input_t *input, va_list *args)
 
uword unformat_gre_header (unformat_input_t *input, va_list *args)
 
static int gre_proto_from_vnet_link (vnet_link_t link)
 
static u8gre_build_rewrite (vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
 
static void gre4_fixup (vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b0, const void *data)
 
static void gre6_fixup (vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b0, const void *data)
 
void gre_update_adj (vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
 
static uword gre_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 TX function. More...
 
static u8format_gre_tunnel_name (u8 *s, va_list *args)
 
static u8format_gre_device (u8 *s, va_list *args)
 
 VNET_DEVICE_CLASS (gre_device_class)
 
 VNET_HW_INTERFACE_CLASS (gre_hw_interface_class)
 
static void add_protocol (gre_main_t *gm, gre_protocol_t protocol, char *protocol_name)
 
static clib_error_tgre_init (vlib_main_t *vm)
 

Variables

gre_main_t gre_main
 
static char * gre_error_strings []
 
vlib_node_registration_t gre_encap_node
 (constructor) VLIB_REGISTER_NODE (gre_encap_node) More...
 

Macro Definition Documentation

#define gre_error (   n,
 
)    s,
#define is_v4_packet (   _h)    ((*(u8*) _h) & 0xF0) == 0x40

Definition at line 268 of file gre.c.

Enumeration Type Documentation

Enumerator
GRE_ENCAP_NEXT_L2_MIDCHAIN 
GRE_ENCAP_N_NEXT 

Definition at line 321 of file gre.c.

Function Documentation

static void add_protocol ( gre_main_t gm,
gre_protocol_t  protocol,
char *  protocol_name 
)
static

Definition at line 576 of file gre.c.

static u8* format_gre_device ( u8 s,
va_list *  args 
)
static

Definition at line 544 of file gre.c.

+ Here is the call graph for this function:

u8* format_gre_header ( u8 s,
va_list *  args 
)

Definition at line 118 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_gre_header_with_length ( u8 s,
va_list *  args 
)

Definition at line 87 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_gre_protocol ( u8 s,
va_list *  args 
)

Definition at line 72 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_gre_tunnel_name ( u8 s,
va_list *  args 
)
static

Definition at line 530 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_gre_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 58 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gre4_fixup ( vlib_main_t vm,
ip_adjacency_t adj,
vlib_buffer_t b0,
const void *  data 
)
static

Definition at line 271 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void gre6_fixup ( vlib_main_t vm,
ip_adjacency_t adj,
vlib_buffer_t b0,
const void *  data 
)
static

Definition at line 285 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* gre_build_rewrite ( vnet_main_t vnm,
u32  sw_if_index,
vnet_link_t  link_type,
const void *  dst_address 
)
static

Definition at line 204 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* gre_init ( vlib_main_t vm)
static

Definition at line 593 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword gre_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

TX function.

Only called for L2 payload including TEB or ERSPAN. L3 traffic uses the adj-midchains.

Definition at line 332 of file gre.c.

+ Here is the call graph for this function:

static int gre_proto_from_vnet_link ( vnet_link_t  link)
static

Definition at line 181 of file gre.c.

+ 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 300 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_gre_header ( unformat_input_t input,
va_list *  args 
)

Definition at line 157 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_gre_protocol_host_byte_order ( unformat_input_t input,
va_list *  args 
)

Definition at line 126 of file gre.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_gre_protocol_net_byte_order ( unformat_input_t input,
va_list *  args 
)

Definition at line 146 of file gre.c.

+ Here is the call graph for this function:

VNET_DEVICE_CLASS ( gre_device_class  )

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_CLASS ( gre_hw_interface_class  )

+ Here is the caller graph for this function:

Variable Documentation

vlib_node_registration_t gre_encap_node
Initial value:
=
{
.function = gre_interface_tx,
.name = "gre-encap",
.vector_size = sizeof (u32),
.format_trace = format_gre_tx_trace,
.n_errors = GRE_N_ERROR,
.error_strings = gre_error_strings,
.n_next_nodes = GRE_ENCAP_N_NEXT,
.next_nodes = {
[GRE_ENCAP_NEXT_L2_MIDCHAIN] = "adj-l2-midchain",
},
}
static uword gre_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
TX function.
Definition: gre.c:332
unsigned int u32
Definition: types.h:88
u8 * format_gre_tx_trace(u8 *s, va_list *args)
Definition: gre.c:58
static char * gre_error_strings[]
Definition: gre.c:504

(constructor) VLIB_REGISTER_NODE (gre_encap_node)

Definition at line 511 of file gre.c.

char* gre_error_strings[]
static
Initial value:
= {
#define gre_error(n,s)
gre_error (NONE, "no error")
gre_error (UNKNOWN_PROTOCOL, "unknown protocol")
gre_error (UNSUPPORTED_VERSION, "unsupported version")
gre_error (PKTS_DECAP, "GRE input packets decapsulated")
gre_error (PKTS_ENCAP, "GRE output packets encapsulated")
gre_error (NO_SUCH_TUNNEL, "GRE input packets dropped due to missing tunnel")
}
option version
Definition: memclnt.api:17
#define gre_error(n, s)

Definition at line 504 of file gre.c.

gre_main_t gre_main

Definition at line 22 of file gre.c.