FD.io VPP  v17.07.01-10-g3be13f0
Vector Packet Processing
punt.c File Reference

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

+ Include dependency graph for punt.c:

Go to the source code of this file.

Macros

#define foreach_punt_next   _ (PUNT, "error-punt")
 
#define punt_error(n, s)   s,
 

Enumerations

enum  punt_next_t { PUNT_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...
 
static uword udp4_punt (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 IPv4 UDP punt node. More...
 
static uword udp6_punt (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 IPv6 UDP punt node. More...
 
 VLIB_NODE_FUNCTION_MULTIARCH (udp4_punt_node, udp4_punt)
 
 VLIB_NODE_FUNCTION_MULTIARCH (udp6_punt_node, udp6_punt)
 
clib_error_tvnet_punt_add_del (vlib_main_t *vm, u8 ipv, u8 protocol, u16 port, int is_add)
 Request IP traffic punt to the local TCP/IP stack. More...
 
static clib_error_tudp_punt_cli (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

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...
 
static char * punt_error_strings []
 
static vlib_cli_command_t punt_udp_command
 (constructor) VLIB_CLI_COMMAND (punt_udp_command) More...
 

Detailed Description

Local TCP/IP stack punt infrastructure.

Provides a set of VPP nodes togather 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.c.

Macro Definition Documentation

#define foreach_punt_next   _ (PUNT, "error-punt")

Definition at line 29 of file punt.c.

#define punt_error (   n,
 
)    s,

Enumeration Type Documentation

Enumerator
PUNT_N_NEXT 

Definition at line 32 of file punt.c.

Function Documentation

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 54 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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 127 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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 155 of file punt.c.

+ Here is the call graph for this function:

static clib_error_t* udp_punt_cli ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 258 of file punt.c.

+ Here is the call graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( udp4_punt_node  ,
udp4_punt   
)

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( udp6_punt_node  ,
udp6_punt   
)
clib_error_t* vnet_punt_add_del ( vlib_main_t vm,
u8  ipv,
u8  protocol,
u16  port,
int  is_add 
)

Request IP traffic punt to the local TCP/IP stack.

Note

  • UDP is the only protocol supported in the current implementation
  • When requesting UDP punt port number(s) must be specified
  • All TCP traffic is currently punted to the host by default
Parameters
vmvlib_main_t corresponding to the current thread
ipvIP protcol version. 4 - IPv4, 6 - IPv6, ~0 for both IPv6 and IPv4
protocol8-bits L4 protocol value Only value of 17 (UDP) is currently supported
port16-bits L4 (TCP/IP) port number when applicable
Returns
0 on success, non-zero value otherwise

Definition at line 219 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

char* punt_error_strings[]
static
Initial value:
= {
#define punt_error(n,s)
punt_error (NONE, "no error")
punt_error (UDP_PORT, "udp port punt")
}
#define punt_error(n, s)

Definition at line 99 of file punt.c.

vlib_cli_command_t punt_udp_command
static
Initial value:
= {
.path = "set punt udp",
.short_help = "set punt udp [del] <all | port-num1 [port-num2 ...]>",
.function = udp_punt_cli,
}
static clib_error_t * udp_punt_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: punt.c:258

(constructor) VLIB_CLI_COMMAND (punt_udp_command)

Definition at line 310 of file punt.c.

vlib_node_registration_t udp4_punt_node
Initial value:
= {
.function = udp4_punt,
.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 uword udp4_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
IPv4 UDP punt node.
Definition: punt.c:127
unsigned int u32
Definition: types.h:88
static char * punt_error_strings[]
Definition: punt.c:99
#define foreach_punt_next
Definition: punt.c:29

(constructor) VLIB_REGISTER_NODE (udp4_punt_node)

Definition at line 40 of file punt.c.

vlib_node_registration_t udp6_punt_node
Initial value:
= {
.function = udp6_punt,
.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 uword udp6_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
IPv6 UDP punt node.
Definition: punt.c:155
unsigned int u32
Definition: types.h:88
static char * punt_error_strings[]
Definition: punt.c:99
#define foreach_punt_next
Definition: punt.c:29

(constructor) VLIB_REGISTER_NODE (udp6_punt_node)

Definition at line 41 of file punt.c.