~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/netfilter/xt_CLASSIFY.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <linux/netfilter_ipv6.h>
20
20
#include <linux/netfilter/x_tables.h>
21
21
#include <linux/netfilter/xt_CLASSIFY.h>
 
22
#include <linux/netfilter_arp.h>
22
23
 
23
24
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
24
25
MODULE_LICENSE("GPL");
25
26
MODULE_DESCRIPTION("Xtables: Qdisc classification");
26
27
MODULE_ALIAS("ipt_CLASSIFY");
27
28
MODULE_ALIAS("ip6t_CLASSIFY");
 
29
MODULE_ALIAS("arpt_CLASSIFY");
28
30
 
29
31
static unsigned int
30
32
classify_tg(struct sk_buff *skb, const struct xt_action_param *par)
35
37
        return XT_CONTINUE;
36
38
}
37
39
 
38
 
static struct xt_target classify_tg_reg __read_mostly = {
39
 
        .name       = "CLASSIFY",
40
 
        .revision   = 0,
41
 
        .family     = NFPROTO_UNSPEC,
42
 
        .table      = "mangle",
43
 
        .hooks      = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) |
44
 
                      (1 << NF_INET_POST_ROUTING),
45
 
        .target     = classify_tg,
46
 
        .targetsize = sizeof(struct xt_classify_target_info),
47
 
        .me         = THIS_MODULE,
 
40
static struct xt_target classify_tg_reg[] __read_mostly = {
 
41
        {
 
42
                .name       = "CLASSIFY",
 
43
                .revision   = 0,
 
44
                .family     = NFPROTO_UNSPEC,
 
45
                .hooks      = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) |
 
46
                              (1 << NF_INET_POST_ROUTING),
 
47
                .target     = classify_tg,
 
48
                .targetsize = sizeof(struct xt_classify_target_info),
 
49
                .me         = THIS_MODULE,
 
50
        },
 
51
        {
 
52
                .name       = "CLASSIFY",
 
53
                .revision   = 0,
 
54
                .family     = NFPROTO_ARP,
 
55
                .hooks      = (1 << NF_ARP_OUT) | (1 << NF_ARP_FORWARD),
 
56
                .target     = classify_tg,
 
57
                .targetsize = sizeof(struct xt_classify_target_info),
 
58
                .me         = THIS_MODULE,
 
59
        },
48
60
};
49
61
 
50
62
static int __init classify_tg_init(void)
51
63
{
52
 
        return xt_register_target(&classify_tg_reg);
 
64
        return xt_register_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg));
53
65
}
54
66
 
55
67
static void __exit classify_tg_exit(void)
56
68
{
57
 
        xt_unregister_target(&classify_tg_reg);
 
69
        xt_unregister_targets(classify_tg_reg, ARRAY_SIZE(classify_tg_reg));
58
70
}
59
71
 
60
72
module_init(classify_tg_init);