aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/urpf/urpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/urpf/urpf.c')
-rw-r--r--src/plugins/urpf/urpf.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/plugins/urpf/urpf.c b/src/plugins/urpf/urpf.c
index e5209caafb4..1e7d6c0fb91 100644
--- a/src/plugins/urpf/urpf.c
+++ b/src/plugins/urpf/urpf.c
@@ -60,7 +60,17 @@ static const char *urpf_feats[N_AF][VLIB_N_DIR][URPF_N_MODES] =
urpf_data_t *urpf_cfgs[N_AF][VLIB_N_DIR];
u8 *
-format_urpf_mode (u8 * s, va_list * a)
+format_urpf_trace (u8 *s, va_list *va)
+{
+ CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *);
+ CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *);
+ urpf_trace_t *t = va_arg (*va, urpf_trace_t *);
+
+ return format (s, "uRPF:%d fib:%d", t->urpf, t->fib_index);
+}
+
+__clib_export u8 *
+format_urpf_mode (u8 *s, va_list *a)
{
urpf_mode_t mode = va_arg (*a, int);
@@ -76,8 +86,8 @@ format_urpf_mode (u8 * s, va_list * a)
return (format (s, "unknown"));
}
-static uword
-unformat_urpf_mode (unformat_input_t * input, va_list * args)
+__clib_export uword
+unformat_urpf_mode (unformat_input_t *input, va_list *args)
{
urpf_mode_t *mode = va_arg (*args, urpf_mode_t *);
@@ -94,7 +104,16 @@ unformat_urpf_mode (unformat_input_t * input, va_list * args)
return 0;
}
-int
+__clib_export int
+urpf_feature_enable_disable (ip_address_family_t af, vlib_dir_t dir,
+ urpf_mode_t mode, u32 sw_if_index, int enable)
+{
+ return vnet_feature_enable_disable (urpf_feat_arcs[af][dir],
+ urpf_feats[af][dir][mode], sw_if_index,
+ enable, 0, 0);
+}
+
+__clib_export int
urpf_update (urpf_mode_t mode, u32 sw_if_index, ip_address_family_t af,
vlib_dir_t dir, u32 table_id)
{