summaryrefslogtreecommitdiff
path: root/usr.sbin/ipftest/ipt.c
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1996-05-10 21:41:01 +0000
committerdm <dm@cvs.openbsd.org>1996-05-10 21:41:01 +0000
commit76242ad5ccbbf411a0dfd66daab39d9a460c09dc (patch)
tree92b555bd9197bb7976ae825d415f70d567c37170 /usr.sbin/ipftest/ipt.c
parent75774d963fafaaaa2cf697156d616e2ebe3db3c8 (diff)
ipfilter 3.0.4
Diffstat (limited to 'usr.sbin/ipftest/ipt.c')
-rw-r--r--usr.sbin/ipftest/ipt.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.sbin/ipftest/ipt.c b/usr.sbin/ipftest/ipt.c
index f25165063c8..ca2aea33623 100644
--- a/usr.sbin/ipftest/ipt.c
+++ b/usr.sbin/ipftest/ipt.c
@@ -39,17 +39,18 @@
#include <ctype.h>
#ifndef lint
-static char sccsid[] = "@(#)ipt.c 1.15 1/7/96 (C) 1993-1996 Darren Reed";
+static char sccsid[] = "@(#)ipt.c 1.17 3/9/96 (C) 1993-1996 Darren Reed";
#endif
extern int fr_check();
extern char *optarg;
extern struct frentry *ipfilter[2][2];
-extern struct ipread snoop, etherf, tcpd, pcap, iptext;
+extern struct ipread snoop, etherf, tcpd, pcap, iptext, iphex;
extern void debug(), verbose();
struct frentry *ft_in = NULL, *ft_out = NULL;
-struct ipread *readers[] = { &iptext, &etherf, &tcpd, &snoop, &pcap, NULL };
+struct ipread *readers[] = { &iptext, &etherf, &tcpd, &snoop, &pcap, &iphex,
+ NULL };
int opts = 0;
@@ -65,7 +66,7 @@ char *argv[];
char *rules = NULL, *datain = NULL, *iface = NULL;
int fd, i, dir = 0;
- while ((c = getopt(argc, argv, "I:PSTEbdi:r:v")) != -1)
+ while ((c = getopt(argc, argv, "bdEHi:I:Pr:STv")) != -1)
switch (c)
{
case 'b' :
@@ -91,6 +92,11 @@ char *argv[];
if (*r == &etherf)
break;
break;
+ case 'H' :
+ for (i = 0, r = readers; *r; i++, r++)
+ if (*r == &iphex)
+ break;
+ break;
case 'P' :
for (i = 0, r = readers; *r; i++, r++)
if (*r == &pcap)
@@ -172,6 +178,8 @@ char *argv[];
ip = (struct ip *)buf;
while ((i = (*(*r)->r_readip)(buf, sizeof(buf), &iface, &dir)) > 0) {
+ ip->ip_off = ntohs(ip->ip_off);
+ ip->ip_len = ntohs(ip->ip_len);
switch (fr_check(ip, ip->ip_hl << 2, iface, dir))
{
case -1 :