[netfilter-cvslog] r6861 - in trunk/conntrack-tools: . examples/cli extensions

pablo at netfilter.org pablo at netfilter.org
Mon Jun 4 19:30:24 CEST 2007


Author: pablo at netfilter.org
Date: 2007-06-04 19:30:24 +0200 (Mon, 04 Jun 2007)
New Revision: 6861

Modified:
   trunk/conntrack-tools/ChangeLog
   trunk/conntrack-tools/examples/cli/test.sh
   trunk/conntrack-tools/extensions/libct_proto_tcp.c
   trunk/conntrack-tools/extensions/libct_proto_udp.c
Log:
add aliases --sport and --dport to make it more iptables-like


Modified: trunk/conntrack-tools/ChangeLog
===================================================================
--- trunk/conntrack-tools/ChangeLog	2007-06-04 17:02:36 UTC (rev 6860)
+++ trunk/conntrack-tools/ChangeLog	2007-06-04 17:30:24 UTC (rev 6861)
@@ -16,6 +16,7 @@
 o fix segfault with conntrack --output (Krzysztof Oledzky)
 o use NFCT_SOPT_SETUP_* facilities: nfct_setobjopt
 o remove bogus option to get a conntrack in test.sh example file
+o add aliases --sport and --dport to make it more iptables-like
 
 version 0.9.3 (2006/05/22)
 ------------------------------

Modified: trunk/conntrack-tools/examples/cli/test.sh
===================================================================
--- trunk/conntrack-tools/examples/cli/test.sh	2007-06-04 17:02:36 UTC (rev 6860)
+++ trunk/conntrack-tools/examples/cli/test.sh	2007-06-04 17:30:24 UTC (rev 6861)
@@ -24,32 +24,30 @@
 		;;
 	new-simple)
 		echo "creating a new conntrack (simplified)"
-		$CONNTRACK -I --orig-src $SRC --orig-dst $DST \
-		-p tcp --orig-port-src $SPORT  --orig-port-dst $DPORT \
+		$CONNTRACK -I -s $SRC -d $DST \
+		-p tcp --sport $SPORT  --dport $DPORT \
 		--state LISTEN -u SEEN_REPLY -t 50
 		;;
 	new-nat)
 		echo "creating a new conntrack (NAT)"
-		$CONNTRACK -I --orig-src $SRC --orig-dst $DST \
-		-p tcp --orig-port-src $SPORT  --orig-port-dst $DPORT \
+		$CONNTRACK -I -s $SRC -d $DST \
+		-p tcp --sport $SPORT  --dport $DPORT \
 		--state LISTEN -u SEEN_REPLY -t 50 --dst-nat 8.8.8.8
 		;;
 	get)
 		echo "getting a conntrack"
-		$CONNTRACK -G --orig-src $SRC --orig-dst $DST \
-		-p tcp --orig-port-src $SPORT --orig-port-dst $DPORT
+		$CONNTRACK -G -s $SRC -d $DST \
+		-p tcp --sport $SPORT --dport $DPORT
 		;;
 	change)
 		echo "change a conntrack"
-		$CONNTRACK -U --orig-src $SRC --orig-dst $DST \
-		--reply-src $DST --reply-dst $SRC -p tcp \
-		--orig-port-src $SPORT --orig-port-dst $DPORT \
-		--reply-port-src $DPORT --reply-port-dst $SPORT \
+		$CONNTRACK -U -s $SRC -d $DST \
+		-p tcp --sport $SPORT --dport $DPORT \
 		--state TIME_WAIT -u ASSURED,SEEN_REPLY -t 500
 		;;
 	delete)
-		$CONNTRACK -D --orig-src $SRC --orig-dst $DST \
-		-p tcp --orig-port-src $SPORT --orig-port-dst $DPORT
+		$CONNTRACK -D -s $SRC -d $DST \
+		-p tcp --sport $SPORT --dport $DPORT
 		;;
 	output)
 		proc=$(cat /proc/net/ip_conntrack | wc -l)

Modified: trunk/conntrack-tools/extensions/libct_proto_tcp.c
===================================================================
--- trunk/conntrack-tools/extensions/libct_proto_tcp.c	2007-06-04 17:02:36 UTC (rev 6860)
+++ trunk/conntrack-tools/extensions/libct_proto_tcp.c	2007-06-04 17:30:24 UTC (rev 6861)
@@ -19,7 +19,9 @@
 
 static struct option opts[] = {
 	{"orig-port-src", 1, 0, '1'},
+	{"sport", 1, 0, '1'},
 	{"orig-port-dst", 1, 0, '2'},
+	{"dport", 1, 0, '2'},
 	{"reply-port-src", 1, 0, '3'},
 	{"reply-port-dst", 1, 0, '4'},
 	{"mask-port-src", 1, 0, '5'},

Modified: trunk/conntrack-tools/extensions/libct_proto_udp.c
===================================================================
--- trunk/conntrack-tools/extensions/libct_proto_udp.c	2007-06-04 17:02:36 UTC (rev 6860)
+++ trunk/conntrack-tools/extensions/libct_proto_udp.c	2007-06-04 17:30:24 UTC (rev 6861)
@@ -19,7 +19,9 @@
 
 static struct option opts[] = {
 	{"orig-port-src", 1, 0, '1'},
+	{"sport", 1, 0, '1'},
 	{"orig-port-dst", 1, 0, '2'},
+	{"dport", 1, 0, '2'},
 	{"reply-port-src", 1, 0, '3'},
 	{"reply-port-dst", 1, 0, '4'},
 	{"mask-port-src", 1, 0, '5'},




More information about the netfilter-cvslog mailing list