FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
kp_node.c File Reference
+ Include dependency graph for kp_node.c:

Go to the source code of this file.

Data Structures

struct  kp_trace_t
 
struct  kp_nodeport_trace_t
 
struct  kp_nat_trace_t
 

Macros

#define foreach_kp_error
 

Enumerations

enum  kp_error_t { KP_N_ERROR }
 

Functions

u8format_kp_trace (u8 *s, va_list *args)
 
u8format_kp_nat_trace (u8 *s, va_list *args)
 
kp_hash_tkp_get_sticky_table (u32 thread_index)
 
u64 kp_node_get_other_ports4 (ip4_header_t *ip40)
 
u64 kp_node_get_other_ports6 (ip6_header_t *ip60)
 
static_always_inline u32 kp_node_get_hash (vlib_buffer_t *p, u8 is_input_v4)
 
static_always_inline uword kp_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_input_v4, u8 is_nat_v4)
 
u8format_nodeport_kp_trace (u8 *s, va_list *args)
 
static uword kp_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_input_v4)
 
int kp_nat4_mapping_match (kp_main_t *kpm, kp_snat4_key_t match, kp_snat4_key_t *mapping)
 Match NAT4 static mapping. More...
 
static uword kp_nat4_in2out_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp6_nat6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp6_nat4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp4_nat6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp4_nat4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp4_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword kp6_nodeport_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (kp_nat4_in2out_node_fn, static)
 

Variables

static char * kp_error_strings []
 
vlib_node_registration_t kp6_nat6_node
 (constructor) VLIB_REGISTER_NODE (kp6_nat6_node) More...
 
vlib_node_registration_t kp6_nat4_node
 (constructor) VLIB_REGISTER_NODE (kp6_nat4_node) More...
 
vlib_node_registration_t kp4_nat6_node
 (constructor) VLIB_REGISTER_NODE (kp4_nat6_node) More...
 
vlib_node_registration_t kp4_nat4_node
 (constructor) VLIB_REGISTER_NODE (kp4_nat4_node) More...
 
vlib_node_registration_t kp4_nodeport_node
 (constructor) VLIB_REGISTER_NODE (kp4_nodeport_node) More...
 
vlib_node_registration_t kp6_nodeport_node
 (constructor) VLIB_REGISTER_NODE (kp6_nodeport_node) More...
 
vlib_node_registration_t kp_nat4_in2out_node
 (constructor) VLIB_REGISTER_NODE (kp_nat4_in2out_node) More...
 

Macro Definition Documentation

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

Definition at line 22 of file kp_node.c.

Enumeration Type Documentation

enum kp_error_t
Enumerator
KP_N_ERROR 

Definition at line 26 of file kp_node.c.

Function Documentation

u8* format_kp_nat_trace ( u8 s,
va_list *  args 
)

Definition at line 75 of file kp_node.c.

+ Here is the call graph for this function:

u8* format_kp_trace ( u8 s,
va_list *  args 
)

Definition at line 55 of file kp_node.c.

+ Here is the call graph for this function:

u8* format_nodeport_kp_trace ( u8 s,
va_list *  args 
)

Definition at line 348 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 684 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 677 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 759 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 670 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 663 of file kp_node.c.

+ Here is the call graph for this function:

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

Definition at line 767 of file kp_node.c.

+ Here is the call graph for this function:

kp_hash_t* kp_get_sticky_table ( u32  thread_index)

Definition at line 87 of file kp_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 515 of file kp_node.c.

+ Here is the call graph for this function:

int kp_nat4_mapping_match ( kp_main_t kpm,
kp_snat4_key_t  match,
kp_snat4_key_t mapping 
)

Match NAT4 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 473 of file kp_node.c.

+ Here is the caller graph for this function:

static_always_inline uword kp_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
u8  is_input_v4,
u8  is_nat_v4 
)

Definition at line 173 of file kp_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline u32 kp_node_get_hash ( vlib_buffer_t p,
u8  is_input_v4 
)

Definition at line 133 of file kp_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u64 kp_node_get_other_ports4 ( ip4_header_t ip40)

Definition at line 121 of file kp_node.c.

+ Here is the caller graph for this function:

u64 kp_node_get_other_ports6 ( ip6_header_t ip60)

Definition at line 127 of file kp_node.c.

+ Here is the caller graph for this function:

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

Definition at line 365 of file kp_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_FEATURE_INIT ( kp_nat4_in2out_node_fn  ,
static   
)

Variable Documentation

vlib_node_registration_t kp4_nat4_node
Initial value:
=
{
.function = kp4_nat4_node_fn,
.name = "kp4-nat4",
.vector_size = sizeof (u32),
.format_trace = format_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_N_NEXT,
.next_nodes =
{
[KP_NEXT_DROP] = "error-drop"
},
}
static char * kp_error_strings[]
Definition: kp_node.c:33
u8 * format_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:55
unsigned int u32
Definition: types.h:88
Definition: kp.h:49
static uword kp4_nat4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:684

(constructor) VLIB_REGISTER_NODE (kp4_nat4_node)

