summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/tools/ipf.c
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2007-06-04 02:50:28 +0000
committerdarrenr <darrenr@FreeBSD.org>2007-06-04 02:50:28 +0000
commite2e28d4361fc9bdb67694eedaf349bdc7ca088a3 (patch)
treef9efeb29d9992430924bdce513e7199c9397ac36 /contrib/ipfilter/tools/ipf.c
parent092f5d1218f4867a87b382d75613b9d2b3e56c18 (diff)
downloadFreeBSD-src-e2e28d4361fc9bdb67694eedaf349bdc7ca088a3.zip
FreeBSD-src-e2e28d4361fc9bdb67694eedaf349bdc7ca088a3.tar.gz
Import IPFilter 4.1.23 to vendor branch.
See src/contrib/ipfilter/HISTORY for details of changes since 4.1.13
Diffstat (limited to 'contrib/ipfilter/tools/ipf.c')
-rw-r--r--contrib/ipfilter/tools/ipf.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/contrib/ipfilter/tools/ipf.c b/contrib/ipfilter/tools/ipf.c
index 8e352a9..063ecf0 100644
--- a/contrib/ipfilter/tools/ipf.c
+++ b/contrib/ipfilter/tools/ipf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1993-2001 by Darren Reed.
+ * Copyright (C) 2001-2006 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*/
@@ -19,7 +19,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-2000 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ipf.c,v 1.35.2.4 2006/03/17 11:48:08 darrenr Exp $";
+static const char rcsid[] = "@(#)$Id: ipf.c,v 1.35.2.8 2007/05/10 06:12:01 darrenr Exp $";
#endif
#if !defined(__SVR4) && defined(__GNUC__)
@@ -342,11 +342,13 @@ char *arg;
if (!arg || !*arg)
return;
- if (!strcmp(arg, "s") || !strcmp(arg, "S")) {
+ if (!strcmp(arg, "s") || !strcmp(arg, "S") || ISDIGIT(*arg)) {
if (*arg == 'S')
fl = 0;
- else
+ else if (*arg == 's')
fl = 1;
+ else
+ fl = atoi(arg);
rem = fl;
closedevice();
@@ -368,7 +370,7 @@ char *arg;
}
if ((opts & (OPT_DONOTHING|OPT_VERBOSE)) == OPT_VERBOSE) {
printf("remove flags %s (%d)\n", arg, rem);
- printf("removed %d filter rules\n", fl);
+ printf("removed %d entries\n", fl);
}
closedevice();
return;
@@ -451,15 +453,21 @@ void ipf_frsync()
void zerostats()
{
+ ipfobj_t obj;
friostat_t fio;
- friostat_t *fiop = &fio;
+
+ obj.ipfo_rev = IPFILTER_VERSION;
+ obj.ipfo_type = IPFOBJ_IPFSTAT;
+ obj.ipfo_size = sizeof(fio);
+ obj.ipfo_ptr = &fio;
+ obj.ipfo_offset = 0;
if (opendevice(ipfname, 1) != -2) {
- if (ioctl(fd, SIOCFRZST, &fiop) == -1) {
+ if (ioctl(fd, SIOCFRZST, &obj) == -1) {
perror("ioctl(SIOCFRZST)");
exit(-1);
}
- showstats(fiop);
+ showstats(&fio);
}
}
OpenPOWER on IntegriCloud