[NETFILTER]: x_tables: switch hotdrop to bool
[linux-2.6-block.git] / net / netfilter / xt_comment.c
CommitLineData
1da177e4
LT
1/*
2 * Implements a dummy match to allow attaching comments to rules
3 *
4 * 2003-05-13 Brad Fisher (brad@info-link.net)
5 */
6
7#include <linux/module.h>
8#include <linux/skbuff.h>
2e4e6a17
HW
9#include <linux/netfilter/x_tables.h>
10#include <linux/netfilter/xt_comment.h>
1da177e4
LT
11
12MODULE_AUTHOR("Brad Fisher <brad@info-link.net>");
13MODULE_DESCRIPTION("iptables comment match module");
14MODULE_LICENSE("GPL");
2e4e6a17
HW
15MODULE_ALIAS("ipt_comment");
16MODULE_ALIAS("ip6t_comment");
1da177e4
LT
17
18static int
19match(const struct sk_buff *skb,
20 const struct net_device *in,
21 const struct net_device *out,
c4986734 22 const struct xt_match *match,
1da177e4
LT
23 const void *matchinfo,
24 int offset,
2e4e6a17 25 unsigned int protooff,
cff533ac 26 bool *hotdrop)
1da177e4
LT
27{
28 /* We always match */
29 return 1;
30}
31
4470bbc7
PM
32static struct xt_match xt_comment_match[] = {
33 {
34 .name = "comment",
35 .family = AF_INET,
36 .match = match,
37 .matchsize = sizeof(struct xt_comment_info),
38 .me = THIS_MODULE
39 },
40 {
41 .name = "comment",
42 .family = AF_INET6,
43 .match = match,
44 .matchsize = sizeof(struct xt_comment_info),
45 .me = THIS_MODULE
46 },
1da177e4
LT
47};
48
65b4b4e8 49static int __init xt_comment_init(void)
1da177e4 50{
4470bbc7
PM
51 return xt_register_matches(xt_comment_match,
52 ARRAY_SIZE(xt_comment_match));
1da177e4
LT
53}
54
65b4b4e8 55static void __exit xt_comment_fini(void)
1da177e4 56{
4470bbc7 57 xt_unregister_matches(xt_comment_match, ARRAY_SIZE(xt_comment_match));
1da177e4
LT
58}
59
65b4b4e8
AM
60module_init(xt_comment_init);
61module_exit(xt_comment_fini);