29 #define foreach_punt_next \ 30 _ (PUNT, "error-punt") 34 #define _(s,n) PUNT_NEXT_##s, 58 u32 n_left_from, *from, *to_next;
70 while (n_left_from > 0)
76 while (n_left_from > 0 && n_left_to_next > 0)
100 #define punt_error(n,s) s, 164 .name =
"ip4-udp-punt",
166 .vector_size =
sizeof (
u32),
173 #define _(s,n) [PUNT_NEXT_##s] = n, 183 .name =
"ip6-udp-punt",
185 .vector_size =
sizeof (
u32),
192 #define _(s,n) [PUNT_NEXT_##s] = n, 223 if (protocol != IP_PROTOCOL_UDP)
225 "only UDP protocol (%d) is supported, got %d",
226 IP_PROTOCOL_UDP, protocol);
228 if (ipv != (
u8) ~ 0 && ipv != 4 && ipv != 6)
231 if (port == (
u16) ~ 0)
233 if (ipv == 4 || ipv == (
u8) ~ 0)
236 if (ipv == 6 || ipv == (
u8) ~ 0)
244 if (ipv == 4 || ipv == (
u8) ~ 0)
247 if (ipv == 6 || ipv == (
u8) ~ 0)
276 else if (
unformat (input,
"%d", &udp_port))
311 .path =
"set punt udp",
312 .short_help =
"set punt udp [del] <all | port-num1 [port-num2 ...]>",
static uword udp4_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
IPv4 UDP punt node.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
struct _vlib_node_registration vlib_node_registration_t
vlib_error_t * errors
Vector of errors for this node.
static uword udp6_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
IPv6 UDP punt node.
vlib_node_registration_t udp4_punt_node
(constructor) VLIB_REGISTER_NODE (udp4_punt_node)
#define clib_error_return(e, args...)
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.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
void udp_punt_unknown(vlib_main_t *vm, u8 is_ip4, u8 is_add)
Definitions for punt infrastructure.
#define VLIB_CLI_COMMAND(x,...)
VLIB_NODE_FUNCTION_MULTIARCH(udp4_punt_node, udp4_punt)
#define clib_error_report(e)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
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.
static char * punt_error_strings[]
static clib_error_t * udp_punt_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define foreach_punt_next
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define VLIB_REGISTER_NODE(x,...)
void udp_register_dst_port(vlib_main_t *vm, udp_dst_port_t dst_port, u32 node_index, u8 is_ip4)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_node_registration_t udp6_punt_node
(constructor) VLIB_REGISTER_NODE (udp6_punt_node)