Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Use <net/dlt.h> to get the DLT_* constants. Also ch...
details: https://anonhg.NetBSD.org/src/rev/339e2eedcf71
branches: trunk
changeset: 500477:339e2eedcf71
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Dec 12 17:55:21 2000 +0000
description:
Use <net/dlt.h> to get the DLT_* constants. Also change bpfattach()
and bpf_change_type() to take just a pointer to the ifnet, rather than
a pointer to the ifnet and a pointer to a member of the ifnet (the bpf
pointer).
We'll let this ride on the Dec 12 1.5N version bump.
diffstat:
sys/net/bpf.c | 13 ++++++-------
sys/net/bpf.h | 32 +++++---------------------------
2 files changed, 11 insertions(+), 34 deletions(-)
diffs (100 lines):
diff -r 3a8f2679cab8 -r 339e2eedcf71 sys/net/bpf.c
--- a/sys/net/bpf.c Tue Dec 12 17:53:20 2000 +0000
+++ b/sys/net/bpf.c Tue Dec 12 17:55:21 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.58 2000/07/04 18:46:49 thorpej Exp $ */
+/* $NetBSD: bpf.c,v 1.59 2000/12/12 17:55:21 thorpej Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -1203,8 +1203,7 @@
* size of the link header (variable length headers not yet supported).
*/
void
-bpfattach(driverp, ifp, dlt, hdrlen)
- caddr_t *driverp;
+bpfattach(ifp, dlt, hdrlen)
struct ifnet *ifp;
u_int dlt, hdrlen;
{
@@ -1214,7 +1213,7 @@
panic("bpfattach");
bp->bif_dlist = 0;
- bp->bif_driverp = (struct bpf_if **)driverp;
+ bp->bif_driverp = (struct bpf_if **)&ifp->if_bpf;
bp->bif_ifp = ifp;
bp->bif_dlt = dlt;
@@ -1283,14 +1282,14 @@
* Change the data link type of a BPF instance.
*/
void
-bpf_change_type(driverp, dlt, hdrlen)
- caddr_t *driverp;
+bpf_change_type(ifp, dlt, hdrlen)
+ struct ifnet *ifp;
u_int dlt, hdrlen;
{
struct bpf_if *bp;
for (bp = bpf_iflist; bp != NULL; bp = bp->bif_next) {
- if (bp->bif_driverp == (struct bpf_if **)driverp)
+ if (bp->bif_driverp == (struct bpf_if **)&ifp->if_bpf)
break;
}
if (bp == NULL)
diff -r 3a8f2679cab8 -r 339e2eedcf71 sys/net/bpf.h
--- a/sys/net/bpf.h Tue Dec 12 17:53:20 2000 +0000
+++ b/sys/net/bpf.h Tue Dec 12 17:55:21 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.h,v 1.27 2000/11/11 00:11:04 thorpej Exp $ */
+/* $NetBSD: bpf.h,v 1.28 2000/12/12 17:55:21 thorpej Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -171,30 +171,8 @@
#endif
#endif
-/*
- * Data-link level type codes.
- */
-#define DLT_NULL 0 /* no link-layer encapsulation */
-#define DLT_EN10MB 1 /* Ethernet (10Mb) */
-#define DLT_EN3MB 2 /* Experimental Ethernet (3Mb) */
-#define DLT_AX25 3 /* Amateur Radio AX.25 */
-#define DLT_PRONET 4 /* Proteon ProNET Token Ring */
-#define DLT_CHAOS 5 /* Chaos */
-#define DLT_IEEE802 6 /* IEEE 802 Networks */
-#define DLT_ARCNET 7 /* ARCNET */
-#define DLT_SLIP 8 /* Serial Line IP */
-#define DLT_PPP 9 /* Point-to-point Protocol */
-#define DLT_FDDI 10 /* FDDI */
-#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
-#define DLT_RAW 12 /* raw IP */
-#define DLT_SLIP_BSDOS 13 /* BSD/OS Serial Line IP */
-#define DLT_PPP_BSDOS 14 /* BSD/OS Point-to-point Protocol */
-#define DLT_HIPPI 15 /* HIPPI */
-#define DLT_HDLC 16 /* HDLC framing */
-
-/* NetBSD-specific types */
-#define DLT_PPP_SERIAL 50 /* PPP over serial (async and sync) */
-#define DLT_PPP_ETHER 51 /* PPP over Ethernet */
+/* Pull in data-link level type codes. */
+#include <net/dlt.h>
/*
* The instruction encondings.
@@ -272,9 +250,9 @@
int bpf_validate __P((struct bpf_insn *, int));
void bpf_tap __P((caddr_t, u_char *, u_int));
void bpf_mtap __P((caddr_t, struct mbuf *));
-void bpfattach __P((caddr_t *, struct ifnet *, u_int, u_int));
+void bpfattach __P((struct ifnet *, u_int, u_int));
void bpfdetach __P((struct ifnet *));
-void bpf_change_type __P((caddr_t *, u_int, u_int));
+void bpf_change_type __P((struct ifnet *, u_int, u_int));
void bpfilterattach __P((int));
#endif
Home |
Main Index |
Thread Index |
Old Index