FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
mpls_output.c File Reference
+ Include dependency graph for mpls_output.c:

Go to the source code of this file.

Data Structures

struct  mpls_output_trace_t
 
struct  mpls_frag_trace_t_
 
struct  mpls_adj_incomplete_trace_t_
 A struct to hold tracing information for the MPLS label imposition node. More...
 

Macros

#define foreach_mpls_output_next
 
#define mpls_error(n, s)   s,
 
#define foreach_mpls_adj_incomplete_next
 

Typedefs

typedef struct mpls_frag_trace_t_ mpls_frag_trace_t
 
typedef struct mpls_adj_incomplete_trace_t_ mpls_adj_incomplete_trace_t
 A struct to hold tracing information for the MPLS label imposition node. More...
 

Enumerations

enum  mpls_output_mode_t { MPLS_OUTPUT_MODE, MPLS_OUTPUT_MIDCHAIN_MODE }
 
enum  mpls_output_next_t { MPLS_OUTPUT_N_NEXT }
 
enum  mpls_frag_next_t {
  MPLS_FRAG_NEXT_REWRITE, MPLS_FRAG_NEXT_REWRITE_MIDCHAIN, MPLS_FRAG_NEXT_ICMP_ERROR, MPLS_FRAG_NEXT_DROP,
  MPLS_FRAG_N_NEXT
}
 
enum  mpls_adj_incomplete_next_t { MPLS_ADJ_INCOMPLETE_N_NEXT }
 

Functions

static u8format_mpls_output_trace (u8 *s, va_list *args)
 
static uword mpls_output_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, mpls_output_mode_t mode)
 
VLIB_NODE_FN() mpls_output_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
VLIB_NODE_FN() mpls_midchain_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword mpls_frag (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_mpls_frag_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() mpls_adj_incomplete_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph node for incomplete MPLS adjacency. More...
 
static u8format_mpls_adj_incomplete_trace (u8 *s, va_list *args)
 

Variables

static char * mpls_error_strings []
 
vlib_node_registration_t mpls_output_node
 (constructor) VLIB_REGISTER_NODE (mpls_output_node) More...
 
vlib_node_registration_t mpls_midchain_node
 (constructor) VLIB_REGISTER_NODE (mpls_midchain_node) More...
 
static char * mpls_frag_error_strings []
 
vlib_node_registration_t mpls_frag_node
 (constructor) VLIB_REGISTER_NODE (mpls_frag_node) More...
 
vlib_node_registration_t mpls_adj_incomplete_node
 (constructor) VLIB_REGISTER_NODE (mpls_adj_incomplete_node) More...
 

Macro Definition Documentation

◆ foreach_mpls_adj_incomplete_next

#define foreach_mpls_adj_incomplete_next
Value:
_(DROP, "error-drop") \
_(IP4, "ip4-arp") \
_(IP6, "ip6-discover-neighbor")

Definition at line 539 of file mpls_output.c.

◆ foreach_mpls_output_next

#define foreach_mpls_output_next
Value:
_(DROP, "error-drop") \
_(FRAG, "mpls-frag")

Definition at line 35 of file mpls_output.c.

◆ mpls_error

#define mpls_error (   n,
 
)    s,

Typedef Documentation

◆ mpls_adj_incomplete_trace_t

A struct to hold tracing information for the MPLS label imposition node.

◆ mpls_frag_trace_t

Enumeration Type Documentation

◆ mpls_adj_incomplete_next_t

Enumerator
MPLS_ADJ_INCOMPLETE_N_NEXT 

Definition at line 544 of file mpls_output.c.

◆ mpls_frag_next_t

Enumerator
MPLS_FRAG_NEXT_REWRITE 
MPLS_FRAG_NEXT_REWRITE_MIDCHAIN 
MPLS_FRAG_NEXT_ICMP_ERROR 
MPLS_FRAG_NEXT_DROP 
MPLS_FRAG_N_NEXT 

Definition at line 378 of file mpls_output.c.

◆ mpls_output_mode_t

Enumerator
MPLS_OUTPUT_MODE 
MPLS_OUTPUT_MIDCHAIN_MODE 

Definition at line 30 of file mpls_output.c.

◆ mpls_output_next_t

Enumerator
MPLS_OUTPUT_N_NEXT 

Definition at line 39 of file mpls_output.c.

Function Documentation

◆ format_mpls_adj_incomplete_trace()

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

Definition at line 630 of file mpls_output.c.

+ Here is the call graph for this function:

◆ format_mpls_frag_trace()

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

Definition at line 507 of file mpls_output.c.

◆ format_mpls_output_trace()

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

Definition at line 47 of file mpls_output.c.

◆ mpls_adj_incomplete_node()

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

Graph node for incomplete MPLS adjacency.

This node will push traffic to either the v4-arp or v6-nd node based on the next-hop proto of the adj. We pay a cost for this 'routing' node, but an incomplete adj is the exception case.

Definition at line 568 of file mpls_output.c.

+ Here is the call graph for this function:

◆ mpls_frag()

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

Definition at line 388 of file mpls_output.c.

+ Here is the call graph for this function:

◆ mpls_midchain_node()

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

Definition at line 348 of file mpls_output.c.

+ Here is the call graph for this function:

◆ mpls_output_inline()

static uword mpls_output_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
mpls_output_mode_t  mode 
)
inlinestatic

