Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Implement bpfdetach().
details: https://anonhg.NetBSD.org/src/rev/9bbfdb7e008d
branches: trunk
changeset: 481487:9bbfdb7e008d
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Jan 31 23:06:12 2000 +0000
description:
Implement bpfdetach().
diffstat:
sys/net/bpf.c | 21 ++++++++++++++++++++-
sys/net/bpf.h | 3 ++-
2 files changed, 22 insertions(+), 2 deletions(-)
diffs (52 lines):
diff -r 8b36ec8a42f6 -r 9bbfdb7e008d sys/net/bpf.c
--- a/sys/net/bpf.c Mon Jan 31 22:56:14 2000 +0000
+++ b/sys/net/bpf.c Mon Jan 31 23:06:12 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.47 1999/05/11 02:11:08 thorpej Exp $ */
+/* $NetBSD: bpf.c,v 1.48 2000/01/31 23:06:12 thorpej Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -1340,6 +1340,25 @@
}
/*
+ * Remove an interface from bpf.
+ */
+void
+bpfdetach(ifp)
+ struct ifnet *ifp;
+{
+ struct bpf_if *bp, **pbp;
+
+ for (bp = bpf_iflist, pbp = &bpf_iflist;
+ bp != NULL; pbp = &bp->bif_next, bp = bp->bif_next) {
+ if (bp->bif_ifp == ifp) {
+ *pbp = bp->bif_next;
+ free(bp, M_DEVBUF);
+ break;
+ }
+ }
+}
+
+/*
* Change the data link type of a BPF instance.
*/
void
diff -r 8b36ec8a42f6 -r 9bbfdb7e008d sys/net/bpf.h
--- a/sys/net/bpf.h Mon Jan 31 22:56:14 2000 +0000
+++ b/sys/net/bpf.h Mon Jan 31 23:06:12 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.h,v 1.24 1999/09/13 10:31:43 itojun Exp $ */
+/* $NetBSD: bpf.h,v 1.25 2000/01/31 23:06:12 thorpej Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -271,6 +271,7 @@
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 bpfdetach __P((struct ifnet *));
void bpf_change_type __P((caddr_t *, u_int, u_int));
void bpfilterattach __P((int));
#endif
Home |
Main Index |
Thread Index |
Old Index