Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_fw2.c
Show First 20 Lines • Show All 3,496 Lines • ▼ Show 20 Lines | ipfw_destroy(void) | ||||
printf("IP firewall unloaded\n"); | printf("IP firewall unloaded\n"); | ||||
} | } | ||||
/* | /* | ||||
* Stuff that must be initialized for every instance | * Stuff that must be initialized for every instance | ||||
* (including the first of course). | * (including the first of course). | ||||
*/ | */ | ||||
static int | static int | ||||
vnet_ipfw_init(const void *unused) | vnet_ipfw_init(void) | ||||
{ | { | ||||
int error, first; | int error, first; | ||||
struct ip_fw *rule = NULL; | struct ip_fw *rule = NULL; | ||||
struct ip_fw_chain *chain; | struct ip_fw_chain *chain; | ||||
chain = &V_layer3_chain; | chain = &V_layer3_chain; | ||||
first = IS_DEFAULT_VNET(curvnet) ? 1 : 0; | first = IS_DEFAULT_VNET(curvnet) ? 1 : 0; | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | #endif | ||||
error = ipfw_attach_hooks(); | error = ipfw_attach_hooks(); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Called for the removal of each instance. | * Called for the removal of each instance. | ||||
*/ | */ | ||||
static int | static int | ||||
vnet_ipfw_uninit(const void *unused) | vnet_ipfw_uninit(void) | ||||
{ | { | ||||
struct ip_fw *reap; | struct ip_fw *reap; | ||||
struct ip_fw_chain *chain = &V_layer3_chain; | struct ip_fw_chain *chain = &V_layer3_chain; | ||||
int i, last; | int i, last; | ||||
V_ipfw_vnet_ready = 0; /* tell new callers to go away */ | V_ipfw_vnet_ready = 0; /* tell new callers to go away */ | ||||
/* | /* | ||||
* disconnect from ipv4, ipv6, layer2 and sockopt. | * disconnect from ipv4, ipv6, layer2 and sockopt. | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
FEATURE(ipfw_ctl3, "ipfw new sockopt calls"); | FEATURE(ipfw_ctl3, "ipfw new sockopt calls"); | ||||
MODULE_VERSION(ipfw, 3); | MODULE_VERSION(ipfw, 3); | ||||
/* should declare some dependencies here */ | /* should declare some dependencies here */ | ||||
/* | /* | ||||
* Starting up. Done in order after ipfwmod() has been called. | * Starting up. Done in order after ipfwmod() has been called. | ||||
* VNET_SYSINIT is also called for each existing vnet and each new vnet. | * VNET_SYSINIT is also called for each existing vnet and each new vnet. | ||||
*/ | */ | ||||
SYSINIT(ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, | SYSINIT(ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, ipfw_init); | ||||
ipfw_init, NULL); | |||||
VNET_SYSINIT(vnet_ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, | VNET_SYSINIT(vnet_ipfw_init, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, | ||||
vnet_ipfw_init, NULL); | vnet_ipfw_init); | ||||
/* | /* | ||||
* Closing up shop. These are done in REVERSE ORDER, but still | * Closing up shop. These are done in REVERSE ORDER, but still | ||||
* after ipfwmod() has been called. Not called on reboot. | * after ipfwmod() has been called. Not called on reboot. | ||||
* VNET_SYSUNINIT is also called for each exiting vnet as it exits. | * VNET_SYSUNINIT is also called for each exiting vnet as it exits. | ||||
* or when the module is unloaded. | * or when the module is unloaded. | ||||
*/ | */ | ||||
SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, | SYSUNINIT(ipfw_destroy, IPFW_SI_SUB_FIREWALL, IPFW_MODULE_ORDER, | ||||
ipfw_destroy, NULL); | ipfw_destroy); | ||||
VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, | VNET_SYSUNINIT(vnet_ipfw_uninit, IPFW_SI_SUB_FIREWALL, IPFW_VNET_ORDER, | ||||
vnet_ipfw_uninit, NULL); | vnet_ipfw_uninit); | ||||
/* end of file */ | /* end of file */ |