iptstate-commit Mailing List for IP Tables State
Brought to you by:
jaymzh
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(1) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Phil D. <ja...@us...> - 2012-06-02 04:20:46
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv32124
Modified Files:
Changelog iptstate.cc iptstate.spec
Log Message:
Changelog, version bump.
Index: iptstate.spec
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- iptstate.spec 1 Jun 2012 07:53:37 -0000 1.12
+++ iptstate.spec 2 Jun 2012 04:20:44 -0000 1.13
@@ -1,5 +1,5 @@
%define name iptstate
-%define version 2.2.4
+%define version 2.2.5
%define release 1
Name: %{name}
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- iptstate.cc 2 Jun 2012 04:18:00 -0000 1.28
+++ iptstate.cc 2 Jun 2012 04:20:44 -0000 1.29
@@ -63,7 +63,7 @@
#include <unistd.h>
using namespace std;
-#define VERSION "2.2.4+CVS"
+#define VERSION "2.2.5"
/*
* MAXCONS is set to 16k, the default number of states in iptables. Generally
* speaking the ncurses pad is this many lines long, but since ncurses
Index: Changelog
===================================================================
RCS file: /cvsroot/iptstate/iptstate/Changelog,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Changelog 1 Jun 2012 07:56:10 -0000 1.18
+++ Changelog 2 Jun 2012 04:20:44 -0000 1.19
@@ -1,3 +1,11 @@
+2.2.5
+- Released 06/01/12
+- Full support for ICMP6 including code/type display and state deletion
+- Dynamically size "State" column"
+- If we can't resolve a protocol to a name, print the number instead of
+ "UNKNOWN!"
+- Don't leave a space for ":" if there's no port
+
2.2.4
- Released 06/01/12
- Improved IPv6 support - truncate addresses if they don't fit and generally
|
|
From: Phil D. <ja...@us...> - 2012-06-02 04:18:02
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv32011
Modified Files:
iptstate.8 iptstate.cc
Log Message:
iptstate.8
- document truncation of addresses
iptstate.cc
- print "ipv6-icmp" as "icmp6"
- support type/code in icmp6 states
- support deletion of icmp6 states
- dynamically size "state" column
- if we can't resolve a proto to a name, rather than print "UNKNOWN!",
just print the number
- fixbug where we leave a space for a ":" even if there's no port
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.8
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.8,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- iptstate.8 6 Apr 2011 07:39:32 -0000 1.5
+++ iptstate.8 2 Jun 2012 04:18:00 -0000 1.6
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii iptstate.8
.\"
-.TH IPTSTATE 8 "APRIL 2011" "" ""
+.TH IPTSTATE 8 "JUNE 2012" "" ""
.\"
.\" Man page written by Phil Dibowitz <phil AT ipom DOT com>
.\"
@@ -167,7 +167,7 @@
All bugs should be reported to Phil Dibowitz <phil AT ipom DOT com>. Please see the \fBREADME\fR and \fBBUGS\fR for more information on bug reports. Please read the \fBWISHLIST\fR before sending in features you hope to see.
.SH NOTES
-\fBiptstate\fP does a lot of work to try to fit everything on the screen in an easy-to-read way. However, in some cases, hostnames may need to be truncated in lookup mode. The truncation of names in lookup mode happens from the right for source because you most likely know your own domain name, and from the left for destination because knowing your users are connection to "mail.a." doesn't help much.
+\fBiptstate\fP does a lot of work to try to fit everything on the screen in an easy-to-read way. However, in some cases, hostnames may need to be truncated (in lookup mode). Similarly, IPv6 addresses may need to be truncated. The truncation of names happens from the right for source because you most likely know your own domain name, and from the left for destination because knowing your users are connection to "mail.a." doesn't help much. However, for addresses, this is reversed.
.PP
\fBiptstate\fP does not automatically handle window-resizes while in the \fBinteractive help\fP screen. If you do resize while in this window, you should return to the main window, hit \fBctrl-L\fP to re-calculate and re-draw the screen, and then, if you choose, return to the \fBinteractive help\fP.
.PP
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- iptstate.cc 1 Jun 2012 08:00:46 -0000 1.27
+++ iptstate.cc 2 Jun 2012 04:18:00 -0000 1.28
@@ -63,7 +63,7 @@
#include <unistd.h>
using namespace std;
-#define VERSION "2.2.4"
+#define VERSION "2.2.4+CVS"
/*
* MAXCONS is set to 16k, the default number of states in iptables. Generally
* speaking the ncurses pad is this many lines long, but since ncurses
@@ -910,13 +910,19 @@
nfct_set_attr(ct, ATTR_ORIG_IPV6_DST, (void *)&entry.dst.s6_addr);
}
- nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO,
- getprotobyname(entry.proto.c_str())->p_proto);
+ // undo our space optimization so the kernel can find the state.
+ protoent *pn;
+ if (entry.proto == "icmp6")
+ pn = getprotobyname("ipv6-icmp");
+ else
+ pn = getprotobyname(entry.proto.c_str());
+
+ nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, pn->p_proto);
if (entry.proto == "tcp" || entry.proto == "udp") {
nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, htons(entry.srcpt));
nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, htons(entry.dstpt));
- } else if (entry.proto == "icmp") {
+ } else if (entry.proto == "icmp" || entry.proto == "icmp6") {
string type, code, id, tmp;
split('/', entry.state, type, tmp);
split(' ', tmp, code, tmp);
@@ -970,7 +976,7 @@
struct protoent* pe = NULL;
int seconds, minutes, hours;
char ttlc[11];
- ostringstream typecode;
+ ostringstream buffer;
/*
* Clear the entry
@@ -988,11 +994,20 @@
* same regardless of protocol
*/
- pe = getprotobynumber(nfct_get_attr_u8(ct, ATTR_ORIG_L4PROTO));
+ short int pr = nfct_get_attr_u8(ct, ATTR_ORIG_L4PROTO);
+ pe = getprotobynumber(pr);
if (pe == NULL) {
- entry.proto = "unknown";
+ buffer << pr;
+ entry.proto = buffer.str();
+ buffer.str("");
} else {
entry.proto = pe->p_name;
+ /*
+ * if proto is "ipv6-icmp" we can just say "icmp6" to save space...
+ * it's more common/standard anyway
+ */
+ if (entry.proto == "ipv6-icmp")
+ entry.proto = "icmp6";
}
// ttl
@@ -1050,13 +1065,15 @@
} else if (entry.proto == "udp") {
entry.state = "";
counts->udp++;
- } else if (entry.proto == "icmp") {
- typecode.str("");
- typecode << (int)nfct_get_attr_u8(ct, ATTR_ICMP_TYPE) << "/"
+ } else if (entry.proto == "icmp" || entry.proto == "icmp6") {
+ buffer.str("");
+ buffer << (int)nfct_get_attr_u8(ct, ATTR_ICMP_TYPE) << "/"
<< (int)nfct_get_attr_u8(ct, ATTR_ICMP_CODE) << " ("
<< nfct_get_attr_u16(ct, ATTR_ICMP_ID) << ")";
- entry.state = typecode.str();
+ entry.state = buffer.str();
counts->icmp++;
+ if (entry.state.size() > max->state)
+ max->state = entry.state.size();
} else {
counts->other++;
}
@@ -1411,16 +1428,30 @@
ostringstream buffer;
bool have_port = table.proto == "tcp" || table.proto == "udp";
char direction;
+ unsigned int length;
- int length;
- if (table.sname.size() + table.spname.size() + 1 > max.src) {
- length = max.src - 1 - table.spname.size();
+ // What length would we currently use?
+ length = table.sname.size();
+ if (have_port)
+ length += table.spname.size() + 1;
+
+ // If it's too long, figure out how room we have and truncate it
+ if (length > max.src) {
+ length = max.src;
+ if (have_port)
+ length -= 1 + table.spname.size();
direction = (flags.lookup) ? 'e' : 'f';
truncate(table.sname, length, flags.tag_truncate, direction);
}
- if (table.dname.size() + table.dpname.size() + 1 > max.dst) {
- length = max.dst - 1 - table.dpname.size();
+ // ... and repeat
+ length = table.dname.size();
+ if (have_port)
+ length += table.dpname.size() + 1;
+ if (length > max.dst) {
+ length = max.dst;
+ if (have_port)
+ length -= 1 + table.dpname.size();
direction = (flags.lookup) ? 'f' : 'e';
truncate(table.dname, length, flags.tag_truncate, direction);
}
@@ -1473,7 +1504,7 @@
color = 1;
else if (table.proto == "udp")
color = 2;
- else if (table.proto == "icmp")
+ else if (table.proto == "icmp" || table.proto == "icmp6")
color = 3;
if (curr)
color += 4;
|
|
From: Phil D. <ja...@us...> - 2012-06-01 08:00:49
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv9434 Modified Files: LICENSE Makefile iptstate.cc Log Message: make copyright 'until present' Signed-off-by: Phil Dibowitz <ph...@ip...> Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- iptstate.cc 1 Jun 2012 07:53:37 -0000 1.26 +++ iptstate.cc 1 Jun 2012 08:00:46 -0000 1.27 @@ -6,7 +6,7 @@ * * ----------------------------------- * - * Copyright (C) 2002 - 2012 Phil Dibowitz + * Copyright (C) 2002 - present Phil Dibowitz * * This software is provided 'as-is', without any express or * implied warranty. In no event will the authors be held Index: Makefile =================================================================== RCS file: /cvsroot/iptstate/iptstate/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 19 Sep 2009 16:49:00 -0000 1.12 +++ Makefile 1 Jun 2012 08:00:46 -0000 1.13 @@ -1,5 +1,5 @@ # -# Copyright (C) 2002 - 2009 Phil Dibowitz. +# Copyright (C) 2002 - present Phil Dibowitz. # # See iptstate.cc for copyright info # Index: LICENSE =================================================================== RCS file: /cvsroot/iptstate/iptstate/LICENSE,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- LICENSE 19 Sep 2009 16:49:00 -0000 1.7 +++ LICENSE 1 Jun 2012 08:00:46 -0000 1.8 @@ -1,6 +1,6 @@ IP Tables State (iptstate) - Copyright (C) 2002 - 2009 Phil Dibowitz + Copyright (C) 2002 - present Phil Dibowitz This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held |
|
From: Phil D. <ja...@us...> - 2012-06-01 07:56:12
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv8146 Modified Files: Changelog Log Message: Missed a changelog entry; Signed-off-by: Phil Dibowitz <ph...@ip...> Index: Changelog =================================================================== RCS file: /cvsroot/iptstate/iptstate/Changelog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Changelog 1 Jun 2012 07:53:37 -0000 1.17 +++ Changelog 1 Jun 2012 07:56:10 -0000 1.18 @@ -2,6 +2,7 @@ - Released 06/01/12 - Improved IPv6 support - truncate addresses if they don't fit and generally treat them like hostnames at display time +- CONTRIB and man page fixes (Chris Taylor <ct...@de...>) 2.2.3 - Released 04/03/11 |
|
From: Phil D. <ja...@us...> - 2012-06-01 07:53:39
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv7929
Modified Files:
Changelog iptstate.cc iptstate.spec
Log Message:
version bump
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.spec
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- iptstate.spec 4 Apr 2011 06:00:47 -0000 1.11
+++ iptstate.spec 1 Jun 2012 07:53:37 -0000 1.12
@@ -1,5 +1,5 @@
%define name iptstate
-%define version 2.2.3
+%define version 2.2.4
%define release 1
Name: %{name}
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- iptstate.cc 1 Jun 2012 07:50:13 -0000 1.25
+++ iptstate.cc 1 Jun 2012 07:53:37 -0000 1.26
@@ -6,7 +6,7 @@
*
* -----------------------------------
*
- * Copyright (C) 2002 - 2011 Phil Dibowitz
+ * Copyright (C) 2002 - 2012 Phil Dibowitz
*
* This software is provided 'as-is', without any express or
* implied warranty. In no event will the authors be held
@@ -63,7 +63,7 @@
#include <unistd.h>
using namespace std;
-#define VERSION "2.2.3"
+#define VERSION "2.2.4"
/*
* MAXCONS is set to 16k, the default number of states in iptables. Generally
* speaking the ncurses pad is this many lines long, but since ncurses
Index: Changelog
===================================================================
RCS file: /cvsroot/iptstate/iptstate/Changelog,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Changelog 4 Apr 2011 06:00:47 -0000 1.16
+++ Changelog 1 Jun 2012 07:53:37 -0000 1.17
@@ -1,3 +1,8 @@
+2.2.4
+- Released 06/01/12
+- Improved IPv6 support - truncate addresses if they don't fit and generally
+ treat them like hostnames at display time
+
2.2.3
- Released 04/03/11
- IPv6 support. Closes #2848930.
|
|
From: Phil D. <ja...@us...> - 2012-06-01 07:50:16
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv7674
Modified Files:
iptstate.cc
Log Message:
Rework how we do truncation and formatting of src/dst to handle ip addresses
the same way we do names (so that we can handle long ipv6 addresses in small
windows)
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- iptstate.cc 4 Apr 2011 06:00:47 -0000 1.24
+++ iptstate.cc 1 Jun 2012 07:50:13 -0000 1.25
@@ -336,14 +336,51 @@
}
}
-void resolve_names(table_t &entry, max_t &max)
+/*
+ * If lookup mode is on, we lookup the names and put them in the structure.
+ *
+ * If lookup mode is not on, we generate strings of the addresses and put
+ * those in the structure.
+ *
+ * Finally, we update the max_t structure.
+ *
+ * NOTE: We stringify addresses largely because in the IPv6 case we need
+ * to treat them like truncate-able strings.
+ */
+void stringify_entry(table_t &entry, max_t &max, const flags_t &flags)
{
unsigned int size = 0;
+ ostringstream buffer;
+ char tmp[NAMELEN];
- resolve_host(entry.family, entry.src, entry.sname);
- resolve_host(entry.family, entry.dst, entry.dname);
- resolve_port(entry.srcpt, entry.spname, entry.proto);
- resolve_port(entry.dstpt, entry.dpname, entry.proto);
+ bool have_port = entry.proto == "tcp" || entry.proto == "udp";
+ if (!have_port) {
+ entry.spname = entry.dpname = "";
+ }
+
+ if (flags.lookup) {
+ resolve_host(entry.family, entry.src, entry.sname);
+ resolve_host(entry.family, entry.dst, entry.dname);
+ if (have_port) {
+ resolve_port(entry.srcpt, entry.spname, entry.proto);
+ resolve_port(entry.dstpt, entry.dpname, entry.proto);
+ }
+ } else {
+ buffer << inet_ntop(entry.family, (void*)&entry.src, tmp, NAMELEN-1);
+ entry.sname = buffer.str();
+ buffer.str("");
+ buffer << inet_ntop(entry.family, (void*)&entry.dst, tmp, NAMELEN-1);
+ entry.dname = buffer.str();
+ buffer.str("");
+ if (have_port) {
+ buffer << entry.srcpt;
+ entry.spname = buffer.str();
+ buffer.str("");
+ buffer << entry.dstpt;
+ entry.dpname = buffer.str();
+ buffer.str("");
+ }
+ }
size = entry.sname.size() + entry.spname.size() + 1;
if (size > max.src)
@@ -352,29 +389,6 @@
size = entry.dname.size() + entry.dpname.size() + 1;
if (size > max.dst)
max.dst = size;
-
-}
-
-
-/*
- * Based on the format pre-chosen, truncate src/dst as needed.
- */
-void truncate(table_t &table, const max_t &max, const flags_t &flags)
-{
- int length;
- if (table.sname.size() + table.spname.size() + 1 > max.src) {
- length = max.src - 1 - table.spname.size();
- table.sname = table.sname.substr(0, length);
- if (flags.tag_truncate)
- table.sname[table.sname.size()-1] = '+';
- }
-
- if (table.dname.size() + table.dpname.size() + 1 > max.dst) {
- length = max.dst - 1 - table.dpname.size();
- table.dname = table.dname.substr(0, length);
- if (flags.tag_truncate)
- table.dname[0] = '+';
- }
}
@@ -791,7 +805,8 @@
max.src = max.dst = 21;
}
/*
- * The proto header is 5, so we can't drop below 6.
+ * The proto starts at 3, since tcp/udp are the most common, but will
+ * grow if we see bigger proto strings such as "ICMP".
*/
max.proto = 3;
/*
@@ -1093,12 +1108,12 @@
}
/*
- * RESOLVE AND TRUNCATE
+ * RESOLVE
*/
- // Resolve Names if we need to
- if (flags->lookup)
- resolve_names(entry,*max);
+ // Resolve names - if necessary - or generate strings of address,
+ // and calculate max sizes
+ stringify_entry(entry, *max, *flags);
/*
* Add this to the array
@@ -1373,6 +1388,55 @@
}
+
+void truncate(string &string, int length, bool mark, char direction)
+{
+ int s = (direction == 'f') ? string.size() - length : 0;
+
+ string = string.substr(s, length);
+ if (mark) {
+ int m = (direction == 'f') ? 0 : string.size() - 1;
+ string[m] = '+';
+ }
+}
+
+/*
+ * Based on the format pre-chosen, truncate src/dst as needed, and then
+ * generate the host:port strings and drop them off in the src/dst string
+ * objects passed in.
+ */
+void format_src_dst(table_t &table, string &src, string &dst,
+ const flags_t &flags, const max_t &max)
+{
+ ostringstream buffer;
+ bool have_port = table.proto == "tcp" || table.proto == "udp";
+ char direction;
+
+ int length;
+ if (table.sname.size() + table.spname.size() + 1 > max.src) {
+ length = max.src - 1 - table.spname.size();
+ direction = (flags.lookup) ? 'e' : 'f';
+ truncate(table.sname, length, flags.tag_truncate, direction);
+ }
+
+ if (table.dname.size() + table.dpname.size() + 1 > max.dst) {
+ length = max.dst - 1 - table.dpname.size();
+ direction = (flags.lookup) ? 'f' : 'e';
+ truncate(table.dname, length, flags.tag_truncate, direction);
+ }
+
+ buffer << table.sname;
+ if (have_port)
+ buffer << ":" << table.spname;
+ src = buffer.str();
+ buffer.str("");
+ buffer << table.dname;
+ if (have_port)
+ buffer << ":" << table.dpname;
+ dst = buffer.str();
+ buffer.str("");
+}
+
/*
* An abstraction of priting a line for both single/curses modes
*/
@@ -1382,37 +1446,9 @@
ostringstream buffer;
buffer.str("");
string src, dst, b, p;
- char tmp[NAMELEN];
- if (flags.lookup)
- truncate(table, max, flags);
-
- if (table.proto == "tcp" || table.proto == "udp") {
- if (flags.lookup && (table.sname != ""))
- buffer << table.sname << ":" << table.spname;
- else
- buffer << inet_ntop(table.family, (void*)&table.src, tmp, NAMELEN-1)
- << ":" << table.srcpt;
- src = buffer.str();
- buffer.str("");
- if (flags.lookup && (table.dname != "")) {
- buffer << table.dname << ":" << table.dpname;
- } else {
- buffer << inet_ntop(table.family, (void*)&table.dst, tmp, NAMELEN-1)
- << ":" << table.dstpt;
- }
- dst = buffer.str();
- buffer.str("");
- } else {
- if (flags.lookup && (table.sname != ""))
- src = table.sname;
- else
- src = inet_ntop(table.family, (void*)&table.src, tmp, NAMELEN-1);
- if (flags.lookup && (table.dname != ""))
- dst = table.dname;
- else
- dst = inet_ntop(table.family, (void*)&table.dst, tmp, NAMELEN-1);
- }
+ // Generate strings for src/dest, truncating and marking as necessary
+ format_src_dst(table, src, dst, flags, max);
if (flags.counters) {
buffer << table.bytes;
@@ -2553,8 +2589,7 @@
wclrtoeol(mainwin);
break;
case 'x':
- delete_state(mainwin, stable[curr_state],
- flags);
+ delete_state(mainwin, stable[curr_state], flags);
break;
/*
* Window navigation
|
|
From: Phil D. <ja...@us...> - 2011-04-06 07:39:35
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv31808 Modified Files: CONTRIB iptstate.8 Log Message: CONTRIB: - update Debian maintainer iptstate.8 - some fixes to the man page Both changes come from Debian downstream changes, maintained by Chris Taylor <ct...@de...> Signed-off-by: Phil Dibowitz <ph...@ip...> Index: iptstate.8 =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.8,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- iptstate.8 4 Apr 2011 06:00:47 -0000 1.4 +++ iptstate.8 6 Apr 2011 07:39:32 -0000 1.5 @@ -60,7 +60,7 @@ Reverse sort order .TP .B -R, --rate \fIseconds\fP -Refresh rate, followed by rate in \fIseconds\fP. Note that this is for statetop mode, and not applicable for single-run mode (--single). +Refresh rate, followed by rate in \fIseconds\fP. Note that this is for statetop mode, and not applicable for single-run mode (\-\-single). .TP .B -1, --single Single run (no curses) @@ -92,7 +92,7 @@ .B " P" Packets .br -To sort by Source IP (or Name), don't use -b. Sorting by bytes/packets is only available for kernels that support it, and only when compiled against libnetfilter_conntrack (the default). +To sort by Source IP (or Name), don't use \-b. Sorting by bytes/packets is only available for kernels that support it, and only when compiled against libnetfilter_conntrack (the default). .TP .B -s, --src-filter \fIIP\fP Only show states with a source of \fIIP\fP. Note, that this must be an IP, hostname matching is not yet supported. Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- CONTRIB 5 Apr 2011 15:34:23 -0000 1.13 +++ CONTRIB 6 Apr 2011 07:39:32 -0000 1.14 @@ -22,7 +22,7 @@ _please_ pass on bugs to me! Mandriva: Garrick Staples -Debian: Brian Nelson +Debian: Chris Taylor (was: Brian Nelson) Gentoo: (was: Eldad Zack) ALT Linux: Victor Forsyuk floppyfw: Cristian Ionescu-Idbohrn |
|
From: Phil D. <ja...@us...> - 2011-04-05 15:34:25
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv25677 Modified Files: CONTRIB Log Message: Updating Slackware contributor info s/email/name/ Signed-off-by: Phil Dibowitz <ph...@ip...> Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- CONTRIB 4 Apr 2011 15:39:46 -0000 1.12 +++ CONTRIB 5 Apr 2011 15:34:23 -0000 1.13 @@ -32,7 +32,7 @@ OpenEmbedded: Jamie Lenehen ArchLinux (community repo): Andrea Zucchelli ipcop: Franck Bourdonnec -Slackware (slackers.it repo): co...@gm... +Slackware (slackers.it repo): Corrado Franco OTHER Some people who helped me get this project started were Jullian Gomez, |
|
From: Phil D. <ja...@us...> - 2011-04-04 15:39:49
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv9238 Modified Files: CONTRIB Log Message: another maintainer Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CONTRIB 11 Nov 2009 09:41:30 -0000 1.11 +++ CONTRIB 4 Apr 2011 15:39:46 -0000 1.12 @@ -32,6 +32,7 @@ OpenEmbedded: Jamie Lenehen ArchLinux (community repo): Andrea Zucchelli ipcop: Franck Bourdonnec +Slackware (slackers.it repo): co...@gm... OTHER Some people who helped me get this project started were Jullian Gomez, |
|
From: Phil D. <ja...@us...> - 2011-04-04 06:00:49
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv9435
Modified Files:
BUGS Changelog README WISHLIST iptstate.8 iptstate.cc
iptstate.spec
Log Message:
- lots of documentation updates
- version bump
Index: iptstate.spec
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- iptstate.spec 19 Sep 2009 21:07:02 -0000 1.10
+++ iptstate.spec 4 Apr 2011 06:00:47 -0000 1.11
@@ -1,5 +1,5 @@
%define name iptstate
-%define version 2.2.2
+%define version 2.2.3
%define release 1
Name: %{name}
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- iptstate.cc 4 Apr 2011 05:42:28 -0000 1.23
+++ iptstate.cc 4 Apr 2011 06:00:47 -0000 1.24
@@ -63,7 +63,7 @@
#include <unistd.h>
using namespace std;
-#define VERSION "2.2.2"
+#define VERSION "2.2.3"
/*
* MAXCONS is set to 16k, the default number of states in iptables. Generally
* speaking the ncurses pad is this many lines long, but since ncurses
Index: Changelog
===================================================================
RCS file: /cvsroot/iptstate/iptstate/Changelog,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- Changelog 4 Apr 2011 05:42:28 -0000 1.15
+++ Changelog 4 Apr 2011 06:00:47 -0000 1.16
@@ -1,8 +1,12 @@
2.2.3
+- Released 04/03/11
- IPv6 support. Closes #2848930.
- Handle filters as in6_addr and uints instead of strings
- Fix loopback filtering support
- Fix formatting for ICMP states. Closes #2969917.
+- Total style overhaul: move away from tabs, use 2 spaces, various other style
+ cleanups
+- Documentation updates
2.2.2
- Released 09/19/09
Index: iptstate.8
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.8,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- iptstate.8 19 Sep 2009 16:49:00 -0000 1.3
+++ iptstate.8 4 Apr 2011 06:00:47 -0000 1.4
@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii iptstate.8
.\"
-.TH IPTSTATE 8 "SEPTEMBER 2009" "" ""
+.TH IPTSTATE 8 "APRIL 2011" "" ""
.\"
.\" Man page written by Phil Dibowitz <phil AT ipom DOT com>
.\"
@@ -161,7 +161,7 @@
Terminal too narrow
.SH BUGS
-There are no known bugs at this time.
+We don't support filtering on resolved names, and we don't support filtering on networks. IPv6 support is new and the dynamic formatting doesn't yet always handle IPv6 addresses as well as it should.
.SH BUG REPORTS
All bugs should be reported to Phil Dibowitz <phil AT ipom DOT com>. Please see the \fBREADME\fR and \fBBUGS\fR for more information on bug reports. Please read the \fBWISHLIST\fR before sending in features you hope to see.
Index: BUGS
===================================================================
RCS file: /cvsroot/iptstate/iptstate/BUGS,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- BUGS 19 Sep 2009 16:49:00 -0000 1.8
+++ BUGS 4 Apr 2011 06:00:47 -0000 1.9
@@ -1,30 +1,30 @@
IPTState Bugs
KNOWN BUGS
-None*
-
-* There are no known bugs in the iptstate code at the time of this writing.
-However, there are bugs in other pieces of software that may affect your
-iptstate experience:
+We keep track of bugs in our bugtracker on our Sourceforge page. However, before
+filing bugs, be aware of bugs in these other pieces of software that may affect
+your iptstate experience:
- libnetfilter_conntrack 0.0.50 has a bug that prevents iptstate from
-deleting ICMP states. I wrote the following patch which the netfilter folks
-have already applied to their SVN tree:
- http://www.phildev.net/linux/patches/libnetfilter_conntrack-0.0.50_icmp_id.patch
-You can use it if this affects you.
+ deleting ICMP states. I wrote the following patch which the netfilter folks
+ have already applied to their SVN tree:
+ http://www.phildev.net/linux/patches/libnetfilter_conntrack-0.0.50_icmp_id.patch
+ You can use it if this affects you.
- There seems to be a small memory leak somewhere in ncurses. See
- http://www.phildev.net/iptstate/memleak.html
-for details. This won't effect most users much, but you want to be weary of
-leaving iptstate running on very busy firewalls for very long periods of time
-(a day or more). This bug has been reported to ncurses, see above URL.
+ http://www.phildev.net/iptstate/memleak.html
+ for details. This won't effect most users much, but you want to be weary of
+ leaving iptstate running on very busy firewalls for very long periods of time
+ (a day or more). This bug has been reported to ncurses, see above URL.
ABOUT BUGS
If you find a bug in IPTState you should file a bug at our bugtracker:
https://sourceforge.net/tracker/?group_id=52748&atid=467897
OR mail our -devel list:
https://lists.sourceforge.net/lists/listinfo/iptstate-devel
-OR email me at phil AT ipom DOT com.
+
+If you are unsure if it's a bug or need support, please use the -devel mailing
+list.
Sending a bug to your distro or some public forum is not going to let me know.
I can't fix things I don't know about. So make sure I know!
@@ -35,29 +35,28 @@
If it's a very minor bug, or a feature request, I'll respond as I have time.
ABOUT PATCHES
-Patches are not necessary, but if you submit one remember: PATCHES SHOULD BE
-ACCOMPANIED BY EXPLINATIONS AND/OR BUG REPORTS! Let me know what you were
-trying to fix/add and how you did it. This will save me a lot of time, and I'll
-like you more.
+Patches are welcome but not necessary. I will fix bugs, don't worry. If you
+would like to contribute code, PLEASE use consistent style to the rest of the
+code. If you send a patch, it should be accompanied with a good explanation of
+what it does and why. If it fixes a bug, it should also be accompanied by a
+bug report in our bug tracker.
ABOUT BUG REPORTS
-If you send me a bug report you MUST do the following:
- - Include "IPTSTATE" in the subject
- - Include your iptstate version
- - Include your distribution and distribution version
- - Include your kernel version
- - Include your g++ version
- - Include your make version
- - Include your glibc version
- - Include your ncurses version
- - Include your libnetfilter_conntrack version
- - Include any relevant output and/or errors
+Please be sure to include these things in bug reports:
+ - your iptstate version
+ - your distribution and distribution version
+ - your kernel version
+ - your g++ version (if you built it yourself)
+ - your make version (if you built it yourself)
+ - your glibc version (if you built it yourself)
+ - your ncurses version
+ - your libnetfilter_conntrack version
+ - any relevant output and/or errors
-Bug reports should be sent to *ME* (see above). I cannot fix your bugs if you
-don't tell *ME* about them. That's right, send your bug reports to *ME*.
+Once again, distributions don't always forward bug reports upstream, so
+please send bug reports to me if you want bugs fixed.
Thanks!
Phil Dibowitz
phil AT ipom DOT com
-
Index: README
===================================================================
RCS file: /cvsroot/iptstate/iptstate/README,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- README 19 Sep 2009 16:49:00 -0000 1.11
+++ README 4 Apr 2011 06:00:47 -0000 1.12
@@ -34,12 +34,8 @@
it (i.e. ncurses-dev).
Starting with version 2.2.0 you also need libnetfilter_conntrack version
- 0.0.50 or later. If you do not have libnetfilter_conntrack you can compile
- iptstate to use /proc/net/ip_conntrack (what it did prior to 2.2.0) instead.
- To do this, modify the Makefile and switch the LIBS and CPPFLAGS lines with
- the commented-out ones. Note that this backwards compatibility is temporary
- and will be removed in future versions.
-
+ 0.0.50 or later. These libraries also require nf_conntrack_netlink and
+ nfnetlink support in your kernel.
3. INSTALLATION
@@ -151,11 +147,10 @@
7. THE AUTHOR
- IPTState was written by me, Phil Dibowitz. I am a Senior UNIX
- Systems Administrator at Ticketmaster maintaining the web
- infrastructure. Additionally, I maintain the FAQ for IP Filter,
- run the MSS Initiative, document IP Filter, and do other open-source
- work. For more info on me, check out http://www.phildev.net/
+ IPTState was written by me, Phil Dibowitz. My day job is large-scale
+ system administration and automation. Outside of work I maintain several
+ open source projects. You can find out more about me at
+ http://www.phildev.net/
Phil Dibowitz
Index: WISHLIST
===================================================================
RCS file: /cvsroot/iptstate/iptstate/WISHLIST,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- WISHLIST 2 Sep 2009 20:16:21 -0000 1.8
+++ WISHLIST 4 Apr 2011 06:00:47 -0000 1.9
@@ -1,11 +1,12 @@
IPTSTATE WISHLIST
-This is the wishlist. READ IT BEFORE EMAILING ME.
+Wishlist features should be filed in the Wishlist tracker on our sourceforge page.
+
+This is an overview of the common ones and where they are on the priority list.
Features coming soon:
- Filtering hostnames
- Inverse filtering
- Display NAT'd IP
-- IPV6 support
Features that may come later:
- Secondary sorting
|
|
From: Phil D. <ja...@us...> - 2011-04-04 05:42:30
|
Update of /cvsroot/iptstate/iptstate In directory vz-cvs-4.sog:/tmp/cvs-serv5713 Modified Files: Changelog iptstate.cc Log Message: - move from tabs to spaces, collapsing tabs to 2 spaces - lots of style cleanups Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- iptstate.cc 4 Apr 2011 04:55:15 -0000 1.22 +++ iptstate.cc 4 Apr 2011 05:42:28 -0000 1.23 @@ -1,12 +1,12 @@ /* - * vim:textwidth=78: + * vim:textwidth=80:tabstop=2:shiftwidth=2:expandtab:ai * * iptstate.cc * IPTables State * * ----------------------------------- * - * Copyright (C) 2002 - 2009 Phil Dibowitz + * Copyright (C) 2002 - 2011 Phil Dibowitz [...4772 lines suppressed...] - out: + out: - /* - * The user has broken out of the loop, take down the curses - */ - end_curses(); + /* + * The user has broken out of the loop, take down the curses + */ + end_curses(); - // And we're done - return(0); + // And we're done + return(0); } // end main - Index: Changelog =================================================================== RCS file: /cvsroot/iptstate/iptstate/Changelog,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Changelog 4 Apr 2011 04:55:14 -0000 1.14 +++ Changelog 4 Apr 2011 05:42:28 -0000 1.15 @@ -1,7 +1,8 @@ 2.2.3 -- IPv6 support +- IPv6 support. Closes #2848930. - Handle filters as in6_addr and uints instead of strings - Fix loopback filtering support +- Fix formatting for ICMP states. Closes #2969917. 2.2.2 - Released 09/19/09 |
|
From: Phil D. <ja...@us...> - 2011-04-04 04:55:17
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv30276
Modified Files:
Changelog iptstate.cc
Log Message:
- Fix formatting issue with ICMP states. Closes #2969917
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- iptstate.cc 4 Apr 2011 03:07:52 -0000 1.21
+++ iptstate.cc 4 Apr 2011 04:55:15 -0000 1.22
@@ -996,6 +996,9 @@
sizeof(uint8_t[16]));
memcpy(entry.dst.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV6_DST),
sizeof(uint8_t[16]));
+ } else {
+ fprintf(stderr, "UNKNOWN FAMILY!\n");
+ exit(1);
}
// Counters (summary, in + out)
@@ -1011,6 +1014,9 @@
max->packets = digits(entry.packets);
}
+ if (entry.proto.size() > max->proto)
+ max->proto = entry.proto.size();
+
// OK, proto dependent stuff
if (entry.proto == "tcp" || entry.proto == "udp") {
entry.srcpt = htons(
@@ -1020,39 +1026,23 @@
}
if (entry.proto == "tcp") {
-
entry.state =
states[nfct_get_attr_u8(ct, ATTR_TCP_STATE)];
counts->tcp++;
-
} else if (entry.proto == "udp") {
-
entry.state = "";
counts->udp++;
-
} else if (entry.proto == "icmp") {
-
typecode.str("");
typecode << (int)nfct_get_attr_u8(ct, ATTR_ICMP_TYPE)
<< "/" << (int)nfct_get_attr_u8(ct, ATTR_ICMP_CODE)
<< " (" << nfct_get_attr_u16(ct, ATTR_ICMP_ID)
<< ")";
-
entry.state = typecode.str();
counts->icmp++;
-
} else {
- /*
- * If the protocol is something else, then we need
- * to know how long the name of the protocol is so
- * we can format accordingly later.
- */
- if (entry.proto.size() > max->proto)
- max->proto = entry.proto.size();
-
counts->other++;
-
}
/*
Index: Changelog
===================================================================
RCS file: /cvsroot/iptstate/iptstate/Changelog,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- Changelog 19 Sep 2009 21:07:02 -0000 1.13
+++ Changelog 4 Apr 2011 04:55:14 -0000 1.14
@@ -1,3 +1,8 @@
+2.2.3
+- IPv6 support
+- Handle filters as in6_addr and uints instead of strings
+- Fix loopback filtering support
+
2.2.2
- Released 09/19/09
- Fix includes
|
|
From: Phil D. <ja...@us...> - 2011-04-04 03:07:55
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv10139
Modified Files:
iptstate.cc
Log Message:
- convert filters ti in6_addr/uint instead of strings
- better input checking on filters
- a few ipv6 fixes
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- iptstate.cc 3 Apr 2011 23:28:15 -0000 1.20
+++ iptstate.cc 4 Apr 2011 03:07:52 -0000 1.21
@@ -157,7 +157,9 @@
};
// Various filters to be applied pending the right flags in flags_t
struct filters_t {
- string src, dst, srcpt, dstpt;
+ in6_addr src, dst;
+ uint8_t srcfam, dstfam;
+ unsigned long srcpt, dstpt;
};
// The max-length of fields in the stable table
struct max_t {
@@ -221,14 +223,20 @@
/*
* Check to ensure an IP is valid
*/
-bool check_ip(const char *arg)
+bool check_ip(const char *arg, in6_addr *addr, uint8_t *family)
{
- in6_addr tmp_addr;
- if (inet_pton(AF_INET6, arg, &tmp_addr) == 0 &&
- inet_pton(AF_INET, arg, &tmp_addr) == 0) {
- return false;
+ int ret;
+ ret = inet_pton(AF_INET6, arg, addr);
+ if (ret) {
+ *family = AF_INET6;
+ return true;
}
- return true;
+ ret = inet_pton(AF_INET, arg, addr);
+ if (ret) {
+ *family = AF_INET;
+ return true;
+ }
+ return false;
}
/*
@@ -1052,22 +1060,19 @@
*/
/*
- * FIXME: There's some awesome stupidity here. But it's here
- * for a reason. filters.* should be real ints
- * or inet_addrs as necessary, but if we do that
- * we'll break the #ifdef'd code below that's there for
- * backwards compatibility. Once we nuke that code
- * we make this MUCH cleaner.
- *
- * FIXME: Also, filtering can probably be pulled out to
- * it's own function once the other copy of build_table()
- * is gone.
+ * FIXME: Filtering needs to be pulled into it's own function.
*/
- char src[NAMELEN], dst[NAMELEN];
- inet_ntop(entry.family, (void*)&entry.src, src, NAMELEN-1);
- inet_ntop(entry.family, (void*)&entry.dst, dst, NAMELEN-1);
- if (flags->skiplb && !strcmp(src, "127.0.0.1")
- && !strcmp(src, "::1/128")) {
+ struct in_addr lb;
+ struct in6_addr lb6;
+ inet_pton(AF_INET, "127.0.0.1", &lb);
+ inet_pton(AF_INET6, "::1", &lb6);
+ size_t entrysize = entry.family == AF_INET
+ ? sizeof(in_addr)
+ : sizeof(in6_addr);
+ if (flags->skiplb &&
+ (entry.family == AF_INET
+ ? !memcmp(&entry.src, &lb, sizeof(in_addr))
+ : !memcmp(&entry.src, &lb6, sizeof(in6_addr)))) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1077,24 +1082,26 @@
return NFCT_CB_CONTINUE;
}
- if (flags->filter_src && strcmp(src, filters->src.c_str())) {
+ if (flags->filter_src &&
+ (memcmp(&entry.src, &(filters->src), entrysize))) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
if (flags->filter_srcpt
- && (entry.srcpt != (unsigned int)atoi(filters->srcpt.c_str()))) {
+ && (entry.srcpt != filters->srcpt)) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
- if (flags->filter_dst && strcmp(dst, filters->dst.c_str())) {
+ if (flags->filter_dst &&
+ (memcmp(&entry.dst, &(filters->dst), entrysize))) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
if (flags->filter_dstpt
- && (entry.dstpt != (unsigned int)atoi(filters->dstpt.c_str()))) {
+ && (entry.dstpt != filters->dstpt)) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1307,6 +1314,7 @@
/*
* If any, print filters
*/
+ char tmp[NAMELEN];
if (flags.filter_src || flags.filter_dst || flags.filter_srcpt
|| flags.filter_dstpt) {
@@ -1321,10 +1329,11 @@
bool printed_a_filter = false;
if (flags.filter_src) {
+ inet_ntop(filters.srcfam, &filters.src, tmp,
+ NAMELEN-1);
(flags.single)
- ? printf("src: %s", filters.src.c_str())
- : wprintw(mainwin, "src: %s",
- filters.src.c_str());
+ ? printf("src: %s", tmp)
+ : wprintw(mainwin, "src: %s", tmp);
printed_a_filter = true;
}
if (flags.filter_srcpt) {
@@ -1334,9 +1343,9 @@
: waddstr(mainwin, ", ");
}
(flags.single)
- ? printf("sport: %s", filters.srcpt.c_str())
- : wprintw(mainwin, "sport: %s",
- filters.srcpt.c_str());
+ ? printf("sport: %lu", filters.srcpt)
+ : wprintw(mainwin, "sport: %lu",
+ filters.srcpt);
printed_a_filter = true;
}
if (flags.filter_dst) {
@@ -1345,10 +1354,11 @@
? printf(", ")
: waddstr(mainwin, ", ");
}
+ inet_ntop(filters.dstfam, &filters.dst, tmp,
+ NAMELEN-1);
(flags.single)
- ? printf("dst: %s", filters.dst.c_str())
- : wprintw(mainwin, "dst: %s",
- filters.dst.c_str());
+ ? printf("dst: %s", tmp)
+ : wprintw(mainwin, "dst: %s", tmp);
printed_a_filter = true;
}
if (flags.filter_dstpt) {
@@ -1358,9 +1368,9 @@
: waddstr(mainwin, ", ");
}
(flags.single)
- ? printf("dport: %s", filters.dstpt.c_str())
- : wprintw(mainwin, "dport: %s",
- filters.dstpt.c_str());
+ ? printf("dport: %lu", filters.dstpt)
+ : wprintw(mainwin, "dport: %lu",
+ filters.dstpt);
printed_a_filter = true;
}
(flags.single)
@@ -1828,28 +1838,35 @@
waddstr(helpwin,(flags.counters) ? "yes" : "no");
wattroff(helpwin, A_BOLD);
+ char tmp[NAMELEN];
if (flags.filter_src) {
+ inet_ntop(filters.srcfam, &filters.src, tmp,
+ filters.srcfam == AF_INET ? sizeof(in_addr)
+ : sizeof(in6_addr));
mvwaddstr(helpwin, y++, x, " Source filter: ");
wattron(helpwin, A_BOLD);
- waddstr(helpwin, filters.src.c_str());
+ waddstr(helpwin, tmp);
wattroff(helpwin, A_BOLD);
}
if (flags.filter_dst) {
+ inet_ntop(filters.dstfam, &filters.dst, tmp,
+ filters.dstfam == AF_INET ? sizeof(in_addr)
+ : sizeof(in6_addr));
mvwaddstr(helpwin, y++, x, " Destination filter: ");
wattron(helpwin, A_BOLD);
- waddstr(helpwin, filters.dst.c_str());
+ waddstr(helpwin, tmp);
wattroff(helpwin, A_BOLD);
}
if (flags.filter_srcpt) {
mvwaddstr(helpwin, y++, x, " Source port filter: ");
wattron(helpwin, A_BOLD);
- waddstr(helpwin, filters.srcpt.c_str());
+ wprintw(helpwin, "%lu", filters.srcpt);
wattroff(helpwin, A_BOLD);
}
if (flags.filter_dstpt) {
mvwaddstr(helpwin, y++, x, " Destination port filter: ");
wattron(helpwin, A_BOLD);
- waddstr(helpwin, filters.dstpt.c_str());
+ wprintw(helpwin, "%lu", filters.dstpt);
wattroff(helpwin, A_BOLD);
}
@@ -2138,7 +2155,8 @@
ssize.x = ssize.y = 0;
counts.tcp = counts.udp = counts.icmp = counts.other = counts.skipped
= 0;
- filters.src = filters.dst = filters.srcpt = filters.dstpt = "";
+ filters.src = filters.dst = in6addr_any;
+ filters.srcpt = filters.dstpt = 0;
max.src = max.dst = max.proto = max.state = max.ttl = 0;
px = py = 0;
@@ -2197,13 +2215,12 @@
if (optarg == NULL)
break;
// See check_ip() note above
- if (!check_ip(optarg)) {
+ if (!check_ip(optarg, &filters.dst, &filters.dstfam)) {
cerr << "Invalid IP address: " << optarg
<< endl;
exit(1);
}
flags.filter_dst = true;
- filters.dst = optarg;
break;
// --dstpt-filter
case 'D':
@@ -2215,7 +2232,7 @@
if (optarg == NULL)
break;
flags.filter_dstpt = true;
- filters.dstpt = optarg;
+ filters.dstpt = atoi(optarg);
break;
// --help
case 'h':
@@ -2286,20 +2303,19 @@
case 's':
if (optarg == NULL)
break;
- if (!check_ip(optarg)) {
+ if (!check_ip(optarg, &filters.src, &filters.srcfam)) {
cerr << "Invalid IP address: " << optarg
<< endl;
exit(1);
}
flags.filter_src = true;
- filters.src = optarg;
break;
// --srcpt-filter
case 'S':
if (optarg == NULL)
break;
flags.filter_srcpt = true;
- filters.srcpt = optarg;
+ filters.srcpt = atoi(optarg);
break;
// --totals
case 't':
@@ -2528,15 +2544,16 @@
get_input(mainwin, tmpstring, prompt, flags);
if (tmpstring == "") {
flags.filter_dst = false;
- filters.dst = "";
+ filters.dst = in6addr_any;
} else {
- if (!check_ip(tmpstring.c_str())) {
+ if (!check_ip(tmpstring.c_str(),
+ &filters.dst,
+ &filters.dstfam)) {
prompt = "Invalid IP,";
prompt += " ignoring!";
c_warn(mainwin, prompt, flags);
} else {
flags.filter_dst = true;
- filters.dst = tmpstring;
}
}
break;
@@ -2546,10 +2563,10 @@
get_input(mainwin, tmpstring, prompt, flags);
if (tmpstring == "") {
flags.filter_dstpt = false;
- filters.dstpt = "";
+ filters.dstpt = 0;
} else {
flags.filter_dstpt = true;
- filters.dstpt = tmpstring;
+ filters.dstpt = atoi(tmpstring.c_str());
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
@@ -2574,15 +2591,16 @@
get_input(mainwin, tmpstring, prompt, flags);
if (tmpstring == "") {
flags.filter_src = false;
- filters.src = "";
+ filters.src = in6addr_any;
} else {
- if (!check_ip(tmpstring.c_str())) {
+ if (!check_ip(tmpstring.c_str(),
+ &filters.src,
+ &filters.srcfam)) {
prompt = "Invalid IP,";
prompt += " ignoring!";
c_warn(mainwin, prompt, flags);
} else {
flags.filter_src = true;
- filters.src = tmpstring;
}
}
wmove(mainwin, 0, 0);
@@ -2594,10 +2612,10 @@
get_input(mainwin, tmpstring, prompt, flags);
if (tmpstring == "") {
flags.filter_srcpt = false;
- filters.srcpt = "";
+ filters.srcpt = 0;
} else {
flags.filter_srcpt = true;
- filters.srcpt = tmpstring;
+ filters.srcpt = atoi(tmpstring.c_str());
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
|
|
From: Phil D. <ja...@us...> - 2011-04-03 23:28:18
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv1816
Modified Files:
iptstate.cc
Log Message:
Merging IPv6 branch.
This also fixes filtering on srcpt and dstpt which used to check for IPs, incorrectly.
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- iptstate.cc 17 Jan 2010 01:26:46 -0000 1.19
+++ iptstate.cc 3 Apr 2011 23:28:15 -0000 1.20
@@ -92,6 +92,8 @@
// Options for truncating from the front or the back
#define TRUNC_FRONT 0
#define TRUNC_END 1
+// maxlength for string we pass to inet_ntop()
+#define NAMELEN 100
// Sorting options
#define SORT_SRC 0
#define SORT_SRC_PT 1
@@ -135,7 +137,8 @@
// One state-table entry
struct table_t {
string proto, state, ttl, sname, dname, spname, dpname;
- in_addr src, dst;
+ in6_addr src, dst;
+ uint8_t family;
unsigned long srcpt, dstpt, bytes, packets, s;
};
// x/y of the terminal window
@@ -220,8 +223,9 @@
*/
bool check_ip(const char *arg)
{
- in_addr tmp_addr;
- if (inet_aton(arg,&tmp_addr) == 0) {
+ in6_addr tmp_addr;
+ if (inet_pton(AF_INET6, arg, &tmp_addr) == 0 &&
+ inet_pton(AF_INET, arg, &tmp_addr) == 0) {
return false;
}
return true;
@@ -297,15 +301,16 @@
/*
* Resolve hostnames
*/
-void resolve_host(const in_addr &ip, string &name)
+void resolve_host(const uint8_t &family, const in6_addr &ip, string &name)
{
struct hostent *hostinfo = NULL;
- if ((hostinfo = gethostbyaddr((char *)&ip, sizeof(ip), AF_INET))
+ if ((hostinfo = gethostbyaddr((char *)&ip, sizeof(ip), family))
!= NULL) {
name = hostinfo->h_name;
} else {
- name = inet_ntoa(ip);
+ char str[NAMELEN];
+ name = inet_ntop(family, (void *)&ip, str, NAMELEN-1) ;
}
}
@@ -327,8 +332,8 @@
{
unsigned int size = 0;
- resolve_host(entry.src, entry.sname);
- resolve_host(entry.dst, entry.dname);
+ resolve_host(entry.family, entry.src, entry.sname);
+ resolve_host(entry.family, entry.dst, entry.dname);
resolve_port(entry.srcpt, entry.spname, entry.proto);
resolve_port(entry.dstpt, entry.dpname, entry.proto);
@@ -370,13 +375,13 @@
*/
int src_sort(const void *a, const void *b)
{
- return sort_factor * memcmp(&((table_t *)a)->src, &((table_t *)b)->src,
- sizeof(uint32_t));
+ return sort_factor *memcmp(&((table_t *)a)->src,
+ &((table_t *)b)->src, sizeof(in6_addr));
}
int dst_sort(const void *a, const void *b)
{
- return sort_factor * memcmp(&((table_t *)a)->dst, &((table_t *)b)->dst,
- sizeof(uint32_t));
+ return sort_factor * memcmp(&((table_t *)a)->dst,
+ &((table_t *)b)->dst, sizeof(in6_addr));
}
int srcpt_sort(const void *a, const void *b)
{
@@ -840,8 +845,10 @@
ct = nfct_new();
int ret;
string response;
- string src = inet_ntoa(entry.src);
- string dst = inet_ntoa(entry.dst);
+ char str[NAMELEN];
+ string src, dst;
+ src = inet_ntop(entry.family, (void *)&entry.src, str, NAMELEN-1);
+ dst = inet_ntop(entry.family, (void *)&entry.dst, str, NAMELEN-1);
ostringstream msg;
msg.str("");
@@ -861,10 +868,15 @@
return;
}
- nfct_set_attr_u8(ct, ATTR_ORIG_L3PROTO, AF_INET);
+ nfct_set_attr_u8(ct, ATTR_ORIG_L3PROTO, entry.family);
- nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_SRC, entry.src.s_addr);
- nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_DST, entry.dst.s_addr);
+ if (entry.family == AF_INET) {
+ nfct_set_attr(ct, ATTR_ORIG_IPV4_SRC, (void *)&entry.src.s6_addr);
+ nfct_set_attr(ct, ATTR_ORIG_IPV4_DST, (void *)&entry.dst.s6_addr);
+ } else if (entry.family == AF_INET6) {
+ nfct_set_attr(ct, ATTR_ORIG_IPV6_SRC, (void *)&entry.src.s6_addr);
+ nfct_set_attr(ct, ATTR_ORIG_IPV6_DST, (void *)&entry.dst.s6_addr);
+ }
nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO,
getprotobyname(entry.proto.c_str())->p_proto);
@@ -964,9 +976,19 @@
snprintf(ttlc,11, "%3i:%02i:%02i", hours, minutes, seconds);
entry.ttl = ttlc;
+ entry.family = nfct_get_attr_u8(ct, ATTR_ORIG_L3PROTO);
// Everything has addresses
- entry.src.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_SRC);
- entry.dst.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_DST);
+ if (entry.family == AF_INET) {
+ memcpy(entry.src.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV4_SRC),
+ sizeof(uint8_t[16]));
+ memcpy(entry.dst.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV4_DST),
+ sizeof(uint8_t[16]));
+ } else if (entry.family == AF_INET6) {
+ memcpy(entry.src.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV6_SRC),
+ sizeof(uint8_t[16]));
+ memcpy(entry.dst.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV6_DST),
+ sizeof(uint8_t[16]));
+ }
// Counters (summary, in + out)
entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES) +
@@ -1041,7 +1063,11 @@
* it's own function once the other copy of build_table()
* is gone.
*/
- if (flags->skiplb && !strcmp(inet_ntoa(entry.src), "127.0.0.1")) {
+ char src[NAMELEN], dst[NAMELEN];
+ inet_ntop(entry.family, (void*)&entry.src, src, NAMELEN-1);
+ inet_ntop(entry.family, (void*)&entry.dst, dst, NAMELEN-1);
+ if (flags->skiplb && !strcmp(src, "127.0.0.1")
+ && !strcmp(src, "::1/128")) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1051,8 +1077,7 @@
return NFCT_CB_CONTINUE;
}
- if (flags->filter_src
- && (inet_ntoa(entry.src) != filters->src)) {
+ if (flags->filter_src && strcmp(src, filters->src.c_str())) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1063,8 +1088,7 @@
return NFCT_CB_CONTINUE;
}
- if (flags->filter_dst
- && (inet_ntoa(entry.dst) != filters->dst)) {
+ if (flags->filter_dst && strcmp(dst, filters->dst.c_str())) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1107,7 +1131,7 @@
int res=0;
vector<string> fields(MAXFIELDS);
static struct nfct_handle *cth;
- u_int8_t family = AF_INET;
+ u_int8_t family = AF_UNSPEC;
/*
* This is the ugly struct for the nfct hook, that holds pointers to
@@ -1153,7 +1177,6 @@
{
switch (sortby) {
- // This is ^L
case SORT_SRC:
if (lookup) {
qsort(&(stable[0]), stable.size(),
@@ -1379,6 +1402,7 @@
ostringstream buffer;
buffer.str("");
string src, dst, b, p;
+ char tmp[NAMELEN];
if (flags.lookup)
truncate(table, max, flags);
@@ -1387,14 +1411,18 @@
if (flags.lookup && (table.sname != "")) {
buffer << table.sname << ":" << table.spname;
} else {
- buffer << inet_ntoa(table.src) << ":" << table.srcpt;
+ buffer << inet_ntop(table.family,
+ (void*)&table.src, tmp, NAMELEN-1)
+ << ":" << table.srcpt;
}
src = buffer.str();
buffer.str("");
if (flags.lookup && (table.dname != "")) {
buffer << table.dname << ":" << table.dpname;
} else {
- buffer << inet_ntoa(table.dst) << ":" << table.dstpt;
+ buffer << inet_ntop(table.family,
+ (void*)&table.dst, tmp, NAMELEN-1)
+ << ":" << table.dstpt;
}
dst = buffer.str();
buffer.str("");
@@ -1402,12 +1430,14 @@
if (flags.lookup && (table.sname != "")) {
src = table.sname;
} else {
- src = inet_ntoa(table.src);
+ src = inet_ntop(table.family, (void*)&table.src, tmp,
+ NAMELEN-1);
}
if (flags.lookup && (table.dname != "")) {
dst = table.dname;
} else {
- dst = inet_ntoa(table.dst);
+ dst = inet_ntop(table.family, (void*)&table.dst, tmp,
+ NAMELEN-1);
}
}
@@ -2184,11 +2214,6 @@
*/
if (optarg == NULL)
break;
- if (!check_ip(optarg)) {
- cerr << "Invalid IP address: " << optarg
- << endl;
- exit(1);
- }
flags.filter_dstpt = true;
filters.dstpt = optarg;
break;
@@ -2273,11 +2298,6 @@
case 'S':
if (optarg == NULL)
break;
- if (!check_ip(optarg)) {
- cerr << "Invalid IP address: " << optarg
- << endl;
- exit(1);
- }
flags.filter_srcpt = true;
filters.srcpt = optarg;
break;
@@ -2528,14 +2548,8 @@
flags.filter_dstpt = false;
filters.dstpt = "";
} else {
- if (!check_ip(tmpstring.c_str())) {
- prompt = "Invalid IP,";
- prompt += " ignoring!";
- c_warn(mainwin, prompt, flags);
- } else {
- flags.filter_dstpt = true;
- filters.dstpt = tmpstring;
- }
+ flags.filter_dstpt = true;
+ filters.dstpt = tmpstring;
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
@@ -2582,14 +2596,8 @@
flags.filter_srcpt = false;
filters.srcpt = "";
} else {
- if (!check_ip(tmpstring.c_str())) {
- prompt = "Invalid IP,";
- prompt += " ignoring!";
- c_warn(mainwin, prompt, flags);
- } else {
- flags.filter_srcpt = true;
- filters.srcpt = tmpstring;
- }
+ flags.filter_srcpt = true;
+ filters.srcpt = tmpstring;
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
|
|
From: Phil D. <ja...@us...> - 2011-04-03 23:23:19
|
Update of /cvsroot/iptstate/iptstate
In directory vz-cvs-4.sog:/tmp/cvs-serv31756
Modified Files:
Tag: ipv6_branch
iptstate.cc
Log Message:
This adds IPv6 support. We dynamically handle both ipv4 and ipv6 now, however,
formatting may get somehwat messed up on narrow terminals with ipv6.
Closes #2848930
Signed-off-by: Phil Dibowitz <ph...@ip...>
Index: iptstate.cc
===================================================================
RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- iptstate.cc 17 Jan 2010 01:26:46 -0000 1.19
+++ iptstate.cc 3 Apr 2011 23:23:16 -0000 1.19.2.1
@@ -92,6 +92,8 @@
// Options for truncating from the front or the back
#define TRUNC_FRONT 0
#define TRUNC_END 1
+// maxlength for string we pass to inet_ntop()
+#define NAMELEN 100
// Sorting options
#define SORT_SRC 0
#define SORT_SRC_PT 1
@@ -135,7 +137,8 @@
// One state-table entry
struct table_t {
string proto, state, ttl, sname, dname, spname, dpname;
- in_addr src, dst;
+ in6_addr src, dst;
+ uint8_t family;
unsigned long srcpt, dstpt, bytes, packets, s;
};
// x/y of the terminal window
@@ -220,8 +223,9 @@
*/
bool check_ip(const char *arg)
{
- in_addr tmp_addr;
- if (inet_aton(arg,&tmp_addr) == 0) {
+ in6_addr tmp_addr;
+ if (inet_pton(AF_INET6, arg, &tmp_addr) == 0 &&
+ inet_pton(AF_INET, arg, &tmp_addr) == 0) {
return false;
}
return true;
@@ -297,15 +301,16 @@
/*
* Resolve hostnames
*/
-void resolve_host(const in_addr &ip, string &name)
+void resolve_host(const uint8_t &family, const in6_addr &ip, string &name)
{
struct hostent *hostinfo = NULL;
- if ((hostinfo = gethostbyaddr((char *)&ip, sizeof(ip), AF_INET))
+ if ((hostinfo = gethostbyaddr((char *)&ip, sizeof(ip), family))
!= NULL) {
name = hostinfo->h_name;
} else {
- name = inet_ntoa(ip);
+ char str[NAMELEN];
+ name = inet_ntop(family, (void *)&ip, str, NAMELEN-1) ;
}
}
@@ -327,8 +332,8 @@
{
unsigned int size = 0;
- resolve_host(entry.src, entry.sname);
- resolve_host(entry.dst, entry.dname);
+ resolve_host(entry.family, entry.src, entry.sname);
+ resolve_host(entry.family, entry.dst, entry.dname);
resolve_port(entry.srcpt, entry.spname, entry.proto);
resolve_port(entry.dstpt, entry.dpname, entry.proto);
@@ -370,13 +375,13 @@
*/
int src_sort(const void *a, const void *b)
{
- return sort_factor * memcmp(&((table_t *)a)->src, &((table_t *)b)->src,
- sizeof(uint32_t));
+ return sort_factor *memcmp(&((table_t *)a)->src,
+ &((table_t *)b)->src, sizeof(in6_addr));
}
int dst_sort(const void *a, const void *b)
{
- return sort_factor * memcmp(&((table_t *)a)->dst, &((table_t *)b)->dst,
- sizeof(uint32_t));
+ return sort_factor * memcmp(&((table_t *)a)->dst,
+ &((table_t *)b)->dst, sizeof(in6_addr));
}
int srcpt_sort(const void *a, const void *b)
{
@@ -840,8 +845,10 @@
ct = nfct_new();
int ret;
string response;
- string src = inet_ntoa(entry.src);
- string dst = inet_ntoa(entry.dst);
+ char str[NAMELEN];
+ string src, dst;
+ src = inet_ntop(entry.family, (void *)&entry.src, str, NAMELEN-1);
+ dst = inet_ntop(entry.family, (void *)&entry.dst, str, NAMELEN-1);
ostringstream msg;
msg.str("");
@@ -861,10 +868,15 @@
return;
}
- nfct_set_attr_u8(ct, ATTR_ORIG_L3PROTO, AF_INET);
+ nfct_set_attr_u8(ct, ATTR_ORIG_L3PROTO, entry.family);
- nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_SRC, entry.src.s_addr);
- nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_DST, entry.dst.s_addr);
+ if (entry.family == AF_INET) {
+ nfct_set_attr(ct, ATTR_ORIG_IPV4_SRC, (void *)&entry.src.s6_addr);
+ nfct_set_attr(ct, ATTR_ORIG_IPV4_DST, (void *)&entry.dst.s6_addr);
+ } else if (entry.family == AF_INET6) {
+ nfct_set_attr(ct, ATTR_ORIG_IPV6_SRC, (void *)&entry.src.s6_addr);
+ nfct_set_attr(ct, ATTR_ORIG_IPV6_DST, (void *)&entry.dst.s6_addr);
+ }
nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO,
getprotobyname(entry.proto.c_str())->p_proto);
@@ -964,9 +976,19 @@
snprintf(ttlc,11, "%3i:%02i:%02i", hours, minutes, seconds);
entry.ttl = ttlc;
+ entry.family = nfct_get_attr_u8(ct, ATTR_ORIG_L3PROTO);
// Everything has addresses
- entry.src.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_SRC);
- entry.dst.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_DST);
+ if (entry.family == AF_INET) {
+ memcpy(entry.src.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV4_SRC),
+ sizeof(uint8_t[16]));
+ memcpy(entry.dst.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV4_DST),
+ sizeof(uint8_t[16]));
+ } else if (entry.family == AF_INET6) {
+ memcpy(entry.src.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV6_SRC),
+ sizeof(uint8_t[16]));
+ memcpy(entry.dst.s6_addr, nfct_get_attr(ct, ATTR_ORIG_IPV6_DST),
+ sizeof(uint8_t[16]));
+ }
// Counters (summary, in + out)
entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES) +
@@ -1041,7 +1063,11 @@
* it's own function once the other copy of build_table()
* is gone.
*/
- if (flags->skiplb && !strcmp(inet_ntoa(entry.src), "127.0.0.1")) {
+ char src[NAMELEN], dst[NAMELEN];
+ inet_ntop(entry.family, (void*)&entry.src, src, NAMELEN-1);
+ inet_ntop(entry.family, (void*)&entry.dst, dst, NAMELEN-1);
+ if (flags->skiplb && !strcmp(src, "127.0.0.1")
+ && !strcmp(src, "::1/128")) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1051,8 +1077,7 @@
return NFCT_CB_CONTINUE;
}
- if (flags->filter_src
- && (inet_ntoa(entry.src) != filters->src)) {
+ if (flags->filter_src && strcmp(src, filters->src.c_str())) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1063,8 +1088,7 @@
return NFCT_CB_CONTINUE;
}
- if (flags->filter_dst
- && (inet_ntoa(entry.dst) != filters->dst)) {
+ if (flags->filter_dst && strcmp(dst, filters->dst.c_str())) {
counts->skipped++;
return NFCT_CB_CONTINUE;
}
@@ -1107,7 +1131,7 @@
int res=0;
vector<string> fields(MAXFIELDS);
static struct nfct_handle *cth;
- u_int8_t family = AF_INET;
+ u_int8_t family = AF_UNSPEC;
/*
* This is the ugly struct for the nfct hook, that holds pointers to
@@ -1153,7 +1177,6 @@
{
switch (sortby) {
- // This is ^L
case SORT_SRC:
if (lookup) {
qsort(&(stable[0]), stable.size(),
@@ -1379,6 +1402,7 @@
ostringstream buffer;
buffer.str("");
string src, dst, b, p;
+ char tmp[NAMELEN];
if (flags.lookup)
truncate(table, max, flags);
@@ -1387,14 +1411,18 @@
if (flags.lookup && (table.sname != "")) {
buffer << table.sname << ":" << table.spname;
} else {
- buffer << inet_ntoa(table.src) << ":" << table.srcpt;
+ buffer << inet_ntop(table.family,
+ (void*)&table.src, tmp, NAMELEN-1)
+ << ":" << table.srcpt;
}
src = buffer.str();
buffer.str("");
if (flags.lookup && (table.dname != "")) {
buffer << table.dname << ":" << table.dpname;
} else {
- buffer << inet_ntoa(table.dst) << ":" << table.dstpt;
+ buffer << inet_ntop(table.family,
+ (void*)&table.dst, tmp, NAMELEN-1)
+ << ":" << table.dstpt;
}
dst = buffer.str();
buffer.str("");
@@ -1402,12 +1430,14 @@
if (flags.lookup && (table.sname != "")) {
src = table.sname;
} else {
- src = inet_ntoa(table.src);
+ src = inet_ntop(table.family, (void*)&table.src, tmp,
+ NAMELEN-1);
}
if (flags.lookup && (table.dname != "")) {
dst = table.dname;
} else {
- dst = inet_ntoa(table.dst);
+ dst = inet_ntop(table.family, (void*)&table.dst, tmp,
+ NAMELEN-1);
}
}
@@ -2184,11 +2214,6 @@
*/
if (optarg == NULL)
break;
- if (!check_ip(optarg)) {
- cerr << "Invalid IP address: " << optarg
- << endl;
- exit(1);
- }
flags.filter_dstpt = true;
filters.dstpt = optarg;
break;
@@ -2273,11 +2298,6 @@
case 'S':
if (optarg == NULL)
break;
- if (!check_ip(optarg)) {
- cerr << "Invalid IP address: " << optarg
- << endl;
- exit(1);
- }
flags.filter_srcpt = true;
filters.srcpt = optarg;
break;
@@ -2528,14 +2548,8 @@
flags.filter_dstpt = false;
filters.dstpt = "";
} else {
- if (!check_ip(tmpstring.c_str())) {
- prompt = "Invalid IP,";
- prompt += " ignoring!";
- c_warn(mainwin, prompt, flags);
- } else {
- flags.filter_dstpt = true;
- filters.dstpt = tmpstring;
- }
+ flags.filter_dstpt = true;
+ filters.dstpt = tmpstring;
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
@@ -2582,14 +2596,8 @@
flags.filter_srcpt = false;
filters.srcpt = "";
} else {
- if (!check_ip(tmpstring.c_str())) {
- prompt = "Invalid IP,";
- prompt += " ignoring!";
- c_warn(mainwin, prompt, flags);
- } else {
- flags.filter_srcpt = true;
- filters.srcpt = tmpstring;
- }
+ flags.filter_srcpt = true;
+ filters.srcpt = tmpstring;
}
wmove(mainwin, 0, 0);
wclrtoeol(mainwin);
|
|
From: Phil D. <ja...@us...> - 2010-01-17 01:27:37
|
Update of /cvsroot/iptstate/iptstate In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31425 Modified Files: Tag: cpp_ification_branch iptstate.cc Log Message: (Copying commit from HEAD) Use unsigned numbers for srcpt, dstpt, bytes, and packets in the table_t struct to avoid negative numbers. Also, be sure to report the total number of bytes and packets in a connection by including both the in and out traffic. This patch is based largely on a patch by Vladimir <do...@nm...> which fixed this for bytes and packets, with small modifications by me. Signed-off-by: Phil Dibowitz <ph...@ip...> Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -u -d -r1.17.2.1 -r1.17.2.2 --- iptstate.cc 23 Oct 2009 15:57:24 -0000 1.17.2.1 +++ iptstate.cc 17 Jan 2010 01:27:28 -0000 1.17.2.2 @@ -141,8 +141,7 @@ struct table_t { string proto, state, ttl, sname, dname, spname, dpname; in_addr src, dst; - int srcpt, dstpt, bytes, packets; - unsigned int id; + unsigned int srcpt, dstpt, bytes, packets, id; }; // x/y of the terminal window struct screensize_t { @@ -156,7 +155,7 @@ }; // Struct 'o counters struct counters_t { - int total, tcp, udp, icmp, other, skipped; + unsigned int total, tcp, udp, icmp, other, skipped; }; // Various filters to be applied pending the right flags in flags_t struct filters_t { @@ -164,7 +163,8 @@ }; // The max-length of fields in the stable table struct max_t { - unsigned int src, dst, proto, state, ttl, bytes, packets; + unsigned int src, dst, proto, state, ttl; + unsigned long bytes, packets; }; struct hook_data { vector<table_t> *stable; @@ -215,7 +215,7 @@ /* * This determines the length of an integer (i.e. number of digits) */ -unsigned int digits(int x) +unsigned int digits(unsigned long x) { return (unsigned int) floor(log10((double)x))+1; } @@ -314,7 +314,7 @@ } } -void resolve_port(const int &port, string &name, const string &proto) +void resolve_port(const unsigned int &port, string &name, const string &proto) { struct servent *portinfo = NULL; @@ -979,10 +979,11 @@ entry.src.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_SRC); entry.dst.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_DST); - // Counters - entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES); - entry.packets = - nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_PACKETS); + // Counters (summary, in + out) + entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES) + + nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_BYTES); + entry.packets = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_PACKETS) + + nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_PACKETS); if (digits(entry.bytes) > max->bytes) { max->bytes = digits(entry.bytes); @@ -1068,7 +1069,7 @@ } if (flags->filter_srcpt - && (entry.srcpt != atoi(filters->srcpt.c_str()))) { + && (entry.srcpt != (unsigned int)atoi(filters->srcpt.c_str()))) { counts->skipped++; return NFCT_CB_CONTINUE; } @@ -1080,7 +1081,7 @@ } if (flags->filter_dstpt - && (entry.dstpt != atoi(filters->dstpt.c_str()))) { + && (entry.dstpt != (unsigned int)atoi(filters->dstpt.c_str()))) { counts->skipped++; return NFCT_CB_CONTINUE; } |
|
From: Phil D. <ja...@us...> - 2010-01-17 01:26:56
|
Update of /cvsroot/iptstate/iptstate In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31317 Modified Files: iptstate.cc Log Message: s/long long int/long/g One fix from the previous patch that I missed before committing. Signed-off-by: Phil Dibowitz <ph...@ip...> Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- iptstate.cc 16 Jan 2010 23:30:09 -0000 1.18 +++ iptstate.cc 17 Jan 2010 01:26:46 -0000 1.19 @@ -159,7 +159,7 @@ // The max-length of fields in the stable table struct max_t { unsigned int src, dst, proto, state, ttl; - unsigned long long int bytes, packets; + unsigned long bytes, packets; }; struct hook_data { vector<table_t> *stable; |
|
From: Phil D. <ja...@us...> - 2010-01-16 23:30:39
|
Update of /cvsroot/iptstate/iptstate In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv15633 Modified Files: iptstate.cc Log Message: Use unsigned numbers for srcpt, dstpt, bytes, and packets in the table_t struct to avoid negative numbers. Also, be sure to report the total number of bytes and packets in a connection by including both the in and out traffic. This patch is based largely on a patch by Vladimir <do...@nm...> which fixed this for bytes and packets, with small modifications by me. Signed-off-by: Phil Dibowitz <ph...@ip...> Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- iptstate.cc 19 Sep 2009 21:07:02 -0000 1.17 +++ iptstate.cc 16 Jan 2010 23:30:09 -0000 1.18 @@ -136,7 +136,7 @@ struct table_t { string proto, state, ttl, sname, dname, spname, dpname; in_addr src, dst; - int srcpt, dstpt, bytes, packets; + unsigned long srcpt, dstpt, bytes, packets, s; }; // x/y of the terminal window struct screensize_t { @@ -150,7 +150,7 @@ }; // Struct 'o counters struct counters_t { - int total, tcp, udp, icmp, other, skipped; + unsigned int total, tcp, udp, icmp, other, skipped; }; // Various filters to be applied pending the right flags in flags_t struct filters_t { @@ -158,7 +158,8 @@ }; // The max-length of fields in the stable table struct max_t { - unsigned int src, dst, proto, state, ttl, bytes, packets; + unsigned int src, dst, proto, state, ttl; + unsigned long long int bytes, packets; }; struct hook_data { vector<table_t> *stable; @@ -209,7 +210,7 @@ /* * This determines the length of an integer (i.e. number of digits) */ -unsigned int digits(int x) +unsigned int digits(unsigned long x) { return (unsigned int) floor(log10((double)x))+1; } @@ -308,7 +309,7 @@ } } -void resolve_port(const int &port, string &name, const string &proto) +void resolve_port(const unsigned int &port, string &name, const string &proto) { struct servent *portinfo = NULL; @@ -967,10 +968,11 @@ entry.src.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_SRC); entry.dst.s_addr = nfct_get_attr_u32(ct, ATTR_ORIG_IPV4_DST); - // Counters - entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES); - entry.packets = - nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_PACKETS); + // Counters (summary, in + out) + entry.bytes = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_BYTES) + + nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_BYTES); + entry.packets = nfct_get_attr_u32(ct, ATTR_ORIG_COUNTER_PACKETS) + + nfct_get_attr_u32(ct, ATTR_REPL_COUNTER_PACKETS); if (digits(entry.bytes) > max->bytes) { max->bytes = digits(entry.bytes); @@ -1056,7 +1058,7 @@ } if (flags->filter_srcpt - && (entry.srcpt != atoi(filters->srcpt.c_str()))) { + && (entry.srcpt != (unsigned int)atoi(filters->srcpt.c_str()))) { counts->skipped++; return NFCT_CB_CONTINUE; } @@ -1068,7 +1070,7 @@ } if (flags->filter_dstpt - && (entry.dstpt != atoi(filters->dstpt.c_str()))) { + && (entry.dstpt != (unsigned int)atoi(filters->dstpt.c_str()))) { counts->skipped++; return NFCT_CB_CONTINUE; } |
|
From: Phil D. <ja...@us...> - 2009-11-11 09:41:45
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21867 Modified Files: CONTRIB Log Message: Updating RH maintainer list, per Thomas. Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CONTRIB 14 Sep 2009 18:42:58 -0000 1.10 +++ CONTRIB 11 Nov 2009 09:41:30 -0000 1.11 @@ -28,7 +28,7 @@ floppyfw: Cristian Ionescu-Idbohrn pkgsrc: Roland Illig Devil Linux: (was: Bruce Smith) -Fedora/RedHat: Warren Togami and Thomas Woerner +Fedora/RedHat: Thomas Woerner OpenEmbedded: Jamie Lenehen ArchLinux (community repo): Andrea Zucchelli ipcop: Franck Bourdonnec |
|
From: Phil D. <ja...@us...> - 2009-10-23 15:57:36
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32087 Modified Files: Tag: cpp_ification_branch iptstate.cc Log Message: - Move our defines to enums - Start pulling in ID so we can handle cursor-jumps better one day Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -u -d -r1.17 -r1.17.2.1 --- iptstate.cc 19 Sep 2009 21:07:02 -0000 1.17 +++ iptstate.cc 23 Oct 2009 15:57:24 -0000 1.17.2.1 @@ -63,7 +63,7 @@ #include <unistd.h> using namespace std; -#define VERSION "2.2.2" +static const char *VERSION = "2.2.2"; /* * MAXCONS is set to 16k, the default number of states in iptables. Generally * speaking the ncurses pad is this many lines long, but since ncurses @@ -73,36 +73,41 @@ #define MAXCONS 16384 #define MAXLINES 32767 #if MAXCONS < MAXLINES - #define NLINES MAXCONS +static const size_t NLINES = MAXCONS; #else - #define NLINES MAXLINES +static const size_t NLINES = MAXLINES; #endif -#define MAXFIELDS 20 +static const int MAXFIELDS = 20; // This is the default format string if we don't dynamically determine it -#define DEFAULT_FORMAT "%-21s %-21s %-7s %-12s %-9s\n" +static const char *DEFAULT_FORMAT = "%-21s %-21s %-7s %-12s %-9s\n"; // The following MUST be the same as the above -#define DEFAULT_SRC 21 -#define DEFAULT_DST 21 -#define DEFAULT_PROTO 7 -#define DEFAULT_STATE 12 -#define DEFAULT_TTL 9 +static const int DEFAULT_SRC = 21; +static const int DEFAULT_DST = 21; +static const int DEFAULT_PROTO = 7; +static const int DEFAULT_STATE = 12; +static const int DEFAULT_TTL = 9; // This is the format string for the "totals" line, always. -#define TOTALS_FORMAT \ - "Total States: %i -- TCP: %i UDP: %i ICMP: %i Other: %i (Filtered: %i)\n" +static const char *TOTALS_FORMAT = + "Total States: %i -- TCP: %i UDP: %i ICMP: %i Other: %i (Filtered: %i)\n"; // Options for truncating from the front or the back -#define TRUNC_FRONT 0 -#define TRUNC_END 1 +enum { + TRUNK_FRONT, + TRUNK_END +}; + // Sorting options -#define SORT_SRC 0 -#define SORT_SRC_PT 1 -#define SORT_DST 2 -#define SORT_DST_PT 3 -#define SORT_PROTO 4 -#define SORT_STATE 5 -#define SORT_TTL 6 -#define SORT_BYTES 7 -#define SORT_PACKETS 8 -#define SORT_MAX 8 +enum { + SORT_SRC, + SORT_SRC_PT, + SORT_DST, + SORT_DST_PT, + SORT_PROTO, + SORT_STATE, + SORT_TTL, + SORT_BYTES, + SORT_PACKETS, + SORT_MAX +}; /* * GLOBAL CONSTANTS @@ -137,6 +142,7 @@ string proto, state, ttl, sname, dname, spname, dpname; in_addr src, dst; int srcpt, dstpt, bytes, packets; + unsigned int id; }; // x/y of the terminal window struct screensize_t { @@ -939,6 +945,12 @@ entry.proto = ""; entry.ttl = ""; entry.state = ""; + entry.id = 0; + + /* + * Get the ID + */ + entry.id = nfct_get_attr_u32(ct, ATTR_ID); /* * First, we read stuff into the array that's always the @@ -2475,7 +2487,7 @@ sort_factor = -sort_factor; break; case 'b': - if (sortby < SORT_MAX) { + if (sortby < SORT_MAX - 1) { sortby++; if (!flags.counters && sortby >= SORT_BYTES) |
|
From: Phil D. <ja...@us...> - 2009-09-19 21:07:15
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2956 Modified Files: Changelog iptstate.cc iptstate.spec Log Message: Version bump for release. Index: iptstate.spec =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.spec,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- iptstate.spec 2 Sep 2009 20:16:21 -0000 1.9 +++ iptstate.spec 19 Sep 2009 21:07:02 -0000 1.10 @@ -1,5 +1,5 @@ %define name iptstate -%define version 2.2.1 +%define version 2.2.2 %define release 1 Name: %{name} Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- iptstate.cc 19 Sep 2009 16:52:54 -0000 1.16 +++ iptstate.cc 19 Sep 2009 21:07:02 -0000 1.17 @@ -63,7 +63,7 @@ #include <unistd.h> using namespace std; -#define VERSION "2.2.1+CVS" +#define VERSION "2.2.2" /* * MAXCONS is set to 16k, the default number of states in iptables. Generally * speaking the ncurses pad is this many lines long, but since ncurses Index: Changelog =================================================================== RCS file: /cvsroot/iptstate/iptstate/Changelog,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Changelog 19 Sep 2009 16:49:00 -0000 1.12 +++ Changelog 19 Sep 2009 21:07:02 -0000 1.13 @@ -1,4 +1,5 @@ -CVS +2.2.2 +- Released 09/19/09 - Fix includes - Add --version (closes bug 2792918) - Some minor code abstractions |
|
From: Phil D. <ja...@us...> - 2009-09-19 16:53:04
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4969 Modified Files: iptstate.cc Log Message: iptstate.cc: - fix license info Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- iptstate.cc 19 Sep 2009 16:49:00 -0000 1.15 +++ iptstate.cc 19 Sep 2009 16:52:54 -0000 1.16 @@ -35,8 +35,8 @@ * interface for IP Tables. I've added in the "single run" * option since there's no nice way to do that either. * - * NOTE: IF YOU WANT TO PACKAGE THIS SOFTWARE FOR A - * LINUX DISTRIBUTION, CONTACT ME! + * NOTE: If you are planning on packaging and/or submitting my software for/to + * a Linux distribution, I would appreciate a heads up. * */ |
|
From: Phil D. <ja...@us...> - 2009-09-19 16:49:12
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4292 Modified Files: BUGS Changelog LICENSE Makefile README iptstate.8 iptstate.cc Log Message: BUGS - fix support options and formatting LICENSE - Update copyright date - change text so that it's not required for people to notify me before distribution, just requested Makefile - Update copyright date README - No need to re-copy the copyright, refer to the LICENSE file iptstate.cc: - Update copyright date - Nuke prototypes and just stick code in the right order - fix style of main() Index: iptstate.cc =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iptstate.cc 2 Sep 2009 22:41:49 -0000 1.14 +++ iptstate.cc 19 Sep 2009 16:49:00 -0000 1.15 @@ -6,7 +6,7 @@ * * ----------------------------------- * - * Copyright (C) 2002 - 2007 Phil Dibowitz + * Copyright (C) 2002 - 2009 Phil Dibowitz * * This software is provided 'as-is', without any express or * implied warranty. In no event will the authors be held @@ -128,6 +128,7 @@ "LISTEN" }; [...3131 lines suppressed...] - split(')', id, id, tmp); - - nfct_set_attr_u8(ct, ATTR_ICMP_TYPE, atoi(type.c_str())); - nfct_set_attr_u8(ct, ATTR_ICMP_CODE, atoi(code.c_str())); - nfct_set_attr_u16(ct, ATTR_ICMP_ID, atoi(id.c_str())); - } + end_curses(); - ret = nfct_query(cth, NFCT_Q_DESTROY, ct); - if (ret < 0) { - string msg = "Failed to delete state: "; - msg += strerror(errno); - c_warn(win, msg.c_str(), flags); - } + // And we're done + return(0); -} +} // end main Index: LICENSE =================================================================== RCS file: /cvsroot/iptstate/iptstate/LICENSE,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- LICENSE 2 Sep 2009 20:16:21 -0000 1.6 +++ LICENSE 19 Sep 2009 16:49:00 -0000 1.7 @@ -1,6 +1,6 @@ IP Tables State (iptstate) - Copyright (C) 2002 - 2007 Phil Dibowitz + Copyright (C) 2002 - 2009 Phil Dibowitz This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held @@ -23,10 +23,11 @@ ----------------------------------- -NOTE: If you are planning on packaging and/or submitting my -software for/to a Linux Distribution, EMAIL ME FIRST!!! -There is already an official maintainer for most popular distributions, -see the CONTRIB file for details. +NOTE: If you are planning on packaging and/or submitting my software for/to a +Linux distribution, I would appreciate a heads up. + +There is already an official maintainer for most popular distributions, see the +CONTRIB file for details. Phil Dibowitz phil AT ipom DOT com Index: Changelog =================================================================== RCS file: /cvsroot/iptstate/iptstate/Changelog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Changelog 2 Sep 2009 21:25:30 -0000 1.11 +++ Changelog 19 Sep 2009 16:49:00 -0000 1.12 @@ -7,6 +7,7 @@ to make more room for counters - If we can't fit counters and there's nothing we can truncate, show a warning and then disable counters rather than messing up the display +- Some style cleanups 2.2.1 - Released 03/18/07 Index: iptstate.8 =================================================================== RCS file: /cvsroot/iptstate/iptstate/iptstate.8,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- iptstate.8 2 Sep 2009 20:16:21 -0000 1.2 +++ iptstate.8 19 Sep 2009 16:49:00 -0000 1.3 @@ -1,7 +1,7 @@ .\" Process this file with .\" groff -man -Tascii iptstate.8 .\" -.TH IPTSTATE 8 "MARCH 2007" "" "" +.TH IPTSTATE 8 "SEPTEMBER 2009" "" "" .\" .\" Man page written by Phil Dibowitz <phil AT ipom DOT com> .\" Index: Makefile =================================================================== RCS file: /cvsroot/iptstate/iptstate/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile 2 Sep 2009 20:23:07 -0000 1.11 +++ Makefile 19 Sep 2009 16:49:00 -0000 1.12 @@ -1,5 +1,5 @@ # -# Copyright (C) 2002 - 2007 Phil Dibowitz. +# Copyright (C) 2002 - 2009 Phil Dibowitz. # # See iptstate.cc for copyright info # Index: BUGS =================================================================== RCS file: /cvsroot/iptstate/iptstate/BUGS,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- BUGS 2 Sep 2009 20:16:21 -0000 1.7 +++ BUGS 19 Sep 2009 16:49:00 -0000 1.8 @@ -20,38 +20,41 @@ (a day or more). This bug has been reported to ncurses, see above URL. ABOUT BUGS - If you find a bug in IPTState you should notify ME! You can contact me at -phil AT ipom DOT com. Sending a bug to your distro or some public forum is not -going to let me know. I can't fix things I don't know about. So please email -ME. +If you find a bug in IPTState you should file a bug at our bugtracker: + https://sourceforge.net/tracker/?group_id=52748&atid=467897 +OR mail our -devel list: + https://lists.sourceforge.net/lists/listinfo/iptstate-devel +OR email me at phil AT ipom DOT com. + +Sending a bug to your distro or some public forum is not going to let me know. +I can't fix things I don't know about. So make sure I know! ABOUT MY RESPONSE - If your bug is serious - i.e. compilation errors, a major a functionality -is broken, or a security problem I'll usually give you pretty immediate -attention. If it's a very minor bug, or a feature request, I will -acknowledge your email, but I may not fix/implement it immediately. +If your bug is serious - i.e. compilation errors, a major a functionality is +broken, or a security problem I'll usually give you pretty immediate attention. +If it's a very minor bug, or a feature request, I'll respond as I have time. ABOUT PATCHES - Patches are not necessary, but if you submit one remember: PATCHES SHOULD -BE ACCOMPANIED BY EXPLINATIONS AND/OR BUG REPORTS! Let me know what you were -trying to fix/add and how you did it. This will save me a lot of time, and -I'll like you more. +Patches are not necessary, but if you submit one remember: PATCHES SHOULD BE +ACCOMPANIED BY EXPLINATIONS AND/OR BUG REPORTS! Let me know what you were +trying to fix/add and how you did it. This will save me a lot of time, and I'll +like you more. ABOUT BUG REPORTS - If you send me a bug report you MUST do the following: -- Include "IPTSTATE" in the subject -- Include your iptstate version -- Include your distribution and distribution version -- Include your kernel version -- Include your g++ version -- Include your make version -- Include your glibc version -- Include your ncurses version -- Include your libnetfilter_conntrack version -- Include any relevant output and/or errors +If you send me a bug report you MUST do the following: + - Include "IPTSTATE" in the subject + - Include your iptstate version + - Include your distribution and distribution version + - Include your kernel version + - Include your g++ version + - Include your make version + - Include your glibc version + - Include your ncurses version + - Include your libnetfilter_conntrack version + - Include any relevant output and/or errors - Bug reports should be sent to *ME*. I cannot fix your bugs if you don't -tell *ME* about them. That's right, send your bug reports to *ME*. +Bug reports should be sent to *ME* (see above). I cannot fix your bugs if you +don't tell *ME* about them. That's right, send your bug reports to *ME*. Thanks! Index: README =================================================================== RCS file: /cvsroot/iptstate/iptstate/README,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- README 2 Sep 2009 20:16:21 -0000 1.10 +++ README 19 Sep 2009 16:49:00 -0000 1.11 @@ -1,33 +1,6 @@ - IP Tables State (iptstate) - - Copyright (C) 2002 - 2007 Phil Dibowitz - - This software is provided 'as-is', without any express or - implied warranty. In no event will the authors be held - liable for any damages arising from the use of this software. - - Permission is granted to anyone to use this software for any - purpose, including commercial applications, and to alter it - and redistribute it freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you - must not claim that you wrote the original software. If you use - this software in a product, an acknowledgment in the product - documentation would be appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and - must not be misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. - - ----------------------------------- - -NOTE: If you are planning on packaging and/or submitting my -software for/to a Linux Distribution, EMAIL ME FIRST!!! See CONTRIB. - +IP Tables State (iptstate) -IPTState +Please see the LICENSE file for license information. 1. WHAT IS IP TABLES STATE? |
|
From: Phil D. <ja...@us...> - 2009-09-14 18:43:12
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1677 Modified Files: CONTRIB Log Message: More contrib fixes. Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CONTRIB 14 Sep 2009 18:17:37 -0000 1.9 +++ CONTRIB 14 Sep 2009 18:42:58 -0000 1.10 @@ -23,11 +23,11 @@ Mandriva: Garrick Staples Debian: Brian Nelson -Gentoo: Eldad Zack +Gentoo: (was: Eldad Zack) ALT Linux: Victor Forsyuk floppyfw: Cristian Ionescu-Idbohrn pkgsrc: Roland Illig -Devil Linux: Bruce Smith +Devil Linux: (was: Bruce Smith) Fedora/RedHat: Warren Togami and Thomas Woerner OpenEmbedded: Jamie Lenehen ArchLinux (community repo): Andrea Zucchelli |
|
From: Phil D. <ja...@us...> - 2009-09-14 18:17:51
|
Update of /cvsroot/iptstate/iptstate In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32248 Modified Files: CONTRIB Log Message: Some minor contrib fixes. Index: CONTRIB =================================================================== RCS file: /cvsroot/iptstate/iptstate/CONTRIB,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CONTRIB 2 Sep 2009 20:16:21 -0000 1.8 +++ CONTRIB 14 Sep 2009 18:17:37 -0000 1.9 @@ -14,18 +14,24 @@ Frank Volf wrote the Statetop code for IP Filter. PACKAGERS -Mandriva: Garrick Staples -Debian: Brian Nelson -Gentoo: Eldad Zack -ALT Linux: Victor Forsyuk -floppyfw: Cristian Ionescu-Idbohrn -pkgsrc: Roland Illig -Devil Linux: Bruce Smith -Fedora: Warren Togami -Redhat Linux: two...@re... -OpenEmbedded: Jamie Lenehen +I'm very grateful to those who package my software. I've tried to list +maintainers here, but if you're not here, please, let me know and I'll +add you. + +If you package my software _please let me know_, and even more importantly, +_please_ pass on bugs to me! + +Mandriva: Garrick Staples +Debian: Brian Nelson +Gentoo: Eldad Zack +ALT Linux: Victor Forsyuk +floppyfw: Cristian Ionescu-Idbohrn +pkgsrc: Roland Illig +Devil Linux: Bruce Smith +Fedora/RedHat: Warren Togami and Thomas Woerner +OpenEmbedded: Jamie Lenehen ArchLinux (community repo): Andrea Zucchelli -ipcop: Franck Bourdonnec +ipcop: Franck Bourdonnec OTHER Some people who helped me get this project started were Jullian Gomez, |