summaryrefslogtreecommitdiffstats
path: root/src/plugins/cnat/cnat_scanner.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2020-09-23 10:43:16 +0200
committerOle Tr�an <otroan@employees.org>2020-09-23 12:02:12 +0000
commitd63f73b8393b086d21a5197d1e02fac243867a93 (patch)
tree7442b7c98fc64f220070216ccf8d4f9bdf59d49a /src/plugins/cnat/cnat_scanner.c
parent8eb69407c8075e101b773d5a27ea21bd3fc906d7 (diff)
cnat: Disable default scanner process
Type: feature Change-Id: Iba9d9f384eaa35c5522e828e3cbe4516416294db Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/cnat/cnat_scanner.c')
-rw-r--r--src/plugins/cnat/cnat_scanner.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/plugins/cnat/cnat_scanner.c b/src/plugins/cnat/cnat_scanner.c
index f5af327bffe..d0ed5e318a3 100644
--- a/src/plugins/cnat/cnat_scanner.c
+++ b/src/plugins/cnat/cnat_scanner.c
@@ -16,12 +16,6 @@
#include <cnat/cnat_session.h>
#include <cnat/cnat_client.h>
-typedef enum cnat_scanner_cmd_t_
-{
- CNAT_SCANNER_OFF,
- CNAT_SCANNER_ON,
-} cnat_scanner_cmd_t;
-
static uword
cnat_scanner_process (vlib_main_t * vm,
vlib_node_runtime_t * rt, vlib_frame_t * f)
@@ -29,7 +23,7 @@ cnat_scanner_process (vlib_main_t * vm,
uword event_type, *event_data = 0;
cnat_main_t *cm = &cnat_main;
f64 start_time;
- int enabled = 1, i = 0;
+ int enabled = 0, i = 0;
while (1)
{
@@ -90,8 +84,7 @@ cnat_scanner_cmd (vlib_main_t * vm,
return (clib_error_return (0, "unknown input '%U'",
format_unformat_error, input));
}
-
- vlib_process_signal_event (vm, cnat_scanner_process_node.index, cmd, 0);
+ cnat_enable_disable_scanner (cmd);
return (NULL);
}
@@ -104,6 +97,17 @@ VLIB_CLI_COMMAND (cnat_scanner_cmd_node, static) = {
};
/* *INDENT-ON* */
+static clib_error_t *
+cnat_scanner_init (vlib_main_t * vm)
+{
+ cnat_main_t *cm = &cnat_main;
+ cm->scanner_node_index = cnat_scanner_process_node.index;
+
+ return (NULL);
+}
+
+VLIB_INIT_FUNCTION (cnat_scanner_init);
+
/*
* fd.io coding-style-patch-verification: ON
*