[netfilter-cvslog] r4481 - in trunk/conntrack: . extensions include src

pablo at netfilter.org pablo at netfilter.org
Sun Nov 6 04:09:45 CET 2005


Author: pablo at netfilter.org
Date: 2005-11-06 04:09:43 +0100 (Sun, 06 Nov 2005)
New Revision: 4481

Modified:
   trunk/conntrack/ChangeLog
   trunk/conntrack/configure.in
   trunk/conntrack/extensions/libct_proto_icmp.c
   trunk/conntrack/extensions/libct_proto_sctp.c
   trunk/conntrack/extensions/libct_proto_tcp.c
   trunk/conntrack/extensions/libct_proto_udp.c
   trunk/conntrack/include/conntrack.h
   trunk/conntrack/src/conntrack.c
Log:
See ChangeLog



Modified: trunk/conntrack/ChangeLog
===================================================================
--- trunk/conntrack/ChangeLog	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/ChangeLog	2005-11-06 03:09:43 UTC (rev 4481)
@@ -1,3 +1,12 @@
+2005-11-05
+<olenf at ans.pl>
+	o -t and -u are optional at update.
+	o Improved conntrack -h output
+	o add htons for icmp id.
+<pablo at eurodev.net>
+	o Fixed versioning :(
+	o Bumped version to 0.97
+
 2005-11-03
 <laforge at netfilter.org>
 	o Use extra 'data' argument of nfct_register_callback() function that
@@ -2,4 +11,2 @@
 	  I've introduced in libetfilter_conntrack.
-
-2005-11-03
 <olenf at ans.pl>

Modified: trunk/conntrack/configure.in
===================================================================
--- trunk/conntrack/configure.in	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/configure.in	2005-11-06 03:09:43 UTC (rev 4481)
@@ -2,8 +2,8 @@
 
 AC_CANONICAL_SYSTEM
 
-AM_INIT_AUTOMAKE(conntrack, 0.63)
-AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(conntrack, 0.97)
+#AM_CONFIG_HEADER(config.h)
 
 AC_PROG_CC
 AM_PROG_LIBTOOL

Modified: trunk/conntrack/extensions/libct_proto_icmp.c
===================================================================
--- trunk/conntrack/extensions/libct_proto_icmp.c	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/extensions/libct_proto_icmp.c	2005-11-06 03:09:43 UTC (rev 4481)
@@ -77,7 +77,7 @@
 			break;
 		case '3':
 			if (optarg) {
-				orig->l4src.icmp.id = atoi(optarg);
+				orig->l4src.icmp.id = htons(atoi(optarg));
 				reply->l4dst.icmp.id = 0;
 				*flags |= ICMP_ID;
 			}
@@ -106,7 +106,7 @@
 	.final_check	= final_check,
 	.help		= help,
 	.opts		= opts,
-	.version	= CONNTRACK_VERSION,
+	.version	= VERSION,
 };
 
 void __attribute__ ((constructor)) init(void);

Modified: trunk/conntrack/extensions/libct_proto_sctp.c
===================================================================
--- trunk/conntrack/extensions/libct_proto_sctp.c	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/extensions/libct_proto_sctp.c	2005-11-06 03:09:43 UTC (rev 4481)
@@ -151,7 +151,7 @@
 	.final_check		= final_check,
 	.help			= help,
 	.opts			= opts,
-	.version		= CONNTRACK_VERSION,
+	.version		= VERSION,
 };
 
 void __attribute__ ((constructor)) init(void);

Modified: trunk/conntrack/extensions/libct_proto_tcp.c
===================================================================
--- trunk/conntrack/extensions/libct_proto_tcp.c	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/extensions/libct_proto_tcp.c	2005-11-06 03:09:43 UTC (rev 4481)
@@ -174,7 +174,7 @@
 	.final_check		= final_check,
 	.help			= help,
 	.opts			= opts,
-	.version		= CONNTRACK_VERSION,
+	.version		= VERSION,
 };
 
 void __attribute__ ((constructor)) init(void);

