From 5244bd949f12e7c1dba979fad52bcb5ad6dca09a Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=gandalf/emailAddress=gandalf@netfilter.org" Date: Wed, 2 Feb 2005 19:20:15 +0000 Subject: Add support for inversion to multiport revision 1. Signed-off-by: Phil Oester --- extensions/libipt_multiport.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'extensions') diff --git a/extensions/libipt_multiport.c b/extensions/libipt_multiport.c index 410a390..7fb6d72 100644 --- a/extensions/libipt_multiport.c +++ b/extensions/libipt_multiport.c @@ -31,13 +31,13 @@ help_v1(void) { printf( "multiport v%s options:\n" -" --source-ports port[,port:port,port...]\n" +" --source-ports [!] port[,port:port,port...]\n" " --sports ...\n" " match source port(s)\n" -" --destination-ports port[,port:port,port...]\n" +" --destination-ports [!] port[,port:port,port...]\n" " --dports ...\n" " match destination port(s)\n" -" --ports port[,port:port,port]\n" +" --ports [!] port[,port:port,port]\n" " match both source and destination port(s)\n", IPTABLES_VERSION); } @@ -255,8 +255,7 @@ parse_v1(int c, char **argv, int invert, unsigned int *flags, } if (invert) - exit_error(PARAMETER_PROBLEM, - "multiport does not support invert"); + multiinfo->invert = 1; if (*flags) exit_error(PARAMETER_PROBLEM, @@ -362,6 +361,9 @@ print_v1(const struct ipt_ip *ip, break; } + if (multiinfo->invert) + printf("! "); + for (i=0; i < multiinfo->count; i++) { printf("%s", i ? "," : ""); print_port(multiinfo->ports[i], ip->proto, numeric); @@ -422,6 +424,9 @@ static void save_v1(const struct ipt_ip *ip, break; } + if (multiinfo->invert) + printf("! "); + for (i=0; i < multiinfo->count; i++) { printf("%s", i ? "," : ""); print_port(multiinfo->ports[i], ip->proto, 1); -- cgit v1.2.3