[conntrack-tools] conntrack: remove broken command checking code

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Tue Mar 31 15:46:25 CEST 2009


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=conntrack-tools.git;a=commit;h=f133f56f46c5ea52031be986f1a319ead672ef25
commit f133f56f46c5ea52031be986f1a319ead672ef25
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Tue Mar 31 15:36:39 2009 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Tue Mar 31 15:36:39 2009 +0200

    conntrack: remove broken command checking code
    
    This patch removes the broken command checking. This is better
    handled by the option checkings which comes just after this one.
    This patch also fixes some inconsistencies in the command
    parameter checking when long names are used.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit ff1768673f093c2bfc8e271513b20fc4aa4efeb3
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Tue Mar 31 15:36:36 2009 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Tue Mar 31 15:36:36 2009 +0200

    conntrack: add `-S' command to display kernel statistics
    
    This patch adds `-S' command to display kernel statistics. Using
    raw `cat' on /proc and the hexadecimal output is not very handy.
    This option parses the /proc entry and display the information
    is a more human friendly way.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit 70744136608e3ee38f15c994fc2633cf5e3c9fa2
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Tue Mar 31 15:31:59 2009 +0200
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Tue Mar 31 15:31:59 2009 +0200

    conntrack: fix missing bits in `-C' command
    
    This patch fixes some missing bits for the `-C' conntrack command
    like the manpage information, the usage help, the `--counters'
    synonymous and the commands vs. options checking.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  f133f56f46c5ea52031be986f1a319ead672ef25 (commit)
       via  ff1768673f093c2bfc8e271513b20fc4aa4efeb3 (commit)
       via  70744136608e3ee38f15c994fc2633cf5e3c9fa2 (commit)
      from  0114456525a8a805d0a53040b7170b7c7d7f7007 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f133f56f46c5ea52031be986f1a319ead672ef25
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Tue Mar 31 15:36:39 2009 +0200

    conntrack: remove broken command checking code
    
    This patch removes the broken command checking. This is better
    handled by the option checkings which comes just after this one.
    This patch also fixes some inconsistencies in the command
    parameter checking when long names are used.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit ff1768673f093c2bfc8e271513b20fc4aa4efeb3
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Tue Mar 31 15:36:36 2009 +0200

    conntrack: add `-S' command to display kernel statistics
    
    This patch adds `-S' command to display kernel statistics. Using
    raw `cat' on /proc and the hexadecimal output is not very handy.
    This option parses the /proc entry and display the information
    is a more human friendly way.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

commit 70744136608e3ee38f15c994fc2633cf5e3c9fa2
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Tue Mar 31 15:31:59 2009 +0200

    conntrack: fix missing bits in `-C' command
    
    This patch fixes some missing bits for the `-C' conntrack command
    like the manpage information, the usage help, the `--counters'
    synonymous and the commands vs. options checking.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 conntrack.8         |    7 +++
 include/conntrack.h |    5 ++-
 src/conntrack.c     |  114 ++++++++++++++++++++++++++++++++++++++++-----------
 3 files changed, 101 insertions(+), 25 deletions(-)
This patch fixes some missing bits for the `-C' conntrack command
like the manpage information, the usage help, the `--counters'
synonymous and the commands vs. options checking.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/conntrack.8 b/conntrack.8
index 94f4e41..280af9c 100644
--- a/conntrack.8
+++ b/conntrack.8
@@ -19,6 +19,8 @@ conntrack \- command line interface for netfilter connection tracking
 .BR "conntrack -E [table] parameters"
 .br
 .BR "conntrack -F [table]"
+.br
+.BR "conntrack -C [table]"
 .SH DESCRIPTION
 .B conntrack
 provides a full featured userspace interface to the netfilter connection tracking system that is intended to replace the old /proc/net/ip_conntrack interface. This tool can be used to search, list, inspect and maintain the connection tracking subsystem of the Linux kernel.
diff --git a/src/conntrack.c b/src/conntrack.c
index c746ae8..2764d80 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -77,6 +77,7 @@ static struct option original_opts[] = {
 	{"get", 1, 0, 'G'},
 	{"flush", 1, 0, 'F'},
 	{"event", 1, 0, 'E'},
+	{"counter", 2, 0, 'C'},
 	{"version", 0, 0, 'V'},
 	{"help", 0, 0, 'h'},
 	{"orig-src", 1, 0, 's'},
@@ -141,6 +142,7 @@ static char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
 /*EXP_FLUSH*/ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 /*EXP_EVENT*/ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 /*CT_COUNT*/  {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/*EXP_COUNT*/ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
 };
 
 static LIST_HEAD(proto_list);
@@ -553,7 +555,8 @@ static const char usage_commands[] =
 	"  -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";
+	"  -F [table]\t\t\tFlush table\n"
+	"  -C [table]\t\t\tShow counter\n";
 
 static const char usage_tables[] =
 	"Tables: conntrack, expect\n";



More information about the netfilter-cvslog mailing list