aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_dscp.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2007-12-05 02:24:03 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:55:53 -0500
commitd3c5ee6d545b5372fd525ebe16988a5b6efeceb0 (patch)
tree97efd14cfb818ac5fb56a023efe9217f78ad240f /net/netfilter/xt_dscp.c
parent4c610979576d8778c401a9b1d247ed14f6cee998 (diff)
[NETFILTER]: x_tables: consistent and unique symbol names
Give all Netfilter modules consistent and unique symbol names. Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/xt_dscp.c')
-rw-r--r--net/netfilter/xt_dscp.c56
1 files changed, 24 insertions, 32 deletions
diff --git a/net/netfilter/xt_dscp.c b/net/netfilter/xt_dscp.c
index dde6d66e0d3..63f7354ca9a 100644
--- a/net/netfilter/xt_dscp.c
+++ b/net/netfilter/xt_dscp.c
@@ -22,14 +22,10 @@ MODULE_LICENSE("GPL");
22MODULE_ALIAS("ipt_dscp"); 22MODULE_ALIAS("ipt_dscp");
23MODULE_ALIAS("ip6t_dscp"); 23MODULE_ALIAS("ip6t_dscp");
24 24
25static bool match(const struct sk_buff *skb, 25static bool
26 const struct net_device *in, 26dscp_mt(const struct sk_buff *skb, const struct net_device *in,
27 const struct net_device *out, 27 const struct net_device *out, const struct xt_match *match,
28 const struct xt_match *match, 28 const void *matchinfo, int offset, unsigned int protoff, bool *hotdrop)
29 const void *matchinfo,
30 int offset,
31 unsigned int protoff,
32 bool *hotdrop)
33{ 29{
34 const struct xt_dscp_info *info = matchinfo; 30 const struct xt_dscp_info *info = matchinfo;
35 u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT; 31 u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT;
@@ -37,14 +33,11 @@ static bool match(const struct sk_buff *skb,
37 return (dscp == info->dscp) ^ !!info->invert; 33 return (dscp == info->dscp) ^ !!info->invert;
38} 34}
39 35
40static bool match6(const struct sk_buff *skb, 36static bool
41 const struct net_device *in, 37dscp_mt6(const struct sk_buff *skb, const struct net_device *in,
42 const struct net_device *out, 38 const struct net_device *out, const struct xt_match *match,
43 const struct xt_match *match, 39 const void *matchinfo, int offset, unsigned int protoff,
44 const void *matchinfo, 40 bool *hotdrop)
45 int offset,
46 unsigned int protoff,
47 bool *hotdrop)
48{ 41{
49 const struct xt_dscp_info *info = matchinfo; 42 const struct xt_dscp_info *info = matchinfo;
50 u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT; 43 u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT;
@@ -52,11 +45,10 @@ static bool match6(const struct sk_buff *skb,
52 return (dscp == info->dscp) ^ !!info->invert; 45 return (dscp == info->dscp) ^ !!info->invert;
53} 46}
54 47
55static bool checkentry(const char *tablename, 48static bool
56 const void *info, 49dscp_mt_check(const char *tablename, const void *info,
57 const struct xt_match *match, 50 const struct xt_match *match, void *matchinfo,
58 void *matchinfo, 51 unsigned int hook_mask)
59 unsigned int hook_mask)
60{ 52{
61 const u_int8_t dscp = ((struct xt_dscp_info *)matchinfo)->dscp; 53 const u_int8_t dscp = ((struct xt_dscp_info *)matchinfo)->dscp;
62 54
@@ -68,34 +60,34 @@ static bool checkentry(const char *tablename,
68 return true; 60 return true;
69} 61}
70 62
71static struct xt_match xt_dscp_match[] __read_mostly = { 63static struct xt_match dscp_mt_reg[] __read_mostly = {
72 { 64 {
73 .name = "dscp", 65 .name = "dscp",
74 .family = AF_INET, 66 .family = AF_INET,
75 .checkentry = checkentry, 67 .checkentry = dscp_mt_check,
76 .match = match, 68 .match = dscp_mt,
77 .matchsize = sizeof(struct xt_dscp_info), 69 .matchsize = sizeof(struct xt_dscp_info),
78 .me = THIS_MODULE, 70 .me = THIS_MODULE,
79 }, 71 },
80 { 72 {
81 .name = "dscp", 73 .name = "dscp",
82 .family = AF_INET6, 74 .family = AF_INET6,
83 .checkentry = checkentry, 75 .checkentry = dscp_mt_check,
84 .match = match6, 76 .match = dscp_mt6,
85 .matchsize = sizeof(struct xt_dscp_info), 77 .matchsize = sizeof(struct xt_dscp_info),
86 .me = THIS_MODULE, 78 .me = THIS_MODULE,
87 }, 79 },
88}; 80};
89 81
90static int __init xt_dscp_match_init(void) 82static int __init dscp_mt_init(void)
91{ 83{
92 return xt_register_matches(xt_dscp_match, ARRAY_SIZE(xt_dscp_match)); 84 return xt_register_matches(dscp_mt_reg, ARRAY_SIZE(dscp_mt_reg));
93} 85}
94 86
95static void __exit xt_dscp_match_fini(void) 87static void __exit dscp_mt_exit(void)
96{ 88{
97 xt_unregister_matches(xt_dscp_match, ARRAY_SIZE(xt_dscp_match)); 89 xt_unregister_matches(dscp_mt_reg, ARRAY_SIZE(dscp_mt_reg));
98} 90}
99 91
100module_init(xt_dscp_match_init); 92module_init(dscp_mt_init);
101module_exit(xt_dscp_match_fini); 93module_exit(dscp_mt_exit);