add bpf_track eventhandler for monitoring bpf taps attached/detached
Reviewed by: csjp
This commit is contained in:
parent
715238635d
commit
b743c31009
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192313
@ -534,6 +534,8 @@ bpf_attachd(struct bpf_d *d, struct bpf_if *bp)
|
||||
|
||||
bpf_bpfd_cnt++;
|
||||
BPFIF_UNLOCK(bp);
|
||||
|
||||
EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -561,6 +563,8 @@ bpf_detachd(struct bpf_d *d)
|
||||
BPFD_UNLOCK(d);
|
||||
BPFIF_UNLOCK(bp);
|
||||
|
||||
EVENTHANDLER_INVOKE(bpf_track, ifp, 0);
|
||||
|
||||
/*
|
||||
* Check if this descriptor had requested promiscuous mode.
|
||||
* If so, turn it off.
|
||||
|
@ -182,6 +182,11 @@ typedef void (*vlan_unconfig_fn)(void *, struct ifnet *, uint16_t);
|
||||
EVENTHANDLER_DECLARE(vlan_config, vlan_config_fn);
|
||||
EVENTHANDLER_DECLARE(vlan_unconfig, vlan_unconfig_fn);
|
||||
|
||||
/* BPF attach/detach events */
|
||||
struct ifnet;
|
||||
typedef void (*bpf_track_fn)(void *, struct ifnet *, int /* 1 =>'s attach */);
|
||||
EVENTHANDLER_DECLARE(bpf_track, bpf_track_fn);
|
||||
|
||||
/*
|
||||
* Process events
|
||||
* process_fork and exit handlers are called without Giant.
|
||||
|
Loading…
Reference in New Issue
Block a user