summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2010-06-26 16:47:08 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2010-06-26 16:47:08 +0000
commit6be3f3fc5395980de076d96fe6a0b49f2fafe4a7 (patch)
tree822ccb7fedb849c7389f7132a58ae28cf63b87b4
parent655a24356fe84ac3e110431aaaa1f8ba3deb6cf4 (diff)
remove support for the old pflog format, replaced in 2003
ok ryan theo & herr reyksminister
-rw-r--r--lib/libpcap/gencode.c35
-rw-r--r--lib/libpcap/pcap.c3
-rw-r--r--usr.sbin/tcpdump/print-pflog.c94
-rw-r--r--usr.sbin/tcpdump/tcpdump.c3
4 files changed, 4 insertions, 131 deletions
diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c
index 9a5297ffd5b..834590def50 100644
--- a/lib/libpcap/gencode.c
+++ b/lib/libpcap/gencode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencode.c,v 1.32 2009/09/18 23:32:13 bluhm Exp $ */
+/* $OpenBSD: gencode.c,v 1.33 2010/06/26 16:47:07 henning Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
@@ -658,11 +658,6 @@ init_linktype(type)
off_nl = 12;
return;
- case DLT_OLD_PFLOG:
- off_linktype = 0;
- off_nl = 28;
- return;
-
case DLT_PFLOG:
off_linktype = 0;
/* XXX read from header? */
@@ -799,17 +794,6 @@ gen_linktype(proto)
else
return gen_false();
break;
- case DLT_OLD_PFLOG:
- if (proto == ETHERTYPE_IP)
- return (gen_cmp(0, BPF_W, (bpf_int32)AF_INET));
-#ifdef INET6
- else if (proto == ETHERTYPE_IPV6)
- return (gen_cmp(0, BPF_W, (bpf_int32)AF_INET6));
-#endif /* INET6 */
- else
- return gen_false();
- break;
-
case DLT_PFLOG:
if (proto == ETHERTYPE_IP)
return (gen_cmp(offsetof(struct pfloghdr, af), BPF_B,
@@ -2981,11 +2965,6 @@ gen_inbound(dir)
(bpf_int32)((dir == 0) ? PF_IN : PF_OUT));
break;
- case DLT_OLD_PFLOG:
- b0 = gen_cmp(offsetof(struct old_pfloghdr, dir), BPF_H,
- (bpf_int32)((dir == 0) ? PF_IN : PF_OUT));
- break;
-
default:
bpf_error("inbound/outbound not supported on linktype 0x%x",
linktype);
@@ -3006,9 +2985,6 @@ gen_pf_ifname(char *ifname)
if (linktype == DLT_PFLOG) {
len = sizeof(((struct pfloghdr *)0)->ifname);
off = offsetof(struct pfloghdr, ifname);
- } else if (linktype == DLT_OLD_PFLOG) {
- len = sizeof(((struct old_pfloghdr *)0)->ifname);
- off = offsetof(struct old_pfloghdr, ifname);
} else {
bpf_error("ifname not supported on linktype 0x%x", linktype);
/* NOTREACHED */
@@ -3053,9 +3029,6 @@ gen_pf_rnr(int rnr)
if (linktype == DLT_PFLOG) {
b0 = gen_cmp(offsetof(struct pfloghdr, rulenr), BPF_W,
(bpf_int32)rnr);
- } else if (linktype == DLT_OLD_PFLOG) {
- b0 = gen_cmp(offsetof(struct old_pfloghdr, rnr), BPF_H,
- (bpf_int32)rnr);
} else {
bpf_error("rnr not supported on linktype 0x%x", linktype);
/* NOTREACHED */
@@ -3090,9 +3063,6 @@ gen_pf_reason(int reason)
if (linktype == DLT_PFLOG) {
b0 = gen_cmp(offsetof(struct pfloghdr, reason), BPF_B,
(bpf_int32)reason);
- } else if (linktype == DLT_OLD_PFLOG) {
- b0 = gen_cmp(offsetof(struct old_pfloghdr, reason), BPF_H,
- (bpf_int32)reason);
} else {
bpf_error("reason not supported on linktype 0x%x", linktype);
/* NOTREACHED */
@@ -3110,9 +3080,6 @@ gen_pf_action(int action)
if (linktype == DLT_PFLOG) {
b0 = gen_cmp(offsetof(struct pfloghdr, action), BPF_B,
(bpf_int32)action);
- } else if (linktype == DLT_OLD_PFLOG) {
- b0 = gen_cmp(offsetof(struct old_pfloghdr, action), BPF_H,
- (bpf_int32)action);
} else {
bpf_error("action not supported on linktype 0x%x", linktype);
/* NOTREACHED */
diff --git a/lib/libpcap/pcap.c b/lib/libpcap/pcap.c
index 9bf613921c0..190c37305a9 100644
--- a/lib/libpcap/pcap.c
+++ b/lib/libpcap/pcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcap.c,v 1.11 2007/09/02 15:19:18 deraadt Exp $ */
+/* $OpenBSD: pcap.c,v 1.12 2010/06/26 16:47:07 henning Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
@@ -246,7 +246,6 @@ DLT_CHOICE(DLT_ENC, "IPSEC enc type (af header, spi, flags)"),
DLT_CHOICE(DLT_RAW, "raw IP"),
DLT_CHOICE(DLT_SLIP_BSDOS, "BSD/OS Serial Line IP"),
DLT_CHOICE(DLT_PPP_BSDOS, "BSD/OS Point-to-point Protocol"),
-DLT_CHOICE(DLT_OLD_PFLOG, "Packet filter logging, old (XXX remove?)"),
DLT_CHOICE(DLT_PFSYNC, "Packet filter state syncing"),
DLT_CHOICE(DLT_PPP_ETHER, "PPP over Ethernet; session only w/o ether header"),
DLT_CHOICE(DLT_IEEE802_11, "IEEE 802.11 wireless"),
diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c
index f42d5000144..1d6bb339a94 100644
--- a/usr.sbin/tcpdump/print-pflog.c
+++ b/usr.sbin/tcpdump/print-pflog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-pflog.c,v 1.20 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-pflog.c,v 1.21 2010/06/26 16:47:07 henning Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
@@ -174,95 +174,3 @@ pflog_if_print(u_char *user, const struct pcap_pkthdr *h,
out:
putchar('\n');
}
-
-
-void
-pflog_old_if_print(u_char *user, const struct pcap_pkthdr *h,
- register const u_char *p)
-{
- u_int length = h->len;
- u_int caplen = h->caplen;
- const struct ip *ip;
-#ifdef INET6
- const struct ip6_hdr *ip6;
-#endif
- const struct old_pfloghdr *hdr;
- u_short res;
- char reason[128], *why;
- u_int8_t af;
-
- ts_print(&h->ts);
-
- if (caplen < OLD_PFLOG_HDRLEN) {
- printf("[|pflog]");
- goto out;
- }
-
- /*
- * Some printers want to get back at the link level addresses,
- * and/or check that they're not walking off the end of the packet.
- * Rather than pass them all the way down, we set these globals.
- */
- packetp = p;
- snapend = p + caplen;
-
- hdr = (struct old_pfloghdr *)p;
- if (eflag) {
- res = ntohs(hdr->reason);
- why = (res < PFRES_MAX) ? pf_reasons[res] : "unkn";
-
- snprintf(reason, sizeof(reason), "%d(%s)", res, why);
-
- printf("rule %d/%s: ",
- (short)ntohs(hdr->rnr), reason);
- switch (ntohs(hdr->action)) {
- case PF_MATCH:
- printf("match");
- break;
- case PF_SCRUB:
- printf("scrub");
- break;
- case PF_PASS:
- printf("pass");
- break;
- case PF_DROP:
- printf("block");
- break;
- case PF_NAT:
- case PF_NONAT:
- printf("nat");
- break;
- case PF_BINAT:
- case PF_NOBINAT:
- printf("binat");
- break;
- case PF_RDR:
- case PF_NORDR:
- printf("rdr");
- break;
- }
- printf(" %s on %s: ",
- ntohs(hdr->dir) == PF_OUT ? "out" : "in",
- hdr->ifname);
- }
- af = ntohl(hdr->af);
- length -= OLD_PFLOG_HDRLEN;
- if (af == AF_INET) {
- ip = (struct ip *)(p + OLD_PFLOG_HDRLEN);
- ip_print((const u_char *)ip, length);
- if (xflag)
- default_print((const u_char *)ip,
- caplen - OLD_PFLOG_HDRLEN);
- } else {
-#ifdef INET6
- ip6 = (struct ip6_hdr *)(p + OLD_PFLOG_HDRLEN);
- ip6_print((const u_char *)ip6, length);
- if (xflag)
- default_print((const u_char *)ip6,
- caplen - OLD_PFLOG_HDRLEN);
-#endif
- }
-
-out:
- putchar('\n');
-}
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index 0a13c88f547..2298c8e2de1 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcpdump.c,v 1.62 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: tcpdump.c,v 1.63 2010/06/26 16:47:07 henning Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -121,7 +121,6 @@ static struct printer printers[] = {
{ loop_if_print, DLT_LOOP },
{ enc_if_print, DLT_ENC },
{ pflog_if_print, DLT_PFLOG },
- { pflog_old_if_print, DLT_OLD_PFLOG },
{ pfsync_if_print, DLT_PFSYNC },
{ ppp_ether_if_print, DLT_PPP_ETHER },
{ ieee802_11_if_print, DLT_IEEE802_11 },