Changeset View
Changeset View
Standalone View
Standalone View
sys/net/pfil.h
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
struct packet_filter_hook { | struct packet_filter_hook { | ||||
TAILQ_ENTRY(packet_filter_hook) pfil_chain; | TAILQ_ENTRY(packet_filter_hook) pfil_chain; | ||||
pfil_func_t pfil_func; | pfil_func_t pfil_func; | ||||
void *pfil_arg; | void *pfil_arg; | ||||
}; | }; | ||||
#define PFIL_IN 0x00000001 | #define PFIL_IN 0x00000001 | ||||
#define PFIL_OUT 0x00000002 | #define PFIL_OUT 0x00000002 | ||||
#define PFIL_WAITOK 0x00000004 | #define PFIL_FWD 0x00000004 | ||||
#define PFIL_ALL (PFIL_IN|PFIL_OUT) | #define PFIL_WAITOK 0x00000008 | ||||
#define PFIL_ALL (PFIL_IN|PFIL_OUT|PFIL_FWD) | |||||
typedef TAILQ_HEAD(pfil_chain, packet_filter_hook) pfil_chain_t; | typedef TAILQ_HEAD(pfil_chain, packet_filter_hook) pfil_chain_t; | ||||
#define PFIL_TYPE_AF 1 /* key is AF_* type */ | #define PFIL_TYPE_AF 1 /* key is AF_* type */ | ||||
#define PFIL_TYPE_IFNET 2 /* key is ifnet pointer */ | #define PFIL_TYPE_IFNET 2 /* key is ifnet pointer */ | ||||
#define PFIL_FLAG_PRIVATE_LOCK 0x01 /* Personal lock instead of global */ | #define PFIL_FLAG_PRIVATE_LOCK 0x01 /* Personal lock instead of global */ | ||||
/* | /* | ||||
* A pfil head is created by each protocol or packet intercept point. | * A pfil head is created by each protocol or packet intercept point. | ||||
* For packet is then run through the hook chain for inspection. | * For packet is then run through the hook chain for inspection. | ||||
*/ | */ | ||||
struct pfil_head { | struct pfil_head { | ||||
pfil_chain_t ph_in; | pfil_chain_t ph_in; | ||||
pfil_chain_t ph_out; | pfil_chain_t ph_out; | ||||
pfil_chain_t ph_fwd; | |||||
int ph_type; | int ph_type; | ||||
int ph_nhooks; | int ph_nhooks; | ||||
#if defined( __linux__ ) || defined( _WIN32 ) | #if defined( __linux__ ) || defined( _WIN32 ) | ||||
rwlock_t ph_mtx; | rwlock_t ph_mtx; | ||||
#else | #else | ||||
struct rmlock *ph_plock; /* Pointer to the used lock */ | struct rmlock *ph_plock; /* Pointer to the used lock */ | ||||
struct rmlock ph_lock; /* Private lock storage */ | struct rmlock ph_lock; /* Private lock storage */ | ||||
int flags; | int flags; | ||||
Show All 36 Lines |