summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/mlfk_rule.c
blob: b5aa0baa9745ae589478df44ef5e2b5536637297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*	$FreeBSD$	*/

/*
 * Copyright (C) 2000 by Darren Reed.
 *
 * See the IPFILTER.LICENCE file for details on licencing.
 *
 * Id: mlfk_rule.c,v 2.4.4.2 2004/04/16 23:32:08 darrenr Exp
 */


#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/conf.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>

#include <netinet/ipl.h>
#include <netinet/ip_compat.h>
#include <netinet/ip_fil.h>
#include <netinet/ip_state.h>
#include <netinet/ip_nat.h>
#include <netinet/ip_auth.h>
#include <netinet/ip_frag.h>

#include "ip_rules.h"


static int
ipfrule_modevent(module_t mod, int type, void *unused)
{
	int error = 0;

	switch (type)
	{
	case MOD_LOAD :
		error = ipfrule_add();
		if (!error)
			fr_refcnt++;
		break;
	case MOD_UNLOAD :
		error = ipfrule_remove();
		if (!error)
			fr_refcnt--;
		break;
	default:
		error = EINVAL;
		break;
	}
	return error;
}

static moduledata_t ipfrulemod = {
	"ipfrule",
	ipfrule_modevent,
        0
};
DECLARE_MODULE(ipfrule, ipfrulemod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);
#ifdef	MODULE_DEPEND
MODULE_DEPEND(ipfrule, ipfilter, 1, 1, 1);
#endif
#ifdef	MODULE_VERSION
MODULE_VERSION(ipfrule, 1);
#endif
OpenPOWER on IntegriCloud