From 5b99de02b621cde52aa8932d58cb9ed8c85e478a Mon Sep 17 00:00:00 2001 From: Shawn Carey Date: Tue, 3 Dec 2024 18:22:03 -0500 Subject: [PATCH] parse diverter options --- programs/ziti-edge-tunnel/ziti-edge-tunnel.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/programs/ziti-edge-tunnel/ziti-edge-tunnel.c b/programs/ziti-edge-tunnel/ziti-edge-tunnel.c index 0ff14366..fbd5691b 100644 --- a/programs/ziti-edge-tunnel/ziti-edge-tunnel.c +++ b/programs/ziti-edge-tunnel/ziti-edge-tunnel.c @@ -1302,6 +1302,17 @@ static int run_opts(int argc, char *argv[]) { while ((c = getopt_long(argc, argv, "i:I:v:r:d:u:x:", run_options, &option_index)) != -1) { switch (c) { +#if __linux__ + case 'D': + diverter = true; + diverter_if = optarg; + break; + case 'f': + diverter = true; + firewall = true; + diverter_if = optarg; + break; +#endif case 'i': { struct cfg_instance_s *inst = calloc(1, sizeof(struct cfg_instance_s)); inst->cfg = strdup(optarg); @@ -2730,8 +2741,8 @@ static CommandLine enroll_cmd = make_command( parse_enroll_opts, enroll); #if __linux__ #define DIVERTER_OPTS_SUMMARY "[-D|--diverter ] [-f|--diverter-fw ] " -#define DIVERTER_OPTS_DETAIL "\t-D|--diverter \tset diverter mode to true on \n" \ - "\t-f|--diverter-fw \tset diverter to true in firewall mode on )\n" +#define DIVERTER_OPTS_DETAIL "\t-D|--diverter \tset diverter mode to true on \n" \ + "\t-f|--diverter-fw \tset diverter to true in firewall mode on )\n" #else #define DIVERTER_OPTS_SUMMARY "" #define DIVERTER_OPTS_DETAIL ""