summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ipfilter/lib')
-rw-r--r--contrib/ipfilter/lib/addicmp.c2
-rw-r--r--contrib/ipfilter/lib/addipopt.c2
-rw-r--r--contrib/ipfilter/lib/addkeep.c2
-rw-r--r--contrib/ipfilter/lib/binprint.c2
-rw-r--r--contrib/ipfilter/lib/buildopts.c2
-rw-r--r--contrib/ipfilter/lib/checkrev.c2
-rw-r--r--contrib/ipfilter/lib/count4bits.c2
-rw-r--r--contrib/ipfilter/lib/count6bits.c2
-rw-r--r--contrib/ipfilter/lib/debug.c2
-rw-r--r--contrib/ipfilter/lib/extras.c2
-rw-r--r--contrib/ipfilter/lib/facpri.c8
-rw-r--r--contrib/ipfilter/lib/facpri.h2
-rw-r--r--contrib/ipfilter/lib/fill6bits.c2
-rw-r--r--contrib/ipfilter/lib/flags.c2
-rw-r--r--contrib/ipfilter/lib/genmask.c2
-rw-r--r--contrib/ipfilter/lib/getline.c2
-rw-r--r--contrib/ipfilter/lib/getnattype.c2
-rw-r--r--contrib/ipfilter/lib/getproto.c8
-rw-r--r--contrib/ipfilter/lib/hostmask.c2
-rw-r--r--contrib/ipfilter/lib/hostnum.c2
-rw-r--r--contrib/ipfilter/lib/icmpcode.c2
-rw-r--r--contrib/ipfilter/lib/inet_addr.c2
-rw-r--r--contrib/ipfilter/lib/initparse.c2
-rw-r--r--contrib/ipfilter/lib/ionames.c2
-rw-r--r--contrib/ipfilter/lib/ipft_ef.c4
-rw-r--r--contrib/ipfilter/lib/ipft_hx.c8
-rw-r--r--contrib/ipfilter/lib/ipft_pc.c33
-rw-r--r--contrib/ipfilter/lib/ipft_sn.c4
-rw-r--r--contrib/ipfilter/lib/ipft_td.c4
-rw-r--r--contrib/ipfilter/lib/ipft_tx.c23
-rw-r--r--contrib/ipfilter/lib/ipoptsec.c2
-rw-r--r--contrib/ipfilter/lib/kmem.c7
-rw-r--r--contrib/ipfilter/lib/kmem.h2
-rw-r--r--contrib/ipfilter/lib/load_hash.c6
-rw-r--r--contrib/ipfilter/lib/load_hashnode.c2
-rw-r--r--contrib/ipfilter/lib/load_pool.c9
-rw-r--r--contrib/ipfilter/lib/load_poolnode.c2
-rw-r--r--contrib/ipfilter/lib/loglevel.c2
-rw-r--r--contrib/ipfilter/lib/make_range.c2
-rw-r--r--contrib/ipfilter/lib/nat_setgroupmap.c2
-rw-r--r--contrib/ipfilter/lib/natparse.c2
-rw-r--r--contrib/ipfilter/lib/optname.c2
-rw-r--r--contrib/ipfilter/lib/optprint.c2
-rw-r--r--contrib/ipfilter/lib/optprintv6.c2
-rw-r--r--contrib/ipfilter/lib/optvalue.c2
-rw-r--r--contrib/ipfilter/lib/parse.c2
-rw-r--r--contrib/ipfilter/lib/portname.c2
-rw-r--r--contrib/ipfilter/lib/portnum.c2
-rw-r--r--contrib/ipfilter/lib/ports.c2
-rw-r--r--contrib/ipfilter/lib/print_toif.c2
-rw-r--r--contrib/ipfilter/lib/printactivenat.c2
-rw-r--r--contrib/ipfilter/lib/printaps.c2
-rw-r--r--contrib/ipfilter/lib/printbuf.c2
-rw-r--r--contrib/ipfilter/lib/printfr.c57
-rw-r--r--contrib/ipfilter/lib/printfraginfo.c2
-rw-r--r--contrib/ipfilter/lib/printhostmap.c5
-rw-r--r--contrib/ipfilter/lib/printhostmask.c2
-rw-r--r--contrib/ipfilter/lib/printifname.c2
-rw-r--r--contrib/ipfilter/lib/printip.c2
-rw-r--r--contrib/ipfilter/lib/printlog.c11
-rw-r--r--contrib/ipfilter/lib/printmask.c2
-rw-r--r--contrib/ipfilter/lib/printnat.c46
-rw-r--r--contrib/ipfilter/lib/printpacket.c5
-rw-r--r--contrib/ipfilter/lib/printportcmp.c2
-rw-r--r--contrib/ipfilter/lib/printstate.c4
-rw-r--r--contrib/ipfilter/lib/ratoi.c2
-rw-r--r--contrib/ipfilter/lib/ratoui.c2
-rw-r--r--contrib/ipfilter/lib/remove_hash.c2
-rw-r--r--contrib/ipfilter/lib/remove_hashnode.c2
-rw-r--r--contrib/ipfilter/lib/remove_pool.c2
-rw-r--r--contrib/ipfilter/lib/remove_poolnode.c2
-rw-r--r--contrib/ipfilter/lib/tcp_flags.c2
-rw-r--r--contrib/ipfilter/lib/tcpflags.c2
-rw-r--r--contrib/ipfilter/lib/tcpoptnames.c2
-rw-r--r--contrib/ipfilter/lib/to_interface.c2
-rw-r--r--contrib/ipfilter/lib/v6ionames.c3
-rw-r--r--contrib/ipfilter/lib/v6optvalue.c2
-rw-r--r--contrib/ipfilter/lib/verbose.c2
78 files changed, 210 insertions, 155 deletions
diff --git a/contrib/ipfilter/lib/addicmp.c b/contrib/ipfilter/lib/addicmp.c
index eb6e8a7..884da7b 100644
--- a/contrib/ipfilter/lib/addicmp.c
+++ b/contrib/ipfilter/lib/addicmp.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: addicmp.c,v 1.10.2.1 2004/12/09 19:41:16 darrenr Exp
+ * $Id: addicmp.c,v 1.10.2.1 2004/12/09 19:41:16 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/addipopt.c b/contrib/ipfilter/lib/addipopt.c
index e775184..6dc7f48 100644
--- a/contrib/ipfilter/lib/addipopt.c
+++ b/contrib/ipfilter/lib/addipopt.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: addipopt.c,v 1.7 2002/01/28 06:50:45 darrenr Exp
+ * $Id: addipopt.c,v 1.7 2002/01/28 06:50:45 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/addkeep.c b/contrib/ipfilter/lib/addkeep.c
index 5765c52..2ec8dde 100644
--- a/contrib/ipfilter/lib/addkeep.c
+++ b/contrib/ipfilter/lib/addkeep.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: addkeep.c,v 1.12 2003/12/01 01:59:42 darrenr Exp
+ * $Id: addkeep.c,v 1.12 2003/12/01 01:59:42 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/binprint.c b/contrib/ipfilter/lib/binprint.c
index 6d99218..b475aa1 100644
--- a/contrib/ipfilter/lib/binprint.c
+++ b/contrib/ipfilter/lib/binprint.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: binprint.c,v 1.8 2002/05/14 15:18:56 darrenr Exp
+ * $Id: binprint.c,v 1.8 2002/05/14 15:18:56 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/buildopts.c b/contrib/ipfilter/lib/buildopts.c
index 92686f6..7a8df09 100644
--- a/contrib/ipfilter/lib/buildopts.c
+++ b/contrib/ipfilter/lib/buildopts.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: buildopts.c,v 1.6 2002/01/28 06:50:45 darrenr Exp
+ * $Id: buildopts.c,v 1.6 2002/01/28 06:50:45 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/checkrev.c b/contrib/ipfilter/lib/checkrev.c
index 882aeb7..97ed689 100644
--- a/contrib/ipfilter/lib/checkrev.c
+++ b/contrib/ipfilter/lib/checkrev.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: checkrev.c,v 1.12.2.1 2004/03/09 14:44:39 darrenr Exp
+ * $Id: checkrev.c,v 1.12.2.1 2004/03/09 14:44:39 darrenr Exp $
*/
#include <sys/ioctl.h>
diff --git a/contrib/ipfilter/lib/count4bits.c b/contrib/ipfilter/lib/count4bits.c
index 56b4c86..b2aaa3b 100644
--- a/contrib/ipfilter/lib/count4bits.c
+++ b/contrib/ipfilter/lib/count4bits.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: count4bits.c,v 1.1 2002/06/15 04:46:39 darrenr Exp
+ * $Id: count4bits.c,v 1.1 2002/06/15 04:46:39 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/count6bits.c b/contrib/ipfilter/lib/count6bits.c
index fe1bf4b..6011e96 100644
--- a/contrib/ipfilter/lib/count6bits.c
+++ b/contrib/ipfilter/lib/count6bits.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: count6bits.c,v 1.4 2001/06/09 17:09:23 darrenr Exp
+ * $Id: count6bits.c,v 1.4 2001/06/09 17:09:23 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c
index 58974c1..d5f6ab2 100644
--- a/contrib/ipfilter/lib/debug.c
+++ b/contrib/ipfilter/lib/debug.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: debug.c,v 1.6 2001/06/09 17:09:24 darrenr Exp
+ * $Id: debug.c,v 1.6 2001/06/09 17:09:24 darrenr Exp $
*/
#if defined(__STDC__)
diff --git a/contrib/ipfilter/lib/extras.c b/contrib/ipfilter/lib/extras.c
index 5d3c8dc..926ec43 100644
--- a/contrib/ipfilter/lib/extras.c
+++ b/contrib/ipfilter/lib/extras.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp
+ * $Id: extras.c,v 1.12 2002/07/13 12:06:49 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/facpri.c b/contrib/ipfilter/lib/facpri.c
index 4637916..a1f9f6b 100644
--- a/contrib/ipfilter/lib/facpri.c
+++ b/contrib/ipfilter/lib/facpri.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: facpri.c,v 1.6 2003/12/01 01:59:43 darrenr Exp
+ * $Id: facpri.c,v 1.6.2.1 2005/11/14 17:45:06 darrenr Exp $
*/
#include <stdio.h>
@@ -22,7 +22,7 @@
#include "facpri.h"
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: facpri.c,v 1.6 2003/12/01 01:59:43 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: facpri.c,v 1.6.2.1 2005/11/14 17:45:06 darrenr Exp $";
#endif
@@ -42,10 +42,10 @@ table_t facs[] = {
#else
{ "cron", LOG_CRON1 },
#endif
-#ifdef LOG_FTP
+#ifdef LOG_FTP
{ "ftp", LOG_FTP },
#endif
-#ifdef LOG_AUTHPRIV
+#ifdef LOG_AUTHPRIV
{ "authpriv", LOG_AUTHPRIV },
#endif
#ifdef LOG_AUDIT
diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h
index c902086..212cd15 100644
--- a/contrib/ipfilter/lib/facpri.h
+++ b/contrib/ipfilter/lib/facpri.h
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: facpri.h,v 1.3 2001/06/09 17:19:50 darrenr Exp
+ * $Id: facpri.h,v 1.3 2001/06/09 17:19:50 darrenr Exp $
*/
#ifndef __FACPRI_H__
diff --git a/contrib/ipfilter/lib/fill6bits.c b/contrib/ipfilter/lib/fill6bits.c
index 12e6579..ec34d4e 100644
--- a/contrib/ipfilter/lib/fill6bits.c
+++ b/contrib/ipfilter/lib/fill6bits.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: fill6bits.c,v 1.5 2002/03/27 15:09:57 darrenr Exp
+ * $Id: fill6bits.c,v 1.5 2002/03/27 15:09:57 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/flags.c b/contrib/ipfilter/lib/flags.c
index 543d61b..1b9dc72 100644
--- a/contrib/ipfilter/lib/flags.c
+++ b/contrib/ipfilter/lib/flags.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: flags.c,v 1.4 2002/11/02 07:16:36 darrenr Exp
+ * $Id: flags.c,v 1.4 2002/11/02 07:16:36 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/genmask.c b/contrib/ipfilter/lib/genmask.c
index 178c466..2155f37 100644
--- a/contrib/ipfilter/lib/genmask.c
+++ b/contrib/ipfilter/lib/genmask.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: genmask.c,v 1.7 2003/11/11 13:40:15 darrenr Exp
+ * $Id: genmask.c,v 1.7 2003/11/11 13:40:15 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/getline.c b/contrib/ipfilter/lib/getline.c
index 137068f..2d3f9bd 100644
--- a/contrib/ipfilter/lib/getline.c
+++ b/contrib/ipfilter/lib/getline.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: getline.c,v 1.3 2001/06/09 17:09:24 darrenr Exp
+ * $Id: getline.c,v 1.3 2001/06/09 17:09:24 darrenr Exp $
*/
#include <stdio.h>
diff --git a/contrib/ipfilter/lib/getnattype.c b/contrib/ipfilter/lib/getnattype.c
index 90d7ba4..beb0a8a 100644
--- a/contrib/ipfilter/lib/getnattype.c
+++ b/contrib/ipfilter/lib/getnattype.c
@@ -11,7 +11,7 @@
#include "kmem.h"
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: getnattype.c,v 1.3 2004/01/17 17:26:07 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: getnattype.c,v 1.3 2004/01/17 17:26:07 darrenr Exp $";
#endif
diff --git a/contrib/ipfilter/lib/getproto.c b/contrib/ipfilter/lib/getproto.c
index 2581e28..ec87490 100644
--- a/contrib/ipfilter/lib/getproto.c
+++ b/contrib/ipfilter/lib/getproto.c
@@ -14,6 +14,14 @@ char *name;
if (*s == '\0')
return atoi(name);
+#ifdef _AIX51
+ /*
+ * For some bogus reason, "ip" is 252 in /etc/protocols on AIX 5
+ */
+ if (!strcasecmp(name, "ip"))
+ return 0;
+#endif
+
p = getprotobyname(name);
if (p != NULL)
return p->p_proto;
diff --git a/contrib/ipfilter/lib/hostmask.c b/contrib/ipfilter/lib/hostmask.c
index b6ea5ad..ba33d48 100644
--- a/contrib/ipfilter/lib/hostmask.c
+++ b/contrib/ipfilter/lib/hostmask.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: hostmask.c,v 1.10 2002/01/28 06:50:46 darrenr Exp
+ * $Id: hostmask.c,v 1.10 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/hostnum.c b/contrib/ipfilter/lib/hostnum.c
index f517860..78f9382 100644
--- a/contrib/ipfilter/lib/hostnum.c
+++ b/contrib/ipfilter/lib/hostnum.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: hostnum.c,v 1.10.2.1 2004/12/09 19:41:20 darrenr Exp
+ * $Id: hostnum.c,v 1.10.2.1 2004/12/09 19:41:20 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/icmpcode.c b/contrib/ipfilter/lib/icmpcode.c
index c458d28..ac4501d 100644
--- a/contrib/ipfilter/lib/icmpcode.c
+++ b/contrib/ipfilter/lib/icmpcode.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: icmpcode.c,v 1.7.2.1 2004/12/09 19:41:20 darrenr Exp
+ * $Id: icmpcode.c,v 1.7.2.1 2004/12/09 19:41:20 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c
index 287e5ff..c7ae443 100644
--- a/contrib/ipfilter/lib/inet_addr.c
+++ b/contrib/ipfilter/lib/inet_addr.c
@@ -57,7 +57,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
-static const char rcsid[] = "@(#)Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 darrenr Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
diff --git a/contrib/ipfilter/lib/initparse.c b/contrib/ipfilter/lib/initparse.c
index 1f565d2..5f52f95 100644
--- a/contrib/ipfilter/lib/initparse.c
+++ b/contrib/ipfilter/lib/initparse.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: initparse.c,v 1.6 2002/01/28 06:50:46 darrenr Exp
+ * $Id: initparse.c,v 1.6 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/ionames.c b/contrib/ipfilter/lib/ionames.c
index 0f7060b..5d7d2ac 100644
--- a/contrib/ipfilter/lib/ionames.c
+++ b/contrib/ipfilter/lib/ionames.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ionames.c,v 1.7 2002/01/28 06:50:46 darrenr Exp
+ * $Id: ionames.c,v 1.7 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/ipft_ef.c b/contrib/ipfilter/lib/ipft_ef.c
index b9a7054..9e2093f 100644
--- a/contrib/ipfilter/lib/ipft_ef.c
+++ b/contrib/ipfilter/lib/ipft_ef.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp
+ * $Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp $
*/
/*
@@ -33,7 +33,7 @@ etherfind -n -t
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_ef.c 1.6 2/4/96 (C)1995 Darren Reed";
-static const char rcsid[] = "@(#)Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_ef.c,v 1.14 2004/01/08 13:34:31 darrenr Exp $";
#endif
static int etherf_open __P((char *));
diff --git a/contrib/ipfilter/lib/ipft_hx.c b/contrib/ipfilter/lib/ipft_hx.c
index 4e0f98e..efc0a413 100644
--- a/contrib/ipfilter/lib/ipft_hx.c
+++ b/contrib/ipfilter/lib/ipft_hx.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_hx.c 1.1 3/9/96 (C) 1996 Darren Reed";
-static const char rcsid[] = "@(#)Id: ipft_hx.c,v 1.11.4.1 2004/12/09 19:41:20 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_hx.c,v 1.11.4.3 2005/12/04 10:07:21 darrenr Exp $";
#endif
#include <ctype.h>
@@ -83,7 +83,7 @@ int cnt, *dir;
*s = '\0';
if (!*line)
continue;
- if (!(opts & OPT_BRIEF)) {
+ if ((opts & OPT_DEBUG) != 0) {
printf("input: %s", line);
}
@@ -108,7 +108,7 @@ int cnt, *dir;
s = line;
t = (char *)ip;
ip = (ip_t *)readhex(s, (char *)ip);
- if (!(opts & OPT_BRIEF)) {
+ if ((opts & OPT_DEBUG) != 0) {
if (opts & OPT_ASCII) {
if (t < (char *)ip)
putchar('\t');
@@ -124,6 +124,8 @@ int cnt, *dir;
fflush(stdout);
}
}
+ if (feof(tfp))
+ return 0;
return -1;
}
diff --git a/contrib/ipfilter/lib/ipft_pc.c b/contrib/ipfilter/lib/ipft_pc.c
index 9b7da65..e3e2bd3 100644
--- a/contrib/ipfilter/lib/ipft_pc.c
+++ b/contrib/ipfilter/lib/ipft_pc.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipft_pc.c,v 1.10 2004/02/07 18:17:40 darrenr Exp
+ * $Id: ipft_pc.c,v 1.10.2.1 2005/12/04 09:55:10 darrenr Exp $
*/
#include "ipf.h"
#include "pcap-ipf.h"
@@ -13,7 +13,7 @@
#include "ipt.h"
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: ipft_pc.c,v 1.10 2004/02/07 18:17:40 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.10.2.1 2005/12/04 09:55:10 darrenr Exp $";
#endif
struct llc {
@@ -162,10 +162,19 @@ static int pcap_close()
static int pcap_read_rec(rec)
struct pcap_pkthdr *rec;
{
- int n, p;
+ int n, p, i;
+ char *s;
- if (read(pfd, (char *)rec, sizeof(*rec)) != sizeof(*rec))
- return -2;
+ s = (char *)rec;
+ n = sizeof(*rec);
+
+ while (n > 0) {
+ i = read(pfd, (char *)rec, sizeof(*rec));
+ if (i <= 0)
+ return -2;
+ s += i;
+ n -= i;
+ }
if (swapped) {
rec->ph_clen = SWAPLONG(rec->ph_clen);
@@ -178,6 +187,8 @@ struct pcap_pkthdr *rec;
if (!n || n < 0)
return -3;
+ if (p < 0 || p > 65536)
+ return -4;
return p;
}
@@ -224,7 +235,7 @@ int cnt, *dir;
struct pcap_pkthdr rec;
struct llc *l;
char *s, ty[4];
- int i, n;
+ int i, j, n;
l = llcp;
@@ -238,8 +249,14 @@ int cnt, *dir;
bufp = realloc(bufp, i);
s = bufp;
- if (read(pfd, s, i) != i)
- return -2;
+ for (j = i, n = 0; j > 0; ) {
+ n = read(pfd, s, j);
+ if (n <= 0)
+ return -2;
+ j -= n;
+ s += n;
+ }
+ s = bufp;
i -= l->lc_sz;
s += l->lc_to;
diff --git a/contrib/ipfilter/lib/ipft_sn.c b/contrib/ipfilter/lib/ipft_sn.c
index 61ce875..5841ed5 100644
--- a/contrib/ipfilter/lib/ipft_sn.c
+++ b/contrib/ipfilter/lib/ipft_sn.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp
+ * $Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp $
*/
/*
@@ -16,7 +16,7 @@
#include "ipt.h"
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_sn.c,v 1.7 2003/02/16 02:32:36 darrenr Exp $";
#endif
struct llc {
diff --git a/contrib/ipfilter/lib/ipft_td.c b/contrib/ipfilter/lib/ipft_td.c
index e6367ff..758eb51 100644
--- a/contrib/ipfilter/lib/ipft_td.c
+++ b/contrib/ipfilter/lib/ipft_td.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp
+ * $Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp $
*/
/*
@@ -42,7 +42,7 @@ tcpdump -nqte
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_td.c 1.8 2/4/96 (C)1995 Darren Reed";
-static const char rcsid[] = "@(#)Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_td.c,v 1.15 2004/01/08 13:34:31 darrenr Exp $";
#endif
static int tcpd_open __P((char *));
diff --git a/contrib/ipfilter/lib/ipft_tx.c b/contrib/ipfilter/lib/ipft_tx.c
index 2f9cff9..17bc6de 100644
--- a/contrib/ipfilter/lib/ipft_tx.c
+++ b/contrib/ipfilter/lib/ipft_tx.c
@@ -5,11 +5,11 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipft_tx.c,v 1.15.2.2 2004/12/09 19:41:21 darrenr Exp
+ * $Id: ipft_tx.c,v 1.15.2.6 2005/12/04 10:07:22 darrenr Exp $
*/
#if !defined(lint)
static const char sccsid[] = "@(#)ipft_tx.c 1.7 6/5/96 (C) 1993 Darren Reed";
-static const char rcsid[] = "@(#)Id: ipft_tx.c,v 1.15.2.2 2004/12/09 19:41:21 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: ipft_tx.c,v 1.15.2.6 2005/12/04 10:07:22 darrenr Exp $";
#endif
#include <ctype.h>
@@ -161,7 +161,7 @@ int cnt, *dir;
*s = '\0';
if (!*line)
continue;
- if (!(opts & OPT_BRIEF))
+ if ((opts & OPT_DEBUG) != 0)
printf("input: %s\n", line);
*ifn = NULL;
*dir = 0;
@@ -172,6 +172,8 @@ int cnt, *dir;
return sizeof(ip_t);
#endif
}
+ if (feof(tfp))
+ return 0;
return -1;
}
@@ -297,15 +299,22 @@ int *out;
char **s, *t;
int i;
+ t = strchr(*cpp, ',');
+ if (t != NULL)
+ *t = '\0';
+
for (s = tx_icmptypes, i = 0; !*s || strcmp(*s, "END");
- s++, i++)
- if (*s && !strncasecmp(*cpp, *s, strlen(*s))) {
+ s++, i++) {
+ if (*s && !strcasecmp(*cpp, *s)) {
ic->icmp_type = i;
- if ((t = strchr(*cpp, ',')))
- ic->icmp_code = atoi(t+1);
+ if (t != NULL)
+ ic->icmp_code = atoi(t + 1);
cpp++;
break;
}
+ }
+ if (t != NULL)
+ *t = ',';
}
if (*cpp && !strcasecmp(*cpp, "opt")) {
diff --git a/contrib/ipfilter/lib/ipoptsec.c b/contrib/ipfilter/lib/ipoptsec.c
index 24a58ac..5990170 100644
--- a/contrib/ipfilter/lib/ipoptsec.c
+++ b/contrib/ipfilter/lib/ipoptsec.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ipoptsec.c,v 1.2 2002/01/28 06:50:46 darrenr Exp
+ * $Id: ipoptsec.c,v 1.2 2002/01/28 06:50:46 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c
index 789219e..04a64d1 100644
--- a/contrib/ipfilter/lib/kmem.c
+++ b/contrib/ipfilter/lib/kmem.c
@@ -18,7 +18,7 @@
#include <string.h>
#include <fcntl.h>
#include <sys/file.h>
-#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux)
+#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux) && !defined(_AIX51)
#include <kvm.h>
#endif
#include <fcntl.h>
@@ -44,12 +44,13 @@
#if !defined(lint)
static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed";
-static const char rcsid[] = "@(#)Id: kmem.c,v 1.16.2.1 2004/06/20 10:25:58 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: kmem.c,v 1.16.2.2 2005/06/12 07:18:41 darrenr Exp $";
#endif
-#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && !defined(linux)
+#if !defined(__sgi) && !defined(__hpux) && !defined(__osf__) && \
+ !defined(linux) && !defined(_AIX51)
/*
* For all platforms where there is a libkvm and a kvm_t, we use that...
*/
diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h
index dc29a52..c1dd7f9 100644
--- a/contrib/ipfilter/lib/kmem.h
+++ b/contrib/ipfilter/lib/kmem.h
@@ -4,7 +4,7 @@
* Copyright (C) 1993-2001 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
- * Id: kmem.h,v 1.2 2002/08/21 22:57:36 darrenr Exp
+ * $Id: kmem.h,v 1.2 2002/08/21 22:57:36 darrenr Exp $
*/
#ifndef __KMEM_H__
diff --git a/contrib/ipfilter/lib/load_hash.c b/contrib/ipfilter/lib/load_hash.c
index 4a13624..ff093c9 100644
--- a/contrib/ipfilter/lib/load_hash.c
+++ b/contrib/ipfilter/lib/load_hash.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: load_hash.c,v 1.11.2.2 2005/02/01 02:44:05 darrenr Exp
+ * $Id: load_hash.c,v 1.11.2.3 2005/11/13 15:41:12 darrenr Exp $
*/
#include <fcntl.h>
@@ -72,8 +72,8 @@ ioctlfunc_t iocfunc;
}
}
- strncpy(op.iplo_name, iph.iph_name, sizeof(op.iplo_name));
- strncpy(iphp->iph_name, iph.iph_name, sizeof(op.iplo_name));
+ strncpy(iph.iph_name, op.iplo_name, sizeof(op.iplo_name));
+ strncpy(iphp->iph_name, op.iplo_name, sizeof(op.iplo_name));
if (opts & OPT_VERBOSE) {
for (a = list; a != NULL; a = a->ipe_next) {
diff --git a/contrib/ipfilter/lib/load_hashnode.c b/contrib/ipfilter/lib/load_hashnode.c
index cf42280..083bea8 100644
--- a/contrib/ipfilter/lib/load_hashnode.c
+++ b/contrib/ipfilter/lib/load_hashnode.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: load_hashnode.c,v 1.2.4.1 2004/03/06 14:33:28 darrenr Exp
+ * $Id: load_hashnode.c,v 1.2.4.1 2004/03/06 14:33:28 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/load_pool.c b/contrib/ipfilter/lib/load_pool.c
index 65ea05d..574cd2c 100644
--- a/contrib/ipfilter/lib/load_pool.c
+++ b/contrib/ipfilter/lib/load_pool.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: load_pool.c,v 1.14.2.2 2005/02/01 02:44:06 darrenr Exp
+ * $Id: load_pool.c,v 1.14.2.3 2005/11/13 15:41:13 darrenr Exp $
*/
#include <fcntl.h>
@@ -38,7 +38,7 @@ ioctlfunc_t iocfunc;
op.iplo_struct = &pool;
bzero((char *)&pool, sizeof(pool));
strncpy(pool.ipo_name, plp->ipo_name, sizeof(pool.ipo_name));
- if (*plp->ipo_name == '\0')
+ if (plp->ipo_name[0] == '\0')
op.iplo_arg |= IPOOL_ANON;
if ((opts & OPT_REMOVE) == 0) {
@@ -49,6 +49,9 @@ ioctlfunc_t iocfunc;
}
}
+ if (op.iplo_arg & IPOOL_ANON)
+ strncpy(pool.ipo_name, op.iplo_name, sizeof(pool.ipo_name));
+
if ((opts & OPT_VERBOSE) != 0) {
pool.ipo_list = plp->ipo_list;
printpool(&pool, bcopywrap, pool.ipo_name, opts);
@@ -56,7 +59,7 @@ ioctlfunc_t iocfunc;
}
for (a = plp->ipo_list; a != NULL; a = a->ipn_next)
- load_poolnode(plp->ipo_unit, plp->ipo_name, a, iocfunc);
+ load_poolnode(plp->ipo_unit, pool.ipo_name, a, iocfunc);
if ((opts & OPT_REMOVE) != 0) {
if ((*iocfunc)(poolfd, SIOCLOOKUPDELTABLE, &op))
diff --git a/contrib/ipfilter/lib/load_poolnode.c b/contrib/ipfilter/lib/load_poolnode.c
index eb17481..e8a6fe6 100644
--- a/contrib/ipfilter/lib/load_poolnode.c
+++ b/contrib/ipfilter/lib/load_poolnode.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: load_poolnode.c,v 1.3.2.1 2004/03/06 14:33:29 darrenr Exp
+ * $Id: load_poolnode.c,v 1.3.2.1 2004/03/06 14:33:29 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/loglevel.c b/contrib/ipfilter/lib/loglevel.c
index 4dc875f..af5dda8 100644
--- a/contrib/ipfilter/lib/loglevel.c
+++ b/contrib/ipfilter/lib/loglevel.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: loglevel.c,v 1.5 2001/06/09 17:09:24 darrenr Exp
+ * $Id: loglevel.c,v 1.5 2001/06/09 17:09:24 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/make_range.c b/contrib/ipfilter/lib/make_range.c
index ae576df..716cc5a 100644
--- a/contrib/ipfilter/lib/make_range.c
+++ b/contrib/ipfilter/lib/make_range.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: make_range.c,v 1.2 2002/05/18 07:27:52 darrenr Exp
+ * $Id: make_range.c,v 1.2 2002/05/18 07:27:52 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/nat_setgroupmap.c b/contrib/ipfilter/lib/nat_setgroupmap.c
index 5c732b1..d4e637e 100644
--- a/contrib/ipfilter/lib/nat_setgroupmap.c
+++ b/contrib/ipfilter/lib/nat_setgroupmap.c
@@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*/
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: nat_setgroupmap.c,v 1.1 2003/04/13 06:40:14 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: nat_setgroupmap.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $";
#endif
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/natparse.c b/contrib/ipfilter/lib/natparse.c
index de5b388..512eb35 100644
--- a/contrib/ipfilter/lib/natparse.c
+++ b/contrib/ipfilter/lib/natparse.c
@@ -7,7 +7,7 @@
*/
#if !defined(lint)
static const char sccsid[] ="@(#)ipnat.c 1.9 6/5/96 (C) 1993 Darren Reed";
-static const char rcsid[] = "@(#)Id: natparse.c,v 1.8.2.1 2004/12/09 19:41:21 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: natparse.c,v 1.8.2.1 2004/12/09 19:41:21 darrenr Exp $";
#endif
#include <sys/ioctl.h>
diff --git a/contrib/ipfilter/lib/optname.c b/contrib/ipfilter/lib/optname.c
index d56c4d5..813a0df 100644
--- a/contrib/ipfilter/lib/optname.c
+++ b/contrib/ipfilter/lib/optname.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: optname.c,v 1.3 2001/06/09 17:09:24 darrenr Exp
+ * $Id: optname.c,v 1.3 2001/06/09 17:09:24 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/optprint.c b/contrib/ipfilter/lib/optprint.c
index 890eb53..7b5c3c6 100644
--- a/contrib/ipfilter/lib/optprint.c
+++ b/contrib/ipfilter/lib/optprint.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: optprint.c,v 1.6 2002/07/13 15:59:49 darrenr Exp
+ * $Id: optprint.c,v 1.6 2002/07/13 15:59:49 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/optprintv6.c b/contrib/ipfilter/lib/optprintv6.c
index 8f33305..086496d 100644
--- a/contrib/ipfilter/lib/optprintv6.c
+++ b/contrib/ipfilter/lib/optprintv6.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: optprintv6.c,v 1.2 2003/04/30 00:39:39 darrenr Exp
+ * $Id: optprintv6.c,v 1.2 2003/04/30 00:39:39 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/optvalue.c b/contrib/ipfilter/lib/optvalue.c
index b30e030..3609448 100644
--- a/contrib/ipfilter/lib/optvalue.c
+++ b/contrib/ipfilter/lib/optvalue.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: optvalue.c,v 1.2 2002/01/28 06:50:47 darrenr Exp
+ * $Id: optvalue.c,v 1.2 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/parse.c b/contrib/ipfilter/lib/parse.c
index 30fc117..8bb121c 100644
--- a/contrib/ipfilter/lib/parse.c
+++ b/contrib/ipfilter/lib/parse.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: parse.c,v 1.34.2.1 2004/12/09 19:41:21 darrenr Exp
+ * $Id: parse.c,v 1.34.2.1 2004/12/09 19:41:21 darrenr Exp $
*/
#include <ctype.h>
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/portname.c b/contrib/ipfilter/lib/portname.c
index 0709fc5..4bf1c09 100644
--- a/contrib/ipfilter/lib/portname.c
+++ b/contrib/ipfilter/lib/portname.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: portname.c,v 1.7 2003/08/14 14:27:43 darrenr Exp
+ * $Id: portname.c,v 1.7 2003/08/14 14:27:43 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/portnum.c b/contrib/ipfilter/lib/portnum.c
index c290c93..f80f86d 100644
--- a/contrib/ipfilter/lib/portnum.c
+++ b/contrib/ipfilter/lib/portnum.c
@@ -6,7 +6,7 @@
* See the IPFILTER.LICENCE file for details on licencing.
*
*
- * Id: portnum.c,v 1.6.4.1 2004/12/09 19:41:22 darrenr Exp
+ * $Id: portnum.c,v 1.6.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/ports.c b/contrib/ipfilter/lib/ports.c
index deee05e..2230805 100644
--- a/contrib/ipfilter/lib/ports.c
+++ b/contrib/ipfilter/lib/ports.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ports.c,v 1.9.4.1 2004/12/09 19:41:22 darrenr Exp
+ * $Id: ports.c,v 1.9.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/print_toif.c b/contrib/ipfilter/lib/print_toif.c
index be6eaec..4431004 100644
--- a/contrib/ipfilter/lib/print_toif.c
+++ b/contrib/ipfilter/lib/print_toif.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp
+ * $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printactivenat.c b/contrib/ipfilter/lib/printactivenat.c
index 78b0ed9..2155378 100644
--- a/contrib/ipfilter/lib/printactivenat.c
+++ b/contrib/ipfilter/lib/printactivenat.c
@@ -12,7 +12,7 @@
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: printactivenat.c,v 1.3.2.4 2004/05/11 16:07:32 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: printactivenat.c,v 1.3.2.4 2004/05/11 16:07:32 darrenr Exp $";
#endif
diff --git a/contrib/ipfilter/lib/printaps.c b/contrib/ipfilter/lib/printaps.c
index df69a7b..235a5fd 100644
--- a/contrib/ipfilter/lib/printaps.c
+++ b/contrib/ipfilter/lib/printaps.c
@@ -13,7 +13,7 @@
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: printaps.c,v 1.4 2004/01/08 13:34:32 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: printaps.c,v 1.4 2004/01/08 13:34:32 darrenr Exp $";
#endif
diff --git a/contrib/ipfilter/lib/printbuf.c b/contrib/ipfilter/lib/printbuf.c
index fa24fbe..1f0763e 100644
--- a/contrib/ipfilter/lib/printbuf.c
+++ b/contrib/ipfilter/lib/printbuf.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printbuf.c,v 1.5.4.1 2004/12/09 19:41:22 darrenr Exp
+ * $Id: printbuf.c,v 1.5.4.1 2004/12/09 19:41:22 darrenr Exp $
*/
#include <ctype.h>
diff --git a/contrib/ipfilter/lib/printfr.c b/contrib/ipfilter/lib/printfr.c
index a7ab1d2..fb26795 100644
--- a/contrib/ipfilter/lib/printfr.c
+++ b/contrib/ipfilter/lib/printfr.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printfr.c,v 1.43.2.10 2005/03/16 15:38:13 darrenr Exp
+ * $Id: printfr.c,v 1.43.2.15 2005/11/14 17:45:06 darrenr Exp $
*/
#include "ipf.h"
@@ -22,7 +22,7 @@ u_32_t *addr, *mask;
switch (type)
{
case FRI_BROADCAST :
- suffix = "/bcast";
+ suffix = "bcast";
break;
case FRI_DYNAMIC :
@@ -32,15 +32,15 @@ u_32_t *addr, *mask;
break;
case FRI_NETWORK :
- suffix = "/net";
+ suffix = "net";
break;
case FRI_NETMASKED :
- suffix = "/netmasked";
+ suffix = "netmasked";
break;
case FRI_PEERADDR :
- suffix = "/peer";
+ suffix = "peer";
break;
case FRI_LOOKUP :
@@ -107,6 +107,9 @@ ioctlfunc_t iocfunc;
if ((fp->fr_type & FR_T_BUILTIN) != 0)
printf("# Builtin: ");
+ if (fp->fr_collect != 0)
+ printf("%u ", fp->fr_collect);
+
if (fp->fr_type == FR_T_CALLFUNC) {
;
} else if (fp->fr_func != NULL) {
@@ -189,12 +192,11 @@ ioctlfunc_t iocfunc;
if (*fp->fr_ifnames[2]) {
printifname("", fp->fr_ifnames[2],
fp->fr_ifas[2]);
- putchar(' ');
-
if (*fp->fr_ifnames[3]) {
printifname(",", fp->fr_ifnames[3],
fp->fr_ifas[3]);
}
+ putchar(' ');
}
}
@@ -208,10 +210,10 @@ ioctlfunc_t iocfunc;
pr = -1;
} else if (fp->fr_mip.fi_p) {
pr = fp->fr_ip.fi_p;
- if ((p = getprotobynumber(fp->fr_proto)))
- printf("proto %s ", p->p_name);
- else
- printf("proto %d ", fp->fr_proto);
+ p = getprotobynumber(pr);
+ printf("proto ");
+ printproto(p, pr, NULL);
+ putchar(' ');
}
}
@@ -370,6 +372,35 @@ ioctlfunc_t iocfunc;
if (!(fp->fr_flx & FI_OOW))
printf("not ");
printf("oow");
+ comma = ",";
+ }
+ if (fp->fr_mflx & FI_MBCAST) {
+ fputs(comma, stdout);
+ if (!(fp->fr_flx & FI_MBCAST))
+ printf("not ");
+ printf("mbcast");
+ comma = ",";
+ }
+ if (fp->fr_mflx & FI_BROADCAST) {
+ fputs(comma, stdout);
+ if (!(fp->fr_flx & FI_BROADCAST))
+ printf("not ");
+ printf("bcast");
+ comma = ",";
+ }
+ if (fp->fr_mflx & FI_MULTICAST) {
+ fputs(comma, stdout);
+ if (!(fp->fr_flx & FI_MULTICAST))
+ printf("not ");
+ printf("mcast");
+ comma = ",";
+ }
+ if (fp->fr_mflx & FI_STATE) {
+ fputs(comma, stdout);
+ if (!(fp->fr_flx & FI_STATE))
+ printf("not ");
+ printf("state");
+ comma = ",";
}
}
@@ -410,8 +441,8 @@ ioctlfunc_t iocfunc;
if (fp->fr_flags & (FR_FRSTRICT)) {
printf(" (");
if (fp->fr_flags & FR_FRSTRICT)
- printf(" strict");
- printf(" )");
+ printf("strict");
+ printf(")");
}
}
diff --git a/contrib/ipfilter/lib/printfraginfo.c b/contrib/ipfilter/lib/printfraginfo.c
index 461d497..05c0399 100644
--- a/contrib/ipfilter/lib/printfraginfo.c
+++ b/contrib/ipfilter/lib/printfraginfo.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printfraginfo.c,v 1.1.2.2 2004/03/23 15:15:45 darrenr Exp
+ * $Id: printfraginfo.c,v 1.1.2.2 2004/03/23 15:15:45 darrenr Exp $
*/
#include "ipf.h"
#include "kmem.h"
diff --git a/contrib/ipfilter/lib/printhostmap.c b/contrib/ipfilter/lib/printhostmap.c
index d4ffd44..cb5f8e7 100644
--- a/contrib/ipfilter/lib/printhostmap.c
+++ b/contrib/ipfilter/lib/printhostmap.c
@@ -6,8 +6,11 @@ void printhostmap(hmp, hv)
hostmap_t *hmp;
u_int hv;
{
+ struct in_addr in;
+
printf("%s,", inet_ntoa(hmp->hm_srcip));
printf("%s -> ", inet_ntoa(hmp->hm_dstip));
- printf("%s ", inet_ntoa(hmp->hm_mapip));
+ in.s_addr = htonl(hmp->hm_mapip.s_addr);
+ printf("%s ", inet_ntoa(in));
printf("(use = %d hv = %u)\n", hmp->hm_ref, hv);
}
diff --git a/contrib/ipfilter/lib/printhostmask.c b/contrib/ipfilter/lib/printhostmask.c
index 05121c3..19f87a6 100644
--- a/contrib/ipfilter/lib/printhostmask.c
+++ b/contrib/ipfilter/lib/printhostmask.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printhostmask.c,v 1.8 2002/04/11 15:01:19 darrenr Exp
+ * $Id: printhostmask.c,v 1.8 2002/04/11 15:01:19 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printifname.c b/contrib/ipfilter/lib/printifname.c
index 8726e625..bc74a34 100644
--- a/contrib/ipfilter/lib/printifname.c
+++ b/contrib/ipfilter/lib/printifname.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printifname.c,v 1.2 2002/01/28 06:50:47 darrenr Exp
+ * $Id: printifname.c,v 1.2 2002/01/28 06:50:47 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printip.c b/contrib/ipfilter/lib/printip.c
index 01b06bd..8841f0a 100644
--- a/contrib/ipfilter/lib/printip.c
+++ b/contrib/ipfilter/lib/printip.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printip.c,v 1.3 2002/07/13 12:10:27 darrenr Exp
+ * $Id: printip.c,v 1.3 2002/07/13 12:10:27 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printlog.c b/contrib/ipfilter/lib/printlog.c
index c255cf1..3139920 100644
--- a/contrib/ipfilter/lib/printlog.c
+++ b/contrib/ipfilter/lib/printlog.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printlog.c,v 1.6 2002/01/28 06:50:47 darrenr Exp
+ * $Id: printlog.c,v 1.6.4.1 2005/11/14 17:45:06 darrenr Exp $
*/
#include "ipf.h"
@@ -27,12 +27,9 @@ frentry_t *fp;
printf(" or-block");
if (fp->fr_loglevel != 0xffff) {
printf(" level ");
- if (fp->fr_loglevel & LOG_FACMASK) {
- s = fac_toname(fp->fr_loglevel);
- if (s == NULL)
- s = "!!!";
- } else
- s = "";
+ s = fac_toname(fp->fr_loglevel);
+ if (s == NULL)
+ s = "!!!";
u = pri_toname(fp->fr_loglevel);
if (u == NULL)
u = "!!!";
diff --git a/contrib/ipfilter/lib/printmask.c b/contrib/ipfilter/lib/printmask.c
index a477c66..195b9a9 100644
--- a/contrib/ipfilter/lib/printmask.c
+++ b/contrib/ipfilter/lib/printmask.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp
+ * $Id: printmask.c,v 1.5 2002/06/15 04:48:33 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printnat.c b/contrib/ipfilter/lib/printnat.c
index 09056b1..67b5a27 100644
--- a/contrib/ipfilter/lib/printnat.c
+++ b/contrib/ipfilter/lib/printnat.c
@@ -13,11 +13,9 @@
#if !defined(lint)
-static const char rcsid[] = "@(#)Id: printnat.c,v 1.22.2.8 2005/01/12 03:39:04 darrenr Exp";
+static const char rcsid[] = "@(#)$Id: printnat.c,v 1.22.2.11 2005/11/14 17:45:06 darrenr Exp $";
#endif
-static void printproto __P((ipnat_t *, struct protoent *));
-
/*
* Print out a NAT rule
*/
@@ -53,7 +51,7 @@ int opts;
printf(" %s", np->in_ifnames[0]);
if ((np->in_ifnames[1][0] != '\0') &&
(strncmp(np->in_ifnames[0], np->in_ifnames[1], LIFNAMSIZ) != 0)) {
- printf(",%s ", np->in_ifnames[1]);
+ printf(",%s", np->in_ifnames[1]);
}
putchar(' ');
@@ -102,13 +100,16 @@ int opts;
printf(" -> %s", inet_ntoa(np->in_in[0].in4));
if (np->in_flags & IPN_SPLIT)
printf(",%s", inet_ntoa(np->in_in[1].in4));
+ else if (np->in_inmsk == 0 && np->in_inip == 0)
+ printf("/0");
if (np->in_flags & IPN_TCPUDP) {
if ((np->in_flags & IPN_FIXEDDPORT) != 0)
printf(" port = %d", ntohs(np->in_pnext));
else
printf(" port %d", ntohs(np->in_pnext));
}
- printproto(np, pr);
+ putchar(' ');
+ printproto(pr, np->in_p, np);
if (np->in_flags & IPN_ROUNDR)
printf(" round-robin");
if (np->in_flags & IPN_FRAG)
@@ -164,10 +165,7 @@ int opts;
}
printf(" %.*s/", (int)sizeof(np->in_plabel),
np->in_plabel);
- if (pr != NULL)
- fputs(pr->p_name, stdout);
- else
- printf("%d", np->in_p);
+ printproto(pr, np->in_p, NULL);
} else if (np->in_redir == NAT_MAPBLK) {
if ((np->in_pmin == 0) &&
(np->in_flags & IPN_AUTOPORTMAP))
@@ -178,11 +176,11 @@ int opts;
printf("\n\tip modulous %d", np->in_pmax);
} else if (np->in_pmin || np->in_pmax) {
if (np->in_flags & IPN_ICMPQUERY) {
- printf(" icmpidmap");
+ printf(" icmpidmap ");
} else {
- printf(" portmap");
+ printf(" portmap ");
}
- printproto(np, pr);
+ printproto(pr, np->in_p, np);
if (np->in_flags & IPN_AUTOPORTMAP) {
printf(" auto");
if (opts & OPT_DEBUG)
@@ -194,8 +192,10 @@ int opts;
printf(" %d:%d", ntohs(np->in_pmin),
ntohs(np->in_pmax));
}
- } else if (np->in_flags & IPN_TCPUDP || np->in_p)
- printproto(np, pr);
+ } else if (np->in_flags & IPN_TCPUDP || np->in_p) {
+ putchar(' ');
+ printproto(pr, np->in_p, np);
+ }
if (np->in_flags & IPN_FRAG)
printf(" frag");
@@ -227,21 +227,3 @@ int opts;
np->in_tqehead[0], np->in_tqehead[1], np->in_comment);
}
}
-
-static void printproto(np, pr)
-ipnat_t *np;
-struct protoent *pr;
-{
- if ((np->in_flags & IPN_TCPUDP) == IPN_TCPUDP)
- printf(" tcp/udp");
- else if (np->in_flags & IPN_TCP)
- printf(" tcp");
- else if (np->in_flags & IPN_UDP)
- printf(" udp");
- else if (np->in_flags & IPN_ICMPQUERY)
- printf(" icmp");
- else if (pr != NULL)
- printf(" %s", pr->p_name);
- else
- printf(" %d", np->in_p);
-}
diff --git a/contrib/ipfilter/lib/printpacket.c b/contrib/ipfilter/lib/printpacket.c
index 4791b08..7090e38 100644
--- a/contrib/ipfilter/lib/printpacket.c
+++ b/contrib/ipfilter/lib/printpacket.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printpacket.c,v 1.12.4.1 2005/02/21 05:09:24 darrenr Exp
+ * $Id: printpacket.c,v 1.12.4.2 2005/12/04 09:33:06 darrenr Exp $
*/
#include "ipf.h"
@@ -52,7 +52,8 @@ struct ip *ip;
}
tcp = (struct tcphdr *)((char *)ip + (IP_HL(ip) << 2));
- printf("ip %d(%d) %d", ntohs(ip->ip_len), IP_HL(ip) << 2, ip->ip_p);
+ printf("ip #%d %d(%d) %d", ntohs(ip->ip_id), ntohs(ip->ip_len),
+ IP_HL(ip) << 2, ip->ip_p);
if (off & IP_OFFMASK)
printf(" @%d", off << 3);
printf(" %s", inet_ntoa(ip->ip_src));
diff --git a/contrib/ipfilter/lib/printportcmp.c b/contrib/ipfilter/lib/printportcmp.c
index 14854be..3f00db7 100644
--- a/contrib/ipfilter/lib/printportcmp.c
+++ b/contrib/ipfilter/lib/printportcmp.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: printportcmp.c,v 1.7 2003/02/16 02:31:05 darrenr Exp
+ * $Id: printportcmp.c,v 1.7 2003/02/16 02:31:05 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/printstate.c b/contrib/ipfilter/lib/printstate.c
index 2692052..c8e238d 100644
--- a/contrib/ipfilter/lib/printstate.c
+++ b/contrib/ipfilter/lib/printstate.c
@@ -144,8 +144,8 @@ u_long now;
PRINTF("\tpkt_flags & %x(%x) = %x,\t",
ips.is_flags & 0xf, ips.is_flags,
ips.is_flags >> 4);
- PRINTF("\tpkt_options & %x = %x\n", ips.is_optmsk,
- ips.is_opt);
+ PRINTF("\tpkt_options & %x = %x, %x = %x \n", ips.is_optmsk[0],
+ ips.is_opt[0], ips.is_optmsk[1], ips.is_opt[1]);
PRINTF("\tpkt_security & %x = %x, pkt_auth & %x = %x\n",
ips.is_secmsk, ips.is_sec, ips.is_authmsk,
ips.is_auth);
diff --git a/contrib/ipfilter/lib/ratoi.c b/contrib/ipfilter/lib/ratoi.c
index f6f7081..078f566 100644
--- a/contrib/ipfilter/lib/ratoi.c
+++ b/contrib/ipfilter/lib/ratoi.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ratoi.c,v 1.4 2001/06/09 17:09:25 darrenr Exp
+ * $Id: ratoi.c,v 1.4 2001/06/09 17:09:25 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/ratoui.c b/contrib/ipfilter/lib/ratoui.c
index 0a54ceb..4cf6a5a 100644
--- a/contrib/ipfilter/lib/ratoui.c
+++ b/contrib/ipfilter/lib/ratoui.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: ratoui.c,v 1.4 2001/06/09 17:09:25 darrenr Exp
+ * $Id: ratoui.c,v 1.4 2001/06/09 17:09:25 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/remove_hash.c b/contrib/ipfilter/lib/remove_hash.c
index fc52a0a..a60bdd3 100644
--- a/contrib/ipfilter/lib/remove_hash.c
+++ b/contrib/ipfilter/lib/remove_hash.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: remove_hash.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
+ * $Id: remove_hash.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/remove_hashnode.c b/contrib/ipfilter/lib/remove_hashnode.c
index 271c853..0b2098c 100644
--- a/contrib/ipfilter/lib/remove_hashnode.c
+++ b/contrib/ipfilter/lib/remove_hashnode.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: remove_hashnode.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
+ * $Id: remove_hashnode.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/remove_pool.c b/contrib/ipfilter/lib/remove_pool.c
index 2663cb8..8fbad2e 100644
--- a/contrib/ipfilter/lib/remove_pool.c
+++ b/contrib/ipfilter/lib/remove_pool.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: remove_pool.c,v 1.1 2003/04/13 06:40:14 darrenr Exp
+ * $Id: remove_pool.c,v 1.1 2003/04/13 06:40:14 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/remove_poolnode.c b/contrib/ipfilter/lib/remove_poolnode.c
index 5a1d639..51649ba 100644
--- a/contrib/ipfilter/lib/remove_poolnode.c
+++ b/contrib/ipfilter/lib/remove_poolnode.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: remove_poolnode.c,v 1.3 2003/11/22 10:14:36 darrenr Exp
+ * $Id: remove_poolnode.c,v 1.3 2003/11/22 10:14:36 darrenr Exp $
*/
#include <fcntl.h>
diff --git a/contrib/ipfilter/lib/tcp_flags.c b/contrib/ipfilter/lib/tcp_flags.c
index 7a57124..d6b5034 100644
--- a/contrib/ipfilter/lib/tcp_flags.c
+++ b/contrib/ipfilter/lib/tcp_flags.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: tcp_flags.c,v 1.8 2004/02/07 18:15:54 darrenr Exp
+ * $Id: tcp_flags.c,v 1.8 2004/02/07 18:15:54 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/tcpflags.c b/contrib/ipfilter/lib/tcpflags.c
index 2e65bdb..e5763d7 100644
--- a/contrib/ipfilter/lib/tcpflags.c
+++ b/contrib/ipfilter/lib/tcpflags.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: tcpflags.c,v 1.3 2002/11/02 07:18:01 darrenr Exp
+ * $Id: tcpflags.c,v 1.3 2002/11/02 07:18:01 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/tcpoptnames.c b/contrib/ipfilter/lib/tcpoptnames.c
index 7f2dfb6..a215c55 100644
--- a/contrib/ipfilter/lib/tcpoptnames.c
+++ b/contrib/ipfilter/lib/tcpoptnames.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: tcpoptnames.c,v 1.5 2002/01/28 06:50:48 darrenr Exp
+ * $Id: tcpoptnames.c,v 1.5 2002/01/28 06:50:48 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/to_interface.c b/contrib/ipfilter/lib/to_interface.c
index fb97cee..34fad26 100644
--- a/contrib/ipfilter/lib/to_interface.c
+++ b/contrib/ipfilter/lib/to_interface.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: to_interface.c,v 1.8 2002/01/28 06:50:48 darrenr Exp
+ * $Id: to_interface.c,v 1.8 2002/01/28 06:50:48 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/v6ionames.c b/contrib/ipfilter/lib/v6ionames.c
index a2ce683..224a815 100644
--- a/contrib/ipfilter/lib/v6ionames.c
+++ b/contrib/ipfilter/lib/v6ionames.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: v6ionames.c,v 1.1.4.1 2005/01/02 13:08:49 darrenr Exp
+ * $Id: v6ionames.c,v 1.1.4.2 2005/10/17 18:31:09 darrenr Exp $
*/
#include "ipf.h"
@@ -21,6 +21,7 @@ struct ipopt_names v6ionames[] ={
{ IPPROTO_AH, 0x000020, 0, "ah" },
{ IPPROTO_NONE, 0x000040, 0, "none" },
{ IPPROTO_DSTOPTS, 0x000080, 0, "dstopts" },
+ { IPPROTO_MOBILITY, 0x000100, 0, "mobility" },
{ 0, 0, 0, (char *)NULL }
};
diff --git a/contrib/ipfilter/lib/v6optvalue.c b/contrib/ipfilter/lib/v6optvalue.c
index b81ed7a..a2e0139 100644
--- a/contrib/ipfilter/lib/v6optvalue.c
+++ b/contrib/ipfilter/lib/v6optvalue.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: v6optvalue.c,v 1.1 2003/04/26 04:55:58 darrenr Exp
+ * $Id: v6optvalue.c,v 1.1 2003/04/26 04:55:58 darrenr Exp $
*/
#include "ipf.h"
diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c
index cc81516..bd01bcd 100644
--- a/contrib/ipfilter/lib/verbose.c
+++ b/contrib/ipfilter/lib/verbose.c
@@ -5,7 +5,7 @@
*
* See the IPFILTER.LICENCE file for details on licencing.
*
- * Id: verbose.c,v 1.6 2001/06/09 17:09:25 darrenr Exp
+ * $Id: verbose.c,v 1.6 2001/06/09 17:09:25 darrenr Exp $
*/
#if defined(__STDC__)
OpenPOWER on IntegriCloud