Modified: trunk/conntrack/extensions/libct_proto_udp.c
===================================================================
--- trunk/conntrack/extensions/libct_proto_udp.c	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/extensions/libct_proto_udp.c	2005-11-06 03:09:43 UTC (rev 4481)
@@ -132,7 +132,7 @@
 	.final_check		= final_check,
 	.help			= help,
 	.opts			= opts,
-	.version		= CONNTRACK_VERSION,
+	.version		= VERSION,
 };
 
 void __attribute__ ((constructor)) init(void);

Modified: trunk/conntrack/include/conntrack.h
===================================================================
--- trunk/conntrack/include/conntrack.h	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/include/conntrack.h	2005-11-06 03:09:43 UTC (rev 4481)
@@ -6,7 +6,6 @@
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
 
 #define PROGNAME "conntrack"
-#define CONNTRACK_VERSION "0.96"
 
 enum action {
 	CT_NONE		= 0,

Modified: trunk/conntrack/src/conntrack.c
===================================================================
--- trunk/conntrack/src/conntrack.c	2005-11-05 19:28:42 UTC (rev 4480)
+++ trunk/conntrack/src/conntrack.c	2005-11-06 03:09:43 UTC (rev 4481)
@@ -113,7 +113,7 @@
           /*   -s  -d  -r  -q  -p  -t  -u  -z  -e  -x  -y  -k  -l  -a  -m  -i*/
 /*CT_LIST*/   {'x','x','x','x','x','x','x',' ','x','x','x','x','x','x','x',' '},
 /*CT_CREATE*/ {' ',' ',' ',' ','+','+','+','x','x','x','x','x','x',' ',' ','x'},
-/*CT_UPDATE*/ {' ',' ',' ',' ','+','+','+','x','x','x','x','x','x','x',' ',' '},
+/*CT_UPDATE*/ {' ',' ',' ',' ','+',' ',' ','x','x','x','x','x','x','x',' ',' '},
 /*CT_DELETE*/ {' ',' ',' ',' ',' ','x','x','x','x','x','x','x','x','x','x',' '},
 /*CT_GET*/    {' ',' ',' ',' ','+','x','x','x','x','x','x','x','x','x','x',' '},
 /*CT_FLUSH*/  {'x','x','x','x','x','x','x','x','x','x','x','x','x','x','x','x'},
@@ -134,9 +134,9 @@
 
 void register_proto(struct ctproto_handler *h)
 {
-	if (strcmp(h->version, CONNTRACK_VERSION) != 0) {
+	if (strcmp(h->version, VERSION) != 0) {
 		fprintf(stderr, "plugin `%s': version %s (I'm %s)\n",
-			h->name, h->version, CONNTRACK_VERSION);
+			h->name, h->version, VERSION);
 		exit(1);
 	}
 	list_add(&h->head, &proto_list);
@@ -209,7 +209,7 @@
 		global_option_offset = 0;
 	}
 	va_start(args, msg);
-	fprintf(stderr,"%s v%s: ", PROGNAME, CONNTRACK_VERSION);
+	fprintf(stderr,"%s v%s: ", PROGNAME, VERSION);
 	vfprintf(stderr, msg, args);
 	va_end(args);
 	fprintf(stderr, "\n");
@@ -558,34 +558,56 @@
 	exit(0);
 }
 
