File:  [ELWIX - Embedded LightWeight unIX -] / fwsync / patches / ipfw_main.patch
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Mon Jul 11 17:03:15 2022 UTC (23 months ago) by misho
Branches: MAIN
CVS tags: fwsync1_1, HEAD
update system patches

    1: diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c
    2: index 1b9c7f324a9..0b2ca745e4d 100644
    3: --- a/sbin/ipfw/main.c
    4: +++ b/sbin/ipfw/main.c
    5: @@ -42,6 +42,8 @@ help(void)
    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"
   10: +"		show [config|status]|stop [edge|collector]|flush [edge|collector]}\n"
   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"
   14: @@ -404,11 +406,14 @@ ipfw_main(int oldac, char **oldav)
   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;
   22:  	if (is_ipfw() && !strncmp(*av, "nat", strlen(*av)))
   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)
   29: @@ -428,7 +433,7 @@ ipfw_main(int oldac, char **oldav)
   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:  	}
   38: @@ -439,7 +444,7 @@ ipfw_main(int oldac, char **oldav)
   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];
   47: @@ -455,6 +460,16 @@ ipfw_main(int oldac, char **oldav)
   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);
   53: +		else if (g_co.do_sync && _substrcmp(*av, "start") == 0)
   54: + 			ipfw_start_sync(ac, av);
   55: +		else if (g_co.do_sync && _substrcmp(*av, "stop") == 0)
   56: + 			ipfw_stop_sync(ac, av);
   57: +		else if (g_co.do_sync && _substrcmp(*av, "flush") == 0)
   58: + 			ipfw_flush_sync(ac, av);
   59: +		else if (g_co.do_sync&& _substrcmp(*av, "config") == 0)
   60: + 			ipfw_config_sync(ac, av);
   61:  		else if (g_co.do_pipe && _substrcmp(*av, "config") == 0)
   62:  			ipfw_config_pipe(ac, av);
   63:  		else if (g_co.do_nat && _substrcmp(*av, "config") == 0)

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