FD.io VPP  v19.04.4-rc0-5-ge88582fac
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

static u8format_ipsec_gre_rx_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() ipsec_gre_input_node (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

◆ foreach_ipsec_gre_input_next

#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.

◆ ipsec_gre_error

#define ipsec_gre_error (   n,
 
)    s,

Enumeration Type Documentation

◆ ipsec_gre_input_next_t

Enumerator
IPSEC_GRE_INPUT_N_NEXT 

Definition at line 32 of file node.c.

Function Documentation

◆ format_ipsec_gre_rx_trace()

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

Definition at line 46 of file node.c.

+ Here is the call graph for this function:

◆ ipsec_gre_input_init()

static clib_error_t* ipsec_gre_input_init ( vlib_main_t vm)
static

Definition at line 414 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_gre_input_node()

VLIB_NODE_FN() ipsec_gre_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

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 86 of file node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ ipsec_gre_error_strings

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)
option version
Definition: memclnt.api:17
u8 protocol
Definition: ipsec.api:96

Definition at line 390 of file node.c.

◆ ipsec_gre_input_node

vlib_node_registration_t ipsec_gre_input_node
Initial value:
= {
.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,
}
#define foreach_ipsec_gre_input_next
Definition: node.c:27
unsigned int u32
Definition: types.h:88
static u8 * format_ipsec_gre_rx_trace(u8 *s, va_list *args)
Definition: node.c:46
static char * ipsec_gre_error_strings[]
Definition: node.c:390

(constructor) VLIB_REGISTER_NODE (ipsec_gre_input_node)

Definition at line 396 of file node.c.