Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/pf/pf.c
Context not available. | |||||
#define V_pf_sendqueue VNET(pf_sendqueue) | #define V_pf_sendqueue VNET(pf_sendqueue) | ||||
static struct mtx pf_sendqueue_mtx; | static struct mtx pf_sendqueue_mtx; | ||||
MTX_SYSINIT(pf_sendqueue_mtx, &pf_sendqueue_mtx, "pf send queue", MTX_DEF); | |||||
#define PF_SENDQ_LOCK() mtx_lock(&pf_sendqueue_mtx) | #define PF_SENDQ_LOCK() mtx_lock(&pf_sendqueue_mtx) | ||||
#define PF_SENDQ_UNLOCK() mtx_unlock(&pf_sendqueue_mtx) | #define PF_SENDQ_UNLOCK() mtx_unlock(&pf_sendqueue_mtx) | ||||
Context not available. | |||||
#define V_pf_overloadtask VNET(pf_overloadtask) | #define V_pf_overloadtask VNET(pf_overloadtask) | ||||
static struct mtx pf_overloadqueue_mtx; | static struct mtx pf_overloadqueue_mtx; | ||||
MTX_SYSINIT(pf_overloadqueue_mtx, &pf_overloadqueue_mtx, | |||||
"pf overload/flush queue", MTX_DEF); | |||||
#define PF_OVERLOADQ_LOCK() mtx_lock(&pf_overloadqueue_mtx) | #define PF_OVERLOADQ_LOCK() mtx_lock(&pf_overloadqueue_mtx) | ||||
#define PF_OVERLOADQ_UNLOCK() mtx_unlock(&pf_overloadqueue_mtx) | #define PF_OVERLOADQ_UNLOCK() mtx_unlock(&pf_overloadqueue_mtx) | ||||
VNET_DEFINE(struct pf_rulequeue, pf_unlinked_rules); | VNET_DEFINE(struct pf_rulequeue, pf_unlinked_rules); | ||||
struct mtx pf_unlnkdrules_mtx; | struct mtx pf_unlnkdrules_mtx; | ||||
MTX_SYSINIT(pf_unlnkdrules_mtx, &pf_unlnkdrules_mtx, "pf unlinked rules", | |||||
MTX_DEF); | |||||
static VNET_DEFINE(uma_zone_t, pf_sources_z); | static VNET_DEFINE(uma_zone_t, pf_sources_z); | ||||
#define V_pf_sources_z VNET(pf_sources_z) | #define V_pf_sources_z VNET(pf_sources_z) | ||||
Context not available. | |||||
/* Per-vnet data storage structures initialization. */ | /* Per-vnet data storage structures initialization. */ | ||||
void | void | ||||
pf_initialize() | pf_vnet_initialize() | ||||
{ | { | ||||
struct pf_keyhash *kh; | struct pf_keyhash *kh; | ||||
struct pf_idhash *ih; | struct pf_idhash *ih; | ||||
Context not available. | |||||
STAILQ_INIT(&V_pf_sendqueue); | STAILQ_INIT(&V_pf_sendqueue); | ||||
SLIST_INIT(&V_pf_overloadqueue); | SLIST_INIT(&V_pf_overloadqueue); | ||||
TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, curvnet); | TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, curvnet); | ||||
mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); | |||||
mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, | |||||
MTX_DEF); | |||||
/* Unlinked, but may be referenced rules. */ | /* Unlinked, but may be referenced rules. */ | ||||
TAILQ_INIT(&V_pf_unlinked_rules); | TAILQ_INIT(&V_pf_unlinked_rules); | ||||
mtx_init(&pf_unlnkdrules_mtx, "pf unlinked rules", NULL, MTX_DEF); | |||||
} | } | ||||
void | void | ||||
Context not available. | |||||
free(pfse, M_PFTEMP); | free(pfse, M_PFTEMP); | ||||
} | } | ||||
mtx_destroy(&pf_sendqueue_mtx); | |||||
mtx_destroy(&pf_overloadqueue_mtx); | |||||
mtx_destroy(&pf_unlnkdrules_mtx); | |||||
uma_zdestroy(V_pf_sources_z); | uma_zdestroy(V_pf_sources_z); | ||||
uma_zdestroy(V_pf_state_z); | uma_zdestroy(V_pf_state_z); | ||||
uma_zdestroy(V_pf_state_key_z); | uma_zdestroy(V_pf_state_key_z); | ||||
Context not available. |