FD.io VPP  v19.08-27-gf4dcae4
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

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

Definition at line 47 of file punt_node.c.

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

Definition at line 41 of file punt_node.c.

#define punt_error (   n,
 
)    s,

Definition at line 41 of file punt_node.c.

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

Definition at line 67 of file punt_node.c.

Enumeration Type Documentation

Enumerator
PUNT_N_ERROR 

Definition at line 39 of file punt_node.c.

Enumerator
PUNT_N_NEXT 

Definition at line 51 of file punt_node.c.

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 59 of file punt_node.c.

Function Documentation

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

Definition at line 433 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 498 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 230 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 417 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 425 of file punt_node.c.

+ Here is the call graph for this function:

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 249 of file punt_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 604 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 510 of file punt_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 80 of file punt_node.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 153 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 403 of file punt_node.c.

+ Here is the call graph for this function:

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 181 of file punt_node.c.

+ Here is the call graph for this function:

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

Definition at line 410 of file punt_node.c.

+ Here is the call graph for this function:

Variable Documentation

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,
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:230
static uword exception_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:433
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:296

(constructor) VLIB_REGISTER_NODE (exception_punt_socket_node)

Definition at line 480 of file punt_node.c.

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,
}
static uword ip4_proto_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:417
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:230
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:296

(constructor) VLIB_REGISTER_NODE (ip4_proto_punt_socket_node)

Definition at line 461 of file punt_node.c.

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,
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:230
static uword ip6_proto_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:425
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:296

(constructor) VLIB_REGISTER_NODE (ip6_proto_punt_socket_node)

Definition at line 471 of file punt_node.c.

char* punt_error_strings[]
static
Initial value:
= {
#define punt_error(n,s)
punt_error (NONE, "no error")
punt_error (UDP_PORT, "udp port punt")
punt_error (SOCKET_RX, "Socket RX")
punt_error (SOCKET_TX, "Socket TX")
punt_error (SOCKET_RX_ERROR, "Socket RX error")
punt_error (SOCKET_TX_ERROR, "Socket TX error")
punt_error (NOBUFFER, "buffer allocation failure")
punt_error (READV, "socket read failure")
punt_error (ACTION, "invalid packet descriptor")
}
typedef punt
Full description of which packets are requested to be punted.
Definition: punt.api:75
u16 port
Definition: punt.api:40
#define punt_error(n, s)
Definition: punt_node.c:41

Definition at line 126 of file punt_node.c.

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,
}
static char * punt_error_strings[]
Definition: punt_node.c:126
static u8 * format_punt_trace(u8 *s, va_list *va)
Definition: punt_node.c:498
static uword punt_socket_rx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: punt_node.c:604

(constructor) VLIB_REGISTER_NODE (punt_socket_rx_node)

Definition at line 620 of file punt_node.c.

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)
},
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
#define foreach_punt_next
Definition: punt_node.c:47

(constructor) VLIB_REGISTER_NODE (udp4_punt_node)

Definition at line 189 of file punt_node.c.

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,
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:230
static uword udp4_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:403
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:296

(constructor) VLIB_REGISTER_NODE (udp4_punt_socket_node)

Definition at line 442 of file punt_node.c.

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)
},
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
#define foreach_punt_next
Definition: punt_node.c:47

(constructor) VLIB_REGISTER_NODE (udp6_punt_node)

Definition at line 205 of file punt_node.c.

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,
}
static char * punt_error_strings[]
Definition: punt_node.c:126
unsigned int u32
Definition: types.h:88
static u8 * format_udp_punt_trace(u8 *s, va_list *args)
Definition: punt_node.c:230
#define VLIB_NODE_FLAG_IS_DROP
Definition: node.h:296
static uword udp6_punt_socket(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: punt_node.c:410

(constructor) VLIB_REGISTER_NODE (udp6_punt_socket_node)

Definition at line 452 of file punt_node.c.