FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  lb_trace_t
 
struct  lb_nodeport_trace_t
 
struct  lb_nat_trace_t
 

Macros

#define foreach_lb_error
 

Enumerations

enum  lb_error_t { LB_N_ERROR }
 

Functions

u8format_lb_trace (u8 *s, va_list *args)
 
u8format_lb_nat_trace (u8 *s, va_list *args)
 
lb_hash_tlb_get_sticky_table (u32 thread_index)
 
u64 lb_node_get_other_ports4 (ip4_header_t *ip40)
 
u64 lb_node_get_other_ports6 (ip6_header_t *ip60)
 
static_always_inline u32 lb_node_get_hash (vlib_buffer_t *p, u8 is_input_v4)
 
static_always_inline uword lb_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_input_v4, lb_encap_type_t encap_type)
 
u8format_nodeport_lb_trace (u8 *s, va_list *args)
 
static uword lb_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_input_v4)
 
int lb_nat44_mapping_match (lb_main_t *lbm, lb_snat4_key_t *match, u32 *index)
 Match NAT44 static mapping. More...
 
int lb_nat66_mapping_match (lb_main_t *lbm, lb_snat6_key_t *match, u32 *index)
 Match NAT66 static mapping. More...
 
static uword lb_nat_in2out_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 is_nat4)
 
static uword lb6_gre6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb6_gre4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb4_gre6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb4_gre4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb4_l3dsr_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb6_nat6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb4_nat4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb_nat4_in2out_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb_nat6_in2out_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb4_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword lb6_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (lb_nat4_in2out_node_fn, static)
 
 VNET_FEATURE_INIT (lb_nat6_in2out_node_fn, static)
 

Variables

static char * lb_error_strings []
 
vlib_node_registration_t lb6_gre6_node
 (constructor) VLIB_REGISTER_NODE (lb6_gre6_node) More...
 
vlib_node_registration_t lb6_gre4_node
 (constructor) VLIB_REGISTER_NODE (lb6_gre4_node) More...
 
vlib_node_registration_t lb4_gre6_node
 (constructor) VLIB_REGISTER_NODE (lb4_gre6_node) More...
 
vlib_node_registration_t lb4_gre4_node
 (constructor) VLIB_REGISTER_NODE (lb4_gre4_node) More...
 
vlib_node_registration_t lb4_l3dsr_node
 (constructor) VLIB_REGISTER_NODE (lb4_l3dsr_node) More...
 
vlib_node_registration_t lb6_nat6_node
 (constructor) VLIB_REGISTER_NODE (lb6_nat6_node) More...
 
vlib_node_registration_t lb4_nat4_node
 (constructor) VLIB_REGISTER_NODE (lb4_nat4_node) More...
 
vlib_node_registration_t lb4_nodeport_node
 (constructor) VLIB_REGISTER_NODE (lb4_nodeport_node) More...
 
vlib_node_registration_t lb6_nodeport_node
 (constructor) VLIB_REGISTER_NODE (lb6_nodeport_node) More...
 
vlib_node_registration_t lb_nat4_in2out_node
 (constructor) VLIB_REGISTER_NODE (lb_nat4_in2out_node) More...
 
vlib_node_registration_t lb_nat6_in2out_node
 (constructor) VLIB_REGISTER_NODE (lb_nat6_in2out_node) More...
 

Macro Definition Documentation

#define foreach_lb_error
Value:
_(NONE, "no error") \
_(PROTO_NOT_SUPPORTED, "protocol not supported")

Definition at line 22 of file node.c.

Enumeration Type Documentation

enum lb_error_t
Enumerator
LB_N_ERROR 

Definition at line 26 of file node.c.

Function Documentation

u8* format_lb_nat_trace ( u8 s,
va_list *  args 
)

Definition at line 93 of file node.c.

+ Here is the call graph for this function:

u8* format_lb_trace ( u8 s,
va_list *  args 
)

Definition at line 63 of file node.c.

