FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
punt_node.c File Reference

Local TCP/IP stack punt infrastructure. More...

+ Include dependency graph for punt_node.c:

Go to the source code of this file.

Data Structures

struct  udp_punt_trace_t
 
struct  punt_trace_t
 

Macros

#define punt_error(n, s)   PUNT_ERROR_##n,
 
#define foreach_punt_next
 
#define punt_next_punt(is_ip4)   (is_ip4 ? PUNT_NEXT_PUNT4 : PUNT_NEXT_PUNT6)
 
#define punt_error(n, s)   s,
 

Enumerations

enum  punt_error_t { PUNT_N_ERROR }
 
enum  punt_next_t { PUNT_N_NEXT }
 
enum  punt_socket_rx_next_e { PUNT_SOCKET_RX_NEXT_INTERFACE_OUTPUT, PUNT_SOCKET_RX_NEXT_IP4_LOOKUP, PUNT_SOCKET_RX_NEXT_IP6_LOOKUP, PUNT_SOCKET_RX_N_NEXT }
 

Functions

static uword udp46_punt_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, int is_ip4)
 IPv4/IPv6 UDP punt node main loop. More...
 
VLIB_NODE_FN() udp4_punt_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 IPv4 UDP punt node. More...
 
VLIB_NODE_FN() udp6_punt_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 IPv6 UDP punt node. More...
 
static u8format_udp_punt_trace (u8 *s, va_list *args)
 
static uword punt_socket_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, punt_type_t pt, ip_address_family_t af)
 
