FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
node.c File Reference

L2-GRE over IPSec packet processing. More...

+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  ipsec_gre_rx_trace_t
 

Macros

#define foreach_ipsec_gre_input_next
 
#define ipsec_gre_error(n, s)   s,
 

Enumerations

enum  ipsec_gre_input_next_t { IPSEC_GRE_INPUT_N_NEXT }
 

Functions

u8format_ipsec_gre_rx_trace (u8 *s, va_list *args)
 
static uword ipsec_gre_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 L2-GRE over IPSec input node. More...
 
static clib_error_tipsec_gre_input_init (vlib_main_t *vm)
 

Variables

static char * ipsec_gre_error_strings []
 
vlib_node_registration_t ipsec_gre_input_node
 (constructor) VLIB_REGISTER_NODE (ipsec_gre_input_node) More...
 

Detailed Description

L2-GRE over IPSec packet processing.

Removes GRE header from the packet and sends it to the l2-input node.

Definition in file node.c.

Macro Definition Documentation

#define foreach_ipsec_gre_input_next
Value:
_(PUNT, "error-punt") \
_(DROP, "error-drop") \
_(L2_INPUT, "l2-input")
DROP
Definition: error.def:41

Definition at line 27 of file node.c.

#define ipsec_gre_error (   n,
 
)    s,

Enumeration Type Documentation

Enumerator
IPSEC_GRE_INPUT_N_NEXT 

Definition at line 32 of file node.c.

Function Documentation

u8* format_ipsec_gre_rx_trace ( u8 s,
va_list *  args 
)

Definition at line 46 of file node.c.

+ Here is the call graph for this function:

static uword ipsec_gre_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

L2-GRE over IPSec input node.

Node Identifier:
ipsec-gre-input

This node remove GRE header.

Parameters
vmvlib_main_t corresponding to the current thread.
nodevlib_node_runtime_t data for this node.
from_framevlib_frame_t whose contents should be dispatched.
Graph mechanics: buffer metadata, next index usage

Uses:

  • ip->src_address and ip->dst_address
    • Match tunnel by source and destination addresses in GRE IP header.

Sets:

  • vnet_buffer(b)->gre.src
    • Save tunnel source IPv4 address.
  • vnet_buffer(b)->gre.dst
    • Save tunnel destination IPv4 address.
  • vnet_buffer(b)->sw_if_index[VLIB_RX]
    • Set input sw_if_index to IPSec-GRE tunnel for learning.

Next Index:

  • Dispatches the packet to the l2-input node.

Definition at line 87 of file node.c.

+ Here is the call graph for this function:

static clib_error_t* ipsec_gre_input_init ( vlib_main_t vm)
static

Definition at line 421 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

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

Definition at line 394 of file node.c.

vlib_node_registration_t ipsec_gre_input_node
Initial value:
= {
.function = ipsec_gre_input,
.name = "ipsec-gre-input",
.vector_size = sizeof (u32),
.n_errors = IPSEC_GRE_N_ERROR,
.error_strings = ipsec_gre_error_strings,
.n_next_nodes = IPSEC_GRE_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_ipsec_gre_rx_trace,
}
u8 * format_ipsec_gre_rx_trace(u8 *s, va_list *args)
Definition: node.c:46
static uword ipsec_gre_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
L2-GRE over IPSec input node.
Definition: node.c:87
#define foreach_ipsec_gre_input_next
Definition: node.c:27
unsigned int u32
Definition: types.h:88
static char * ipsec_gre_error_strings[]
Definition: node.c:394

(constructor) VLIB_REGISTER_NODE (ipsec_gre_input_node)

Definition at line 400 of file node.c.