37 [URPF_MODE_STRICT] =
"ip4-rx-urpf-strict",
38 [URPF_MODE_LOOSE] =
"ip4-rx-urpf-loose",
41 [URPF_MODE_STRICT] =
"ip4-tx-urpf-strict",
42 [URPF_MODE_LOOSE] =
"ip4-tx-urpf-loose",
47 [URPF_MODE_STRICT] =
"ip6-rx-urpf-strict",
48 [URPF_MODE_LOOSE] =
"ip6-rx-urpf-loose",
51 [URPF_MODE_STRICT] =
"ip6-tx-urpf-strict",
52 [URPF_MODE_LOOSE] =
"ip6-tx-urpf-loose",
72 return (format (s, "%s", b)); 77 return (
format (s,
"unknown"));
88 else if (unformat (input, b)) \ 90 *mode = URPF_MODE_##a; \ 109 if (URPF_MODE_OFF != old)
113 sw_if_index, 0, 0, 0);
115 if (URPF_MODE_OFF != mode)
119 sw_if_index, 1, 0, 0);
141 mode = URPF_MODE_STRICT;
164 if (~0 == sw_if_index)
236 .short_help =
"set urpf [ip4|ip6] [rx|tx] [off|strict|loose] <INTERFACE>",
259 if (
unformat (line_input,
"table %d", &table_id))
261 else if (
unformat (line_input,
"del"))
263 else if (
unformat (line_input,
"add"))
311 .path =
"set urpf-accept",
313 .short_help =
"urpf-accept [table <table-id>] [add|del] <PREFIX>",
static const char * urpf_feats[N_AF][VLIB_N_DIR][URPF_N_MODES]
fib_protocol_t fp_proto
protocol type
void ip_prefix_to_fib_prefix(const ip_prefix_t *ip_prefix, fib_prefix_t *fib_prefix)
convert from a LISP to a FIB prefix
vnet_main_t * vnet_get_main(void)
unformat_function_t unformat_vnet_sw_interface
static const char * urpf_feat_arcs[N_AF][VLIB_N_DIR]
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
Aggregate type for a prefix.
#define clib_error_return(e, args...)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
static urpf_mode_t * urpf_cfgs[N_AF][VLIB_N_DIR]
Per-af, per-direction, per-interface uRPF configs.
static clib_error_t * urpf_cli_update(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static uword unformat_urpf_mode(unformat_input_t *input, va_list *args)
vl_api_tunnel_mode_t mode
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
uword unformat_ip_address_family(unformat_input_t *input, va_list *args)
u8 * format_urpf_mode(u8 *s, va_list *a)
#define VLIB_CLI_COMMAND(x,...)
enum ip_address_family_t_ ip_address_family_t
void urpf_update(urpf_mode_t mode, u32 sw_if_index, ip_address_family_t af, vlib_dir_t dir)
static clib_error_t * urpf_cli_accept(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword unformat_ip_prefix(unformat_input_t *input, va_list *args)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
vl_api_interface_index_t sw_if_index
enum urpf_mode_t_ urpf_mode_t
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)