Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ipf / mlfk_rule.c
bloba4f3ba71ff22d1056b17cab7e8abba8e0a11d05f
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2000 by Darren Reed.
6 * See the IPFILTER.LICENCE file for details on licencing.
8 * Id: mlfk_rule.c,v 2.4.4.2 2004/04/16 23:32:08 darrenr Exp
9 */
12 #include <sys/param.h>
13 #include <sys/systm.h>
14 #include <sys/kernel.h>
15 #include <sys/module.h>
16 #include <sys/conf.h>
17 #include <sys/socket.h>
18 #include <sys/sysctl.h>
19 #include <net/if.h>
20 #include <netinet/in_systm.h>
21 #include <netinet/in.h>
23 #include <netinet/ipl.h>
24 #include <netinet/ip_compat.h>
25 #include <netinet/ip_fil.h>
26 #include <netinet/ip_state.h>
27 #include <netinet/ip_nat.h>
28 #include <netinet/ip_auth.h>
29 #include <netinet/ip_frag.h>
31 #include "ip_rules.h"
34 static int
35 ipfrule_modevent(module_t mod, int type, void *unused)
37 int error = 0;
39 switch (type)
41 case MOD_LOAD :
42 error = ipfrule_add();
43 if (!error)
44 fr_refcnt++;
45 break;
46 case MOD_UNLOAD :
47 error = ipfrule_remove();
48 if (!error)
49 fr_refcnt--;
50 break;
51 default:
52 error = EINVAL;
53 break;
55 return error;
58 static moduledata_t ipfrulemod = {
59 "ipfrule",
60 ipfrule_modevent,
63 DECLARE_MODULE(ipfrule, ipfrulemod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);
64 #ifdef MODULE_DEPEND
65 MODULE_DEPEND(ipfrule, ipfilter, 1, 1, 1);
66 #endif
67 #ifdef MODULE_VERSION
68 MODULE_VERSION(ipfrule, 1);
69 #endif