static uword udp4_punt_socket (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword udp6_punt_socket (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ip4_proto_punt_socket (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword ip6_proto_punt_socket (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword exception_punt_socket (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static u8format_punt_trace (u8 *s, va_list *va)
 
static uword punt_socket_rx_fd (vlib_main_t *vm, vlib_node_runtime_t *node, u32 fd)
 
static uword punt_socket_rx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * punt_error_strings []
 
vlib_node_registration_t udp4_punt_node
 (constructor) VLIB_REGISTER_NODE (udp4_punt_node) More...
 
vlib_node_registration_t udp6_punt_node
 (constructor) VLIB_REGISTER_NODE (udp6_punt_node) More...
 
vlib_node_registration_t udp4_punt_socket_node
 (constructor) VLIB_REGISTER_NODE (udp4_punt_socket_node) More...
 
vlib_node_registration_t udp6_punt_socket_node
 (constructor) VLIB_REGISTER_NODE (udp6_punt_socket_node) More...
 
vlib_node_registration_t ip4_proto_punt_socket_node
 (constructor) VLIB_REGISTER_NODE (ip4_proto_punt_socket_node) More...
 
vlib_node_registration_t ip6_proto_punt_socket_node
 (constructor) VLIB_REGISTER_NODE (ip6_proto_punt_socket_node) More...
 
vlib_node_registration_t exception_punt_socket_node
 (constructor) VLIB_REGISTER_NODE (exception_punt_socket_node) More...
 
vlib_node_registration_t punt_socket_rx_node
 (constructor) VLIB_REGISTER_NODE (punt_socket_rx_node) More...
 

Detailed Description

Local TCP/IP stack punt infrastructure.

Provides a set of VPP nodes together with the relevant APIs and CLI commands in order to adjust and dispatch packets from the VPP data plane to the local TCP/IP stack

Definition in file punt_node.c.

Macro Definition Documentation

◆ foreach_punt_next

#define foreach_punt_next
Value:
_ (PUNT4, "ip4-punt") \
_ (PUNT6, "ip6-punt")

Definition at line 44 of file punt_node.c.

◆ punt_error [1/2]

#define punt_error (   n,
 
)    PUNT_ERROR_##n,

Definition at line 38 of file punt_node.c.

◆ punt_error [2/2]

#define punt_error (   n,
 
)    s,

Definition at line 38 of file punt_node.c.

◆ punt_next_punt

#define punt_next_punt (   is_ip4)    (is_ip4 ? PUNT_NEXT_PUNT4 : PUNT_NEXT_PUNT6)

Definition at line 64 of file punt_node.c.

Enumeration Type Documentation

◆ punt_error_t

Enumerator
PUNT_N_ERROR 

Definition at line 36 of file punt_node.c.

◆ punt_next_t

Enumerator
PUNT_N_NEXT 

Definition at line 48 of file punt_node.c.

◆ punt_socket_rx_next_e

Enumerator
PUNT_SOCKET_RX_NEXT_INTERFACE_OUTPUT 
PUNT_SOCKET_RX_NEXT_IP4_LOOKUP 
PUNT_SOCKET_RX_NEXT_IP6_LOOKUP 
PUNT_SOCKET_RX_N_NEXT 

Definition at line 56 of file punt_node.c.

Function Documentation

◆ exception_punt_socket()

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

Definition at line 430 of file punt_node.c.

+ Here is the call graph for this function:

◆ format_punt_trace()

static u8* format_punt_trace ( u8 s,
va_list *  va 
)
static

Definition at line 495 of file punt_node.c.

+ Here is the call graph for this function:

◆ format_udp_punt_trace()

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

Definition at line 227 of file punt_node.c.

+ Here is the call graph for this function:

◆ ip4_proto_punt_socket()

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

Definition at line 414 of file punt_node.c.

+ Here is the call graph for this function:

◆ ip6_proto_punt_socket()

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

Definition at line 422 of file punt_node.c.

+ Here is the call graph for this function:

◆ punt_socket_inline()

static uword punt_socket_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
punt_type_t  pt,
ip_address_family_t  af 
)
inlinestatic

VLIB buffer chain -> Unix iovec(s).

Definition at line 246 of file punt_node.c.

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

◆ punt_socket_rx()

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

Definition at line 602 of file punt_node.c.

+ Here is the call graph for this function:

◆ punt_socket_rx_fd()

static uword punt_socket_rx_fd ( vlib_main_t vm,
vlib_node_runtime_t node,
u32  fd 
)
static

Definition at line 507 of file punt_node.c.

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

◆ udp46_punt_inline()

static uword udp46_punt_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
int  is_ip4 
)
inlinestatic

IPv4/IPv6 UDP punt node main loop.

This is the main loop inline function for IPv4/IPv6 UDP punt transition node.

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
framevlib_frame_t whose contents should be dispatched
is_ipv4indicates if called for IPv4 or IPv6 node

Definition at line 77 of file punt_node.c.

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

◆ udp4_punt_node()

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

IPv4 UDP punt node.

Node Identifier:
ip4-udp-punt

This is the IPv4 UDP punt transition node. It is registered as a next node for the "ip4-udp-lookup" handling UDP port(s) requested for punt. The buffer's current data pointer is adjusted to the original packet IPv4 header. All buffers are dispatched to "error-punt".

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
framevlib_frame_t whose contents should be dispatched
Graph mechanics: next index usage

Sets:

Next Index:

  • Dispatches the packet to the "error-punt" node

Definition at line 150 of file punt_node.c.

+ Here is the call graph for this function:

◆ udp4_punt_socket()

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

Definition at line 400 of file punt_node.c.

+ Here is the call graph for this function:

◆ udp6_punt_node()

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

IPv6 UDP punt node.

Node Identifier:
ip6-udp-punt

This is the IPv6 UDP punt transition node. It is registered as a next node for the "ip6-udp-lookup" handling UDP port(s) requested for punt. The buffer's current data pointer is adjusted to the original packet IPv6 header. All buffers are dispatched to "error-punt".

Parameters
vmvlib_main_t corresponding to the current thread
nodevlib_node_runtime_t
framevlib_frame_t whose contents should be dispatched
Graph mechanics: next index usage

Sets:

Next Index:

  • Dispatches the packet to the "error-punt" node

Definition at line 178 of file punt_node.c.

+ Here is the call graph for this function:

◆ udp6_punt_socket()

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

Definition at line 407 of file punt_node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ exception_punt_socket_node

vlib_node_registration_t exception_punt_socket_node
Initial value:
= {
.function = exception_punt_socket,
.name = "exception-punt-socket",
.format_trace = format_udp_punt_trace,
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
}

(constructor) VLIB_REGISTER_NODE (exception_punt_socket_node)

Definition at line 477 of file punt_node.c.

◆ ip4_proto_punt_socket_node

vlib_node_registration_t ip4_proto_punt_socket_node
Initial value:
= {
.function = ip4_proto_punt_socket,
.name = "ip4-proto-punt-socket",
.format_trace = format_udp_punt_trace,
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
}

(constructor) VLIB_REGISTER_NODE (ip4_proto_punt_socket_node)

Definition at line 458 of file punt_node.c.

◆ ip6_proto_punt_socket_node

vlib_node_registration_t ip6_proto_punt_socket_node
Initial value:
= {
.function = ip6_proto_punt_socket,
.name = "ip6-proto-punt-socket",
.format_trace = format_udp_punt_trace,
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
}

(constructor) VLIB_REGISTER_NODE (ip6_proto_punt_socket_node)

Definition at line 468 of file punt_node.c.

◆ punt_error_strings

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

Definition at line 123 of file punt_node.c.

◆ punt_socket_rx_node

vlib_node_registration_t punt_socket_rx_node
Initial value:
=
{
.function = punt_socket_rx,
.name = "punt-socket-rx",
.state = VLIB_NODE_STATE_INTERRUPT,
.vector_size = 1,
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
.n_next_nodes = PUNT_SOCKET_RX_N_NEXT,
.next_nodes = {
[PUNT_SOCKET_RX_NEXT_INTERFACE_OUTPUT] = "interface-output",
},
.format_trace = format_punt_trace,
}

(constructor) VLIB_REGISTER_NODE (punt_socket_rx_node)

Definition at line 618 of file punt_node.c.

◆ udp4_punt_node

vlib_node_registration_t udp4_punt_node
Initial value:
= {
.name = "ip4-udp-punt",
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
.n_next_nodes = PUNT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (udp4_punt_node)

Definition at line 186 of file punt_node.c.

◆ udp4_punt_socket_node

vlib_node_registration_t udp4_punt_socket_node
Initial value:
= {
.function = udp4_punt_socket,
.name = "ip4-udp-punt-socket",
.format_trace = format_udp_punt_trace,
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
}

(constructor) VLIB_REGISTER_NODE (udp4_punt_socket_node)

Definition at line 439 of file punt_node.c.

◆ udp6_punt_node

vlib_node_registration_t udp6_punt_node
Initial value:
= {
.name = "ip6-udp-punt",
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
.n_next_nodes = PUNT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}

(constructor) VLIB_REGISTER_NODE (udp6_punt_node)

Definition at line 202 of file punt_node.c.

◆ udp6_punt_socket_node

vlib_node_registration_t udp6_punt_socket_node
Initial value:
= {
.function = udp6_punt_socket,
.name = "ip6-udp-punt-socket",
.format_trace = format_udp_punt_trace,
.vector_size = sizeof (u32),
.n_errors = PUNT_N_ERROR,
.error_strings = punt_error_strings,
}

(constructor) VLIB_REGISTER_NODE (udp6_punt_socket_node)

Definition at line 449 of file punt_node.c.

punt_socket_rx
static uword punt_socket_rx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: punt_node.c:602
format_udp_punt_trace
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:227
PUNT_SOCKET_RX_N_NEXT
@ PUNT_SOCKET_RX_N_NEXT
Definition: punt_node.c:61
PUNT_SOCKET_RX_NEXT_IP4_LOOKUP
@ PUNT_SOCKET_RX_NEXT_IP4_LOOKUP
Definition: punt_node.c:59
VLIB_NODE_TYPE_INPUT
@ VLIB_NODE_TYPE_INPUT
Definition: node.h:76
udp6_punt_socket
static uword udp6_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:407
PUNT_N_ERROR
@ PUNT_N_ERROR
Definition: punt_node.c:41
foreach_punt_next
#define foreach_punt_next
Definition: punt_node.c:44
format_punt_trace
static u8 * format_punt_trace(u8 *s, va_list *va)
Definition: punt_node.c:495
ip6_proto_punt_socket
static uword ip6_proto_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:422
exception_punt_socket
static uword exception_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:430
udp4_punt_socket
static uword udp4_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:400
VLIB_NODE_FLAG_TRACE_SUPPORTED
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
Definition: node.h:295
VLIB_NODE_FLAG_IS_DROP
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:286
PUNT_N_NEXT
@ PUNT_N_NEXT
Definition: punt_node.c:53
ip4_proto_punt_socket
static uword ip4_proto_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:414
punt_error_strings
static char * punt_error_strings[]
Definition: punt_node.c:123
PUNT_SOCKET_RX_NEXT_IP6_LOOKUP
@ PUNT_SOCKET_RX_NEXT_IP6_LOOKUP
Definition: punt_node.c:60
u32
unsigned int u32
Definition: types.h:88
PUNT_SOCKET_RX_NEXT_INTERFACE_OUTPUT
@ PUNT_SOCKET_RX_NEXT_INTERFACE_OUTPUT
Definition: punt_node.c:58