Definition at line 741 of file kp_node.c.

vlib_node_registration_t kp4_nat6_node
Initial value:
=
{
.function = kp4_nat6_node_fn,
.name = "kp4-nat6",
.vector_size = sizeof (u32),
.format_trace = format_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_N_NEXT,
.next_nodes =
{
[KP_NEXT_DROP] = "error-drop"
},
}
static uword kp4_nat6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:677
static char * kp_error_strings[]
Definition: kp_node.c:33
u8 * format_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:55
unsigned int u32
Definition: types.h:88
Definition: kp.h:49

(constructor) VLIB_REGISTER_NODE (kp4_nat6_node)

Definition at line 724 of file kp_node.c.

vlib_node_registration_t kp4_nodeport_node
Initial value:
=
{
.function = kp4_nodeport_node_fn,
.name = "kp4-nodeport",
.vector_size = sizeof (u32),
.format_trace = format_nodeport_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_NODEPORT_N_NEXT,
.next_nodes =
{
[KP_NODEPORT_NEXT_IP4_NAT4] = "kp4-nat4",
[KP_NODEPORT_NEXT_IP4_NAT6] = "kp4-nat6",
[KP_NODEPORT_NEXT_IP6_NAT4] = "kp6-nat4",
[KP_NODEPORT_NEXT_IP6_NAT6] = "kp6-nat6",
[KP_NODEPORT_NEXT_DROP] = "error-drop",
},
}
static uword kp4_nodeport_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:759
u8 * format_nodeport_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:348
static char * kp_error_strings[]
Definition: kp_node.c:33
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (kp4_nodeport_node)

Definition at line 774 of file kp_node.c.

vlib_node_registration_t kp6_nat4_node
Initial value:
=
{
.function = kp6_nat4_node_fn,
.name = "kp6-nat4",
.vector_size = sizeof (u32),
.format_trace = format_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_N_NEXT,
.next_nodes =
{
[KP_NEXT_DROP] = "error-drop"
},
}
static char * kp_error_strings[]
Definition: kp_node.c:33
u8 * format_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:55
unsigned int u32
Definition: types.h:88
static uword kp6_nat4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:670
Definition: kp.h:49

(constructor) VLIB_REGISTER_NODE (kp6_nat4_node)

Definition at line 707 of file kp_node.c.

vlib_node_registration_t kp6_nat6_node
Initial value:
=
{
.function = kp6_nat6_node_fn,
.name = "kp6-nat6",
.vector_size = sizeof (u32),
.format_trace = format_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_N_NEXT,
.next_nodes =
{
[KP_NEXT_DROP] = "error-drop"
},
}
static char * kp_error_strings[]
Definition: kp_node.c:33
u8 * format_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:55
unsigned int u32
Definition: types.h:88
static uword kp6_nat6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:663
Definition: kp.h:49

(constructor) VLIB_REGISTER_NODE (kp6_nat6_node)

Definition at line 690 of file kp_node.c.

vlib_node_registration_t kp6_nodeport_node
Initial value:
=
{
.function = kp6_nodeport_node_fn,
.name = "kp6-nodeport",
.vector_size = sizeof (u32),
.format_trace = format_nodeport_kp_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_NODEPORT_N_NEXT,
.next_nodes =
{
[KP_NODEPORT_NEXT_IP4_NAT4] = "kp4-nat4",
[KP_NODEPORT_NEXT_IP4_NAT6] = "kp4-nat6",
[KP_NODEPORT_NEXT_IP6_NAT4] = "kp6-nat4",
[KP_NODEPORT_NEXT_IP6_NAT6] = "kp6-nat6",
[KP_NODEPORT_NEXT_DROP] = "error-drop",
},
}
u8 * format_nodeport_kp_trace(u8 *s, va_list *args)
Definition: kp_node.c:348
static char * kp_error_strings[]
Definition: kp_node.c:33
unsigned int u32
Definition: types.h:88
static uword kp6_nodeport_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:767

(constructor) VLIB_REGISTER_NODE (kp6_nodeport_node)

Definition at line 795 of file kp_node.c.

char* kp_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_kp_error
Definition: kp_node.c:22

Definition at line 33 of file kp_node.c.

vlib_node_registration_t kp_nat4_in2out_node
Initial value:
=
{
.name = "kp-nat4-in2out",
.vector_size = sizeof (u32),
.format_trace = format_kp_nat_trace,
.n_errors = KP_N_ERROR,
.error_strings = kp_error_strings,
.n_next_nodes = KP_NAT4_IN2OUT_N_NEXT,
.next_nodes =
{
[KP_NAT4_IN2OUT_NEXT_DROP] = "error-drop",
[KP_NAT4_IN2OUT_NEXT_LOOKUP] = "ip4-lookup",
},
}
static uword kp_nat4_in2out_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: kp_node.c:515
u8 * format_kp_nat_trace(u8 *s, va_list *args)
Definition: kp_node.c:75
static char * kp_error_strings[]
Definition: kp_node.c:33
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (kp_nat4_in2out_node)

Definition at line 823 of file kp_node.c.