Blame view
net/netfilter/xt_CLASSIFY.c
1.6 KB
1da177e4c
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/* * This is a module which is used for setting the skb->priority field * of an skb for qdisc classification. */ /* (C) 2001-2002 Patrick McHardy <kaber@trash.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/module.h> #include <linux/skbuff.h> #include <linux/ip.h> #include <net/checksum.h> |
891350c9d
|
17 18 |
#include <linux/netfilter_ipv4.h> #include <linux/netfilter_ipv6.h> |
2e4e6a17a
|
19 20 |
#include <linux/netfilter/x_tables.h> #include <linux/netfilter/xt_CLASSIFY.h> |
1da177e4c
|
21 22 23 |
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); MODULE_LICENSE("GPL"); |
2ae15b64e
|
24 |
MODULE_DESCRIPTION("Xtables: Qdisc classification"); |
2e4e6a17a
|
25 |
MODULE_ALIAS("ipt_CLASSIFY"); |
73aaf9355
|
26 |
MODULE_ALIAS("ip6t_CLASSIFY"); |
1da177e4c
|
27 28 |
static unsigned int |
4b560b447
|
29 |
classify_tg(struct sk_buff *skb, const struct xt_action_param *par) |
1da177e4c
|
30 |
{ |
7eb355865
|
31 |
const struct xt_classify_target_info *clinfo = par->targinfo; |
1da177e4c
|
32 |
|
3db05fea5
|
33 |
skb->priority = clinfo->priority; |
2e4e6a17a
|
34 |
return XT_CONTINUE; |
1da177e4c
|
35 |
} |
55b69e910
|
36 37 38 39 40 41 42 43 44 45 |
static struct xt_target classify_tg_reg __read_mostly = { .name = "CLASSIFY", .revision = 0, .family = NFPROTO_UNSPEC, .table = "mangle", .hooks = (1 << NF_INET_LOCAL_OUT) | (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING), .target = classify_tg, .targetsize = sizeof(struct xt_classify_target_info), .me = THIS_MODULE, |
2e4e6a17a
|
46 |
}; |
2e4e6a17a
|
47 |
|
d3c5ee6d5
|
48 |
static int __init classify_tg_init(void) |
1da177e4c
|
49 |
{ |
55b69e910
|
50 |
return xt_register_target(&classify_tg_reg); |
1da177e4c
|
51 |
} |
d3c5ee6d5
|
52 |
static void __exit classify_tg_exit(void) |
1da177e4c
|
53 |
{ |
55b69e910
|
54 |
xt_unregister_target(&classify_tg_reg); |
1da177e4c
|
55 |
} |
d3c5ee6d5
|
56 57 |
module_init(classify_tg_init); module_exit(classify_tg_exit); |