+static const char usage_commands[] =
+	"Commands:\n"
+	"  -L [table] [options]\t\tList conntrack or expectation table\n"
+	"  -G [table] parameters\t\tGet conntrack or expectation\n"
+	"  -D [table] parameters\t\tDelete conntrack or expectation\n"
+	"  -I [table] parameters\t\tCreate a conntrack or expectation\n"
+	"  -U [table] parameters\t\tUpdate a conntrack\n"
+	"  -E [table] [options]\t\tShow events\n"
+	"  -F [table]\t\t\tFlush table\n";
+
+static const char usage_tables[] =
+	"Tables: conntrack, expect\n";
+
+static const char usage_conntrack_parameters[] =
+	"Conntrack parameters and options:\n"
+	"  -a, --nat-range min_ip[-max_ip]\tNAT ip range\n"
+	"  -m, --mark mark\t\t\tSet mark\n"
+	"  -e, --event-mask eventmask\t\tEvent mask, eg. NEW,DESTROY\n"
+	"  -z, --zero \t\t\t\tZero counters while listing\n"
+	;
+
+static const char usage_expectation_parameters[] =
+	"Expectation parameters and options:\n"
+	"  --tuple-src ip\tSource address in expect tuple\n"
+	"  --tuple-dst ip\tDestination address in expect tuple\n"
+	"  --mask-src ip\t\tSource mask address\n"
+	"  --mask-dst ip\t\tDestination mask address\n";
+
+static const char usage_parameters[] =
+	"Common parameters and options:\n"
+	"  -s, --orig-src ip\t\tSource address from original direction\n"
+	"  -d, --orig-dst ip\t\tDestination address from original direction\n"
+	"  -r, --reply-src ip\t\tSource addres from reply direction\n"
+	"  -q, --reply-dst ip\t\tDestination address from reply direction\n"
+	"  -p, --protonum proto\t\tLayer 4 Protocol, eg. 'tcp'\n"
+	"  -t, --timeout timeout\t\tSet timeout\n"
+	"  -u, --status status\t\tSet status, eg. ASSURED\n"
+	"  -i, --id [id]\t\t\tShow or set conntrack ID\n"
+	;
+  
+
 void usage(char *prog) {
-fprintf(stdout, "Tool to manipulate conntrack and expectations. Version %s\n", CONNTRACK_VERSION);
-fprintf(stdout, "Usage: %s [commands] [options]\n", prog);
-fprintf(stdout, "\n");
-fprintf(stdout, "Commands:\n");
-fprintf(stdout, "-L [table] [-z]\t\tList conntrack or expectation table\n");
-fprintf(stdout, "-G [table] parameters\tGet conntrack or expectation\n");
-fprintf(stdout, "-D [table] parameters\tDelete conntrack or expectation\n");
-fprintf(stdout, "-I [table] parameters\tCreate a conntrack or expectation\n");
-fprintf(stdout, "-U [table] parameters\tUpdate a conntrack\n");
-fprintf(stdout, "-E [table] [options]\tShow events\n");
-fprintf(stdout, "-F [table]\t\tFlush table\n");
-fprintf(stdout, "\n");
-fprintf(stdout, "Options:\n");
-fprintf(stdout, "--orig-src ip	     	Source address from original direction\n");
-fprintf(stdout, "--orig-dst ip	     	Destination address from original direction\n");
-fprintf(stdout, "--reply-src ip		Source addres from reply direction\n");
-fprintf(stdout, "--reply-dst ip		Destination address from reply direction\n");
-fprintf(stdout, "--tuple-src ip		Source address in expect tuple\n");
-fprintf(stdout, "--tuple-dst ip		Destination address in expect tuple\n");
-fprintf(stdout, "--mask-src ip		Source mask address for expectation\n");
-fprintf(stdout, "--mask-dst ip		Destination mask address for expectations\n");
-fprintf(stdout, "-p proto		Layer 4 Protocol\n");
-fprintf(stdout, "-t timeout		Set timeout\n");
-fprintf(stdout, "-u status		Set status\n");
-fprintf(stdout, "-e eventmask		Set event mask\n");
-fprintf(stdout, "-a min_ip[-max_ip]	NAT ip range\n");
-fprintf(stdout, "-z 			Zero Counters\n");
+	fprintf(stdout, "Tool to manipulate conntrack and expectations. Version %s\n", VERSION);
+	fprintf(stdout, "Usage: %s [commands] [options]\n", prog);
+
+	fprintf(stdout, "\n%s", usage_commands);
+	fprintf(stdout, "\n%s", usage_tables);
+	fprintf(stdout, "\n%s", usage_conntrack_parameters);
+	fprintf(stdout, "\n%s", usage_expectation_parameters);
+	fprintf(stdout, "\n%s", usage_parameters);
 }
 
 int main(int argc, char *argv[])
@@ -1017,7 +1039,7 @@
 		break;
 			
 	case CT_VERSION:
-		fprintf(stdout, "%s v%s\n", PROGNAME, CONNTRACK_VERSION);
+		fprintf(stdout, "%s v%s\n", PROGNAME, VERSION);
 		break;
 	case CT_HELP:
 		usage(argv[0]);




More information about the netfilter-cvslog mailing list