summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-10-24 19:04:04 +0000
committerrwatson <rwatson@FreeBSD.org>2007-10-24 19:04:04 +0000
commit60570a92bf794d255e5f8ed235b49c553776ad92 (patch)
treefea282db79628eed98808fd38cc46445b2f97ca5 /sys/net/bpf.c
parent7781c2181af1113baab38322a55a90b5469cba03 (diff)
downloadFreeBSD-src-60570a92bf794d255e5f8ed235b49c553776ad92.zip
FreeBSD-src-60570a92bf794d255e5f8ed235b49c553776ad92.tar.gz
Merge first in a series of TrustedBSD MAC Framework KPI changes
from Mac OS X Leopard--rationalize naming for entry points to the following general forms: mac_<object>_<method/action> mac_<object>_check_<method/action> The previous naming scheme was inconsistent and mostly reversed from the new scheme. Also, make object types more consistent and remove spaces from object types that contain multiple parts ("posix_sem" -> "posixsem") to make mechanical parsing easier. Introduce a new "netinet" object type for certain IPv4/IPv6-related methods. Also simplify, slightly, some entry point names. All MAC policy modules will need to be recompiled, and modules not updates as part of this commit will need to be modified to conform to the new KPI. Sponsored by: SPARTA (original patches against Mac OS X) Obtained from: TrustedBSD Project, Apple Computer
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 7af9f3c..2d6630a 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -416,8 +416,8 @@ bpfopen(struct cdev *dev, int flags, int fmt, struct thread *td)
d->bd_direction = BPF_D_INOUT;
d->bd_pid = td->td_proc->p_pid;
#ifdef MAC
- mac_init_bpfdesc(d);
- mac_create_bpfdesc(td->td_ucred, d);
+ mac_bpfdesc_init(d);
+ mac_bpfdesc_create(td->td_ucred, d);
#endif
mtx_init(&d->bd_mtx, devtoname(dev), "bpf cdev lock", MTX_DEF);
callout_init(&d->bd_callout, CALLOUT_MPSAFE);
@@ -448,7 +448,7 @@ bpfclose(struct cdev *dev, int flags, int fmt, struct thread *td)
mtx_unlock(&bpf_mtx);
selwakeuppri(&d->bd_sel, PRINET);
#ifdef MAC
- mac_destroy_bpfdesc(d);
+ mac_bpfdesc_destroy(d);
#endif /* MAC */
knlist_destroy(&d->bd_sel.si_note);
bpf_freed(d);
@@ -656,9 +656,9 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag)
#ifdef MAC
BPFD_LOCK(d);
- mac_create_mbuf_from_bpfdesc(d, m);
+ mac_bpfdesc_create_mbuf(d, m);
if (mc != NULL)
- mac_create_mbuf_from_bpfdesc(d, mc);
+ mac_bpfdesc_create_mbuf(d, mc);
BPFD_UNLOCK(d);
#endif
@@ -1299,7 +1299,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen)
gottime = 1;
}
#ifdef MAC
- if (mac_check_bpfdesc_receive(d, bp->bif_ifp) == 0)
+ if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0)
#endif
catchpacket(d, pkt, pktlen, slen, bcopy, &tv);
}
@@ -1378,7 +1378,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m)
gottime = 1;
}
#ifdef MAC
- if (mac_check_bpfdesc_receive(d, bp->bif_ifp) == 0)
+ if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0)
#endif
catchpacket(d, (u_char *)m, pktlen, slen,
bpf_mcopy, &tv);
@@ -1433,7 +1433,7 @@ bpf_mtap2(struct bpf_if *bp, void *data, u_int dlen, struct mbuf *m)
gottime = 1;
}
#ifdef MAC
- if (mac_check_bpfdesc_receive(d, bp->bif_ifp) == 0)
+ if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0)
#endif
catchpacket(d, (u_char *)&mb, pktlen, slen,
bpf_mcopy, &tv);
OpenPOWER on IntegriCloud