Definition at line 61 of file mpls_output.c.

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

◆ mpls_output_node()

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

Definition at line 326 of file mpls_output.c.

+ Here is the call graph for this function:

Variable Documentation

◆ mpls_adj_incomplete_node

vlib_node_registration_t mpls_adj_incomplete_node
Initial value:
= {
.name = "mpls-adj-incomplete",
.vector_size = sizeof (u32),
.n_errors = MPLS_N_ERROR,
.error_strings = mpls_error_strings,
.n_next_nodes = MPLS_ADJ_INCOMPLETE_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (mpls_adj_incomplete_node)

Definition at line 646 of file mpls_output.c.

◆ mpls_error_strings

char* mpls_error_strings[]
static
Initial value:
= {
#define mpls_error(n,s)
}

Definition at line 320 of file mpls_output.c.

◆ mpls_frag_error_strings

char* mpls_frag_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 366 of file mpls_output.c.

◆ mpls_frag_node

vlib_node_registration_t mpls_frag_node
Initial value:
= {
.function = mpls_frag,
.name = "mpls-frag",
.vector_size = sizeof (u32),
.format_trace = format_mpls_frag_trace,
.n_errors = IP_FRAG_N_ERROR,
.error_strings = mpls_frag_error_strings,
.n_next_nodes = MPLS_FRAG_N_NEXT,
.next_nodes = {
[MPLS_FRAG_NEXT_REWRITE] = "mpls-output",
[MPLS_FRAG_NEXT_REWRITE_MIDCHAIN] = "mpls-midchain",
[MPLS_FRAG_NEXT_ICMP_ERROR] = "ip4-icmp-error",
[MPLS_FRAG_NEXT_DROP] = "mpls-drop"
},
}

(constructor) VLIB_REGISTER_NODE (mpls_frag_node)

Definition at line 517 of file mpls_output.c.

◆ mpls_midchain_node

vlib_node_registration_t mpls_midchain_node
Initial value:
= {
.name = "mpls-midchain",
.vector_size = sizeof (u32),
.n_errors = MPLS_N_ERROR,
.error_strings = mpls_error_strings,
.sibling_of = "mpls-output",
.format_trace = format_mpls_output_trace,
}

(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)

Definition at line 355 of file mpls_output.c.

◆ mpls_output_node

vlib_node_registration_t mpls_output_node
Initial value:
= {
.name = "mpls-output",
.vector_size = sizeof (u32),
.n_errors = MPLS_N_ERROR,
.error_strings = mpls_error_strings,
.n_next_nodes = MPLS_OUTPUT_N_NEXT,
.next_nodes = {
[MPLS_OUTPUT_NEXT_DROP] = "mpls-drop",
[MPLS_OUTPUT_NEXT_FRAG] = "mpls-frag",
},
.format_trace = format_mpls_output_trace,
}

(constructor) VLIB_REGISTER_NODE (mpls_output_node)

Definition at line 333 of file mpls_output.c.

mpls_frag_error_strings
static char * mpls_frag_error_strings[]
Definition: mpls_output.c:366
foreach_mpls_adj_incomplete_next
#define foreach_mpls_adj_incomplete_next
Definition: mpls_output.c:539
MPLS_ADJ_INCOMPLETE_N_NEXT
@ MPLS_ADJ_INCOMPLETE_N_NEXT
Definition: mpls_output.c:548
DROP
DROP
Definition: error.def:41
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
MPLS_FRAG_NEXT_ICMP_ERROR
@ MPLS_FRAG_NEXT_ICMP_ERROR
Definition: mpls_output.c:382
mpls_error_strings
static char * mpls_error_strings[]
Definition: mpls_output.c:320
MPLS_FRAG_NEXT_REWRITE
@ MPLS_FRAG_NEXT_REWRITE
Definition: mpls_output.c:380
MPLS_FRAG_NEXT_REWRITE_MIDCHAIN
@ MPLS_FRAG_NEXT_REWRITE_MIDCHAIN
Definition: mpls_output.c:381
mpls_frag
static uword mpls_frag(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: mpls_output.c:388
foreach_ip_frag_error
#define foreach_ip_frag_error
Definition: ip_frag.h:60
format_mpls_frag_trace
static u8 * format_mpls_frag_trace(u8 *s, va_list *args)
Definition: mpls_output.c:507
IP_FRAG_N_ERROR
@ IP_FRAG_N_ERROR
Definition: ip_frag.h:76
u32
unsigned int u32
Definition: types.h:88
format_mpls_adj_incomplete_trace
static u8 * format_mpls_adj_incomplete_trace(u8 *s, va_list *args)
Definition: mpls_output.c:630
MPLS_FRAG_NEXT_DROP
@ MPLS_FRAG_NEXT_DROP
Definition: mpls_output.c:383
format_mpls_output_trace
static u8 * format_mpls_output_trace(u8 *s, va_list *args)
Definition: mpls_output.c:47
MPLS_N_ERROR
@ MPLS_N_ERROR
Definition: mpls.h:31
MPLS_FRAG_N_NEXT
@ MPLS_FRAG_N_NEXT
Definition: mpls_output.c:384
MPLS_OUTPUT_N_NEXT
@ MPLS_OUTPUT_N_NEXT
Definition: mpls_output.c:43
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123