Annotation of fwsync/patches/ipfw_main.patch, revision 1.3

1.1       misho       1: diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c
1.3     ! misho       2: index 1b9c7f324a9..583545dbde5 100644
1.1       misho       3: --- a/sbin/ipfw/main.c
                      4: +++ b/sbin/ipfw/main.c
1.2       misho       5: @@ -42,6 +42,8 @@ help(void)
1.1       misho       6:  "\tipfw [-abcdefhnNqStTv] <command>\n\n"
                      7:  "where <command> is one of the following:\n\n"
                      8:  "add [num] [set N] [prob x] RULE-BODY\n"
                      9: +"sync {start [edge|collector]|config [edge <port>|collector <ip,port>]|\n"
1.3     ! misho      10: +"             show|list [edge|collector]|stop [edge|collector]|flush [edge|collector]}\n"
1.1       misho      11:  "{pipe|queue} N config PIPE-BODY\n"
                     12:  "[pipe|queue] {zero|delete|show} [N{,N}]\n"
                     13:  "nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n"
1.2       misho      14: @@ -404,11 +406,14 @@ ipfw_main(int oldac, char **oldav)
1.1       misho      15:        /*
                     16:         * Optional: pipe, queue or nat.
                     17:         */
                     18: +      g_co.do_sync = 0;
                     19:        g_co.do_nat = 0;
                     20:        g_co.do_pipe = 0;
                     21:        g_co.use_set = 0;
1.2       misho      22:        if (is_ipfw() && !strncmp(*av, "nat", strlen(*av)))
1.1       misho      23:                g_co.do_nat = 1;
                     24: +      else if (!strncmp(*av, "sync", strlen(*av)))
                     25: +              g_co.do_sync = 1;
                     26:        else if (!strncmp(*av, "pipe", strlen(*av)))
                     27:                g_co.do_pipe = 1;
                     28:        else if (_substrcmp(*av, "queue") == 0)
1.2       misho      29: @@ -428,7 +433,7 @@ ipfw_main(int oldac, char **oldav)
1.1       misho      30:                }
                     31:        }
                     32:  
                     33: -      if (g_co.do_pipe || g_co.do_nat) {
                     34: +      if (g_co.do_pipe || g_co.do_nat || g_co.do_sync) {
                     35:                ac--;
                     36:                av++;
                     37:        }
1.2       misho      38: @@ -439,7 +444,7 @@ ipfw_main(int oldac, char **oldav)
1.1       misho      39:         * but the code is easier to parse as 'nat|pipe config NN'
                     40:         * so we swap the two arguments.
                     41:         */
                     42: -      if ((g_co.do_pipe || g_co.do_nat) && ac > 1 && isdigit(*av[0])) {
                     43: +      if ((g_co.do_pipe || g_co.do_nat || g_co.do_sync) && ac > 1 && isdigit(*av[0])) {
                     44:                char *p = av[0];
                     45:  
                     46:                av[0] = av[1];
1.3     ! misho      47: @@ -455,6 +460,18 @@ ipfw_main(int oldac, char **oldav)
1.1       misho      48:                        ipfw_add(av);
                     49:                else if (g_co.do_nat && _substrcmp(*av, "show") == 0)
                     50:                        ipfw_show_nat(ac, av);
                     51: +              else if (g_co.do_sync && _substrcmp(*av, "show") == 0)
                     52: +                      ipfw_show_sync(ac, av);
1.3     ! misho      53: +              else if (g_co.do_sync && _substrcmp(*av, "list") == 0)
        !            54: +                      ipfw_list_sync(ac, av);
1.1       misho      55: +              else if (g_co.do_sync && _substrcmp(*av, "start") == 0)
                     56: +                      ipfw_start_sync(ac, av);
                     57: +              else if (g_co.do_sync && _substrcmp(*av, "stop") == 0)
                     58: +                      ipfw_stop_sync(ac, av);
                     59: +              else if (g_co.do_sync && _substrcmp(*av, "flush") == 0)
                     60: +                      ipfw_flush_sync(ac, av);
1.2       misho      61: +              else if (g_co.do_sync&& _substrcmp(*av, "config") == 0)
                     62: +                      ipfw_config_sync(ac, av);
1.1       misho      63:                else if (g_co.do_pipe && _substrcmp(*av, "config") == 0)
                     64:                        ipfw_config_pipe(ac, av);
                     65:                else if (g_co.do_nat && _substrcmp(*av, "config") == 0)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>