+ Here is the call graph for this function:

u8* format_nodeport_lb_trace ( u8 s,
va_list *  args 
)

Definition at line 511 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 908 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 901 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 915 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 929 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 1040 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 894 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 887 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 922 of file node.c.

+ Here is the call graph for this function:

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

Definition at line 1047 of file node.c.

+ Here is the call graph for this function:

lb_hash_t* lb_get_sticky_table ( u32  thread_index)

Definition at line 127 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int lb_nat44_mapping_match ( lb_main_t lbm,
lb_snat4_key_t match,
u32 index 
)

Match NAT44 static mapping.

Parameters
smNAT main.
matchAddress and port to match.
indexindex to the pool.
Returns
0 if match found, otherwise -1.

Definition at line 632 of file node.c.

+ Here is the caller graph for this function:

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

Definition at line 936 of file node.c.

+ Here is the call graph for this function:

int lb_nat66_mapping_match ( lb_main_t lbm,
lb_snat6_key_t match,
u32 index 
)

Match NAT66 static mapping.

Parameters
smNAT main.
matchAddress and port to match.
mappingExternal or local address and port of the matched mapping.
Returns
0 if match found otherwise 1.

Definition at line 658 of file node.c.

+ Here is the caller graph for this function:

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

Definition at line 943 of file node.c.

+ Here is the call graph for this function:

static uword lb_nat_in2out_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u32  is_nat4 
)
static

Definition at line 684 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword lb_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u8  is_input_v4,
lb_encap_type_t  encap_type 
)

Definition at line 217 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline u32 lb_node_get_hash ( vlib_buffer_t p,
u8  is_input_v4 
)

Definition at line 177 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u64 lb_node_get_other_ports4 ( ip4_header_t ip40)

Definition at line 165 of file node.c.

+ Here is the caller graph for this function:

u64 lb_node_get_other_ports6 ( ip6_header_t ip60)

Definition at line 171 of file node.c.

+ Here is the caller graph for this function:

static uword lb_nodeport_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u8  is_input_v4 
)
static

Definition at line 535 of file node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_FEATURE_INIT ( lb_nat4_in2out_node_fn  ,
static   
)
VNET_FEATURE_INIT ( lb_nat6_in2out_node_fn  ,
static   
)

Variable Documentation

vlib_node_registration_t lb4_gre4_node
Initial value:
=
{
.function = lb4_gre4_node_fn,
.name = "lb4-gre4",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
Definition: lb.h:52
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34
static uword lb4_gre4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:908

(constructor) VLIB_REGISTER_NODE (lb4_gre4_node)

Definition at line 987 of file node.c.

vlib_node_registration_t lb4_gre6_node
Initial value:
=
{
.function = lb4_gre6_node_fn,
.name = "lb4-gre6",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
Definition: lb.h:52
static uword lb4_gre6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:901
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb4_gre6_node)

Definition at line 974 of file node.c.

vlib_node_registration_t lb4_l3dsr_node
Initial value:
=
{
.function = lb4_l3dsr_node_fn,
.name = "lb4-l3dsr",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
static uword lb4_l3dsr_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:915
Definition: lb.h:52
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb4_l3dsr_node)

Definition at line 1000 of file node.c.

vlib_node_registration_t lb4_nat4_node
Initial value:
=
{
.function = lb4_nat4_node_fn,
.name = "lb4-nat4",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
Definition: lb.h:52
static uword lb4_nat4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:929
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb4_nat4_node)

Definition at line 1026 of file node.c.

vlib_node_registration_t lb4_nodeport_node
Initial value:
=
{
.function = lb4_nodeport_node_fn,
.name = "lb4-nodeport",
.vector_size = sizeof(u32),
.format_trace = format_nodeport_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB4_NODEPORT_N_NEXT,
.next_nodes =
{
[LB4_NODEPORT_NEXT_DROP] = "error-drop",
},
}
static uword lb4_nodeport_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:1040
u8 * format_nodeport_lb_trace(u8 *s, va_list *args)
Definition: node.c:511
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb4_nodeport_node)

Definition at line 1053 of file node.c.

vlib_node_registration_t lb6_gre4_node
Initial value:
=
{
.function = lb6_gre4_node_fn,
.name = "lb6-gre4",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
static uword lb6_gre4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:894
Definition: lb.h:52
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb6_gre4_node)

Definition at line 961 of file node.c.

vlib_node_registration_t lb6_gre6_node
Initial value:
=
{
.function = lb6_gre6_node_fn,
.name = "lb6-gre6",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR, .error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
Definition: lb.h:52
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34
static uword lb6_gre6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:887

(constructor) VLIB_REGISTER_NODE (lb6_gre6_node)

Definition at line 949 of file node.c.

vlib_node_registration_t lb6_nat6_node
Initial value:
=
{
.function = lb6_nat6_node_fn,
.name = "lb6-nat6",
.vector_size = sizeof(u32),
.format_trace = format_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_N_NEXT,
.next_nodes =
{ [LB_NEXT_DROP] = "error-drop" },
}
u8 * format_lb_trace(u8 *s, va_list *args)
Definition: node.c:63
Definition: lb.h:52
static uword lb6_nat6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:922
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb6_nat6_node)

Definition at line 1013 of file node.c.

vlib_node_registration_t lb6_nodeport_node
Initial value:
=
{
.function = lb6_nodeport_node_fn,
.name = "lb6-nodeport",
.vector_size = sizeof(u32),
.format_trace = format_nodeport_lb_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB6_NODEPORT_N_NEXT,
.next_nodes =
{
[LB6_NODEPORT_NEXT_DROP] = "error-drop",
},
}
u8 * format_nodeport_lb_trace(u8 *s, va_list *args)
Definition: node.c:511
unsigned int u32
Definition: types.h:88
static char * lb_error_strings[]
Definition: node.c:34
static uword lb6_nodeport_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:1047

(constructor) VLIB_REGISTER_NODE (lb6_nodeport_node)

Definition at line 1069 of file node.c.

char* lb_error_strings[]
static
Initial value:
=
{
#define _(sym,string)
}
#define foreach_lb_error
Definition: node.c:22

Definition at line 34 of file node.c.

vlib_node_registration_t lb_nat4_in2out_node
Initial value:
=
{
.name = "lb-nat4-in2out",
.vector_size = sizeof(u32),
.format_trace = format_lb_nat_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_NAT4_IN2OUT_N_NEXT,
.next_nodes =
{
[LB_NAT4_IN2OUT_NEXT_DROP] = "error-drop",
[LB_NAT4_IN2OUT_NEXT_LOOKUP] = "ip4-lookup",
},
}
unsigned int u32
Definition: types.h:88
u8 * format_lb_nat_trace(u8 *s, va_list *args)
Definition: node.c:93
static uword lb_nat4_in2out_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:936
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb_nat4_in2out_node)

Definition at line 1092 of file node.c.

vlib_node_registration_t lb_nat6_in2out_node
Initial value:
=
{
.name = "lb-nat6-in2out",
.vector_size = sizeof(u32),
.format_trace = format_lb_nat_trace,
.n_errors = LB_N_ERROR,
.error_strings = lb_error_strings,
.n_next_nodes = LB_NAT6_IN2OUT_N_NEXT,
.next_nodes =
{
[LB_NAT6_IN2OUT_NEXT_DROP] = "error-drop",
[LB_NAT6_IN2OUT_NEXT_LOOKUP] = "ip6-lookup",
},
}
static uword lb_nat6_in2out_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:943
unsigned int u32
Definition: types.h:88
u8 * format_lb_nat_trace(u8 *s, va_list *args)
Definition: node.c:93
static char * lb_error_strings[]
Definition: node.c:34

(constructor) VLIB_REGISTER_NODE (lb_nat6_in2out_node)

Definition at line 1115 of file node.c.