24 .arc_name =
"ip4-punt",
30 .arc_name =
"ip4-drop",
37 #ifndef CLIB_MARCH_VARIANT 55 #define _(sym,string) string, 65 vnet_feat_arc_ip4_punt.feature_arc_index,
71 .name =
"ip4-punt-policer",
72 .vector_size =
sizeof (
u32),
84 .arc_name =
"ip4-punt",
85 .node_name =
"ip4-punt-policer",
91 #define foreach_ip4_punt_redirect_error \ 92 _(DROP, "ip4 punt redirect drop") 96 #define _(sym,str) IP4_PUNT_REDIRECT_ERROR_##sym, 103 #define _(sym,string) string, 113 vnet_feat_arc_ip4_punt.feature_arc_index,
119 .name =
"ip4-punt-redirect",
120 .vector_size =
sizeof (
u32),
135 .arc_name =
"ip4-punt",
136 .node_name =
"ip4-punt-redirect",
148 vnet_feat_arc_ip4_drop.feature_arc_index);
160 vnet_feat_arc_ip4_drop.feature_arc_index);
170 vnet_feat_arc_ip4_punt.feature_arc_index);
177 .vector_size =
sizeof (
u32),
187 .name =
"ip4-not-enabled",
188 .vector_size =
sizeof (
u32),
190 .sibling_of =
"ip4-drop",
197 .vector_size =
sizeof (
u32),
206 .arc_name =
"ip4-punt",
207 .node_name =
"error-punt",
212 .arc_name =
"ip4-drop",
213 .node_name =
"error-drop",
218 #ifndef CLIB_MARCH_VARIANT 246 if (
unformat (line_input,
"%d", &policer_index))
248 else if (
unformat (line_input,
"del"))
250 else if (
unformat (line_input,
"add"))
259 if (is_add && ~0 == policer_index)
283 .path =
"ip punt policer",
285 .short_help =
"ip punt policer [add|del] <index>",
289 #ifndef CLIB_MARCH_VARIANT 340 u32 rx_sw_if_index = ~0;
354 else if (
unformat (line_input,
"add"))
356 else if (
unformat (line_input,
"rx all"))
358 else if (
unformat (line_input,
"rx %U",
361 else if (
unformat (line_input,
"via %U",
371 if (~0 == rx_sw_if_index)
400 .path =
"ip punt redirect",
402 .short_help =
"ip punt redirect [add|del] rx [<interface>|all] via [<nh>] <tx_interface>",
424 .path =
"show ip punt redirect",
426 .short_help =
"show ip punt redirect",
A representation of a path as described by a route producer.
static clib_error_t * ip4_punt_redirect_show_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
vnet_main_t * vnet_get_main(void)
ip4_punt_redirect_error_t
uword unformat_fib_route_path(unformat_input_t *input, va_list *args)
Unformat a fib_route_path_t from CLI input.
vlib_node_registration_t ip4_drop_node
(constructor) VLIB_REGISTER_NODE (ip4_drop_node)
u8 * format_ip_punt_redirect_trace(u8 *s, va_list *args)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static uword ip_drop_or_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index)
Contribute an object that is to be used to forward IP4 packets.
unformat_function_t unformat_vnet_sw_interface
#define VLIB_NODE_FN(node)
void ip_punt_redirect_add(fib_protocol_t fproto, u32 rx_sw_if_index, fib_forward_chain_type_t ct, fib_route_path_t *rpaths)
Add a punt redirect entry.
void ip4_punt_policer_add_del(u8 is_add, u32 policer_index)
#define foreach_ip4_punt_redirect_error
u8 * format_ip_punt_redirect(u8 *s, va_list *args)
vlib_node_registration_t ip4_punt_policer_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_policer_node)
vlib_node_registration_t ip4_not_enabled_node
(constructor) VLIB_REGISTER_NODE (ip4_not_enabled_node)
ip_punt_policer_t ip4_punt_policer_cfg
#define clib_error_return(e, args...)
#define foreach_ip_punt_policer_error
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
static char * ip4_punt_redirect_error_strings[]
static uword ip_punt_policer(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, u32 policer_index)
IP punt policing node function.
u8 * format_ip_punt_policer_trace(u8 *s, va_list *args)
static char * ip4_punt_policer_error_strings[]
static clib_error_t * ip4_punt_redirect_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
vlib_node_registration_t ip4_punt_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_node)
#define VLIB_REGISTER_NODE(x,...)
#define vec_free(V)
Free vector's memory (no header).
vlib_node_registration_t ip4_punt_redirect_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_redirect_node)
VNET_FEATURE_INIT(ip4_punt_policer_node)
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
vl_api_interface_index_t tx_sw_if_index
static uword ip4_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
IP4 punt policer configuration we police the punt rate to prevent overloading the host...
static clib_error_t * ip4_punt_police_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
void ip4_punt_redirect_del(u32 rx_sw_if_index)
#define VNET_FEATURES(...)
static uword ip_punt_redirect(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, fib_protocol_t fproto)
void ip_punt_redirect_del(fib_protocol_t fproto, u32 rx_sw_if_index)
void ip4_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u16 flags
Copy of main node flags.
void ip4_punt_redirect_add_paths(u32 rx_sw_if_index, fib_route_path_t *rpaths)
#define VLIB_NODE_FLAG_TRACE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
VNET_FEATURE_ARC_INIT(ip4_punt)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)