static int pflog_modevent(module_t mod, int type, void *data) { int error = 0; switch (type) { case MOD_LOAD: LIST_INIT(&pflog_list); if_clone_attach(&pflog_cloner); break; case MOD_UNLOAD: if_clone_detach(&pflog_cloner); while (!LIST_EMPTY(&pflog_list)) pflog_clone_destroy( &LIST_FIRST(&pflog_list)->sc_if); break; default: error = EINVAL; break; } return error; }
void pflogdetach(void) { int i; for (i = 0; i < PFLOGIFS_MAX; i++) { if (pflogifs[i] != NULL) pflog_clone_destroy(pflogifs[i]); } if_clone_detach(&pflog_cloner); }