diff options
author | Jan Engelhardt <jengelh@computergmbh.de> | 2007-12-05 02:24:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:55:53 -0500 |
commit | d3c5ee6d545b5372fd525ebe16988a5b6efeceb0 (patch) | |
tree | 97efd14cfb818ac5fb56a023efe9217f78ad240f /net/netfilter/xt_limit.c | |
parent | 4c610979576d8778c401a9b1d247ed14f6cee998 (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_limit.c')
-rw-r--r-- | net/netfilter/xt_limit.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index f263a77e57b..c9352dbf3a1 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c | |||
@@ -58,14 +58,10 @@ static DEFINE_SPINLOCK(limit_lock); | |||
58 | #define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ) | 58 | #define CREDITS_PER_JIFFY POW2_BELOW32(MAX_CPJ) |
59 | 59 | ||
60 | static bool | 60 | static bool |
61 | ipt_limit_match(const struct sk_buff *skb, | 61 | limit_mt(const struct sk_buff *skb, const struct net_device *in, |
62 | const struct net_device *in, | 62 | const struct net_device *out, const struct xt_match *match, |
63 | const struct net_device *out, | 63 | const void *matchinfo, int offset, unsigned int protoff, |
64 | const struct xt_match *match, | 64 | bool *hotdrop) |
65 | const void *matchinfo, | ||
66 | int offset, | ||
67 | unsigned int protoff, | ||
68 | bool *hotdrop) | ||
69 | { | 65 | { |
70 | struct xt_rateinfo *r = | 66 | struct xt_rateinfo *r = |
71 | ((const struct xt_rateinfo *)matchinfo)->master; | 67 | ((const struct xt_rateinfo *)matchinfo)->master; |
@@ -100,11 +96,9 @@ user2credits(u_int32_t user) | |||
100 | } | 96 | } |
101 | 97 | ||
102 | static bool | 98 | static bool |
103 | ipt_limit_checkentry(const char *tablename, | 99 | limit_mt_check(const char *tablename, const void *inf, |
104 | const void *inf, | 100 | const struct xt_match *match, void *matchinfo, |
105 | const struct xt_match *match, | 101 | unsigned int hook_mask) |
106 | void *matchinfo, | ||
107 | unsigned int hook_mask) | ||
108 | { | 102 | { |
109 | struct xt_rateinfo *r = matchinfo; | 103 | struct xt_rateinfo *r = matchinfo; |
110 | 104 | ||
@@ -143,7 +137,7 @@ struct compat_xt_rateinfo { | |||
143 | 137 | ||
144 | /* To keep the full "prev" timestamp, the upper 32 bits are stored in the | 138 | /* To keep the full "prev" timestamp, the upper 32 bits are stored in the |
145 | * master pointer, which does not need to be preserved. */ | 139 | * master pointer, which does not need to be preserved. */ |
146 | static void compat_from_user(void *dst, void *src) | 140 | static void limit_mt_compat_from_user(void *dst, void *src) |
147 | { | 141 | { |
148 | const struct compat_xt_rateinfo *cm = src; | 142 | const struct compat_xt_rateinfo *cm = src; |
149 | struct xt_rateinfo m = { | 143 | struct xt_rateinfo m = { |
@@ -157,7 +151,7 @@ static void compat_from_user(void *dst, void *src) | |||
157 | memcpy(dst, &m, sizeof(m)); | 151 | memcpy(dst, &m, sizeof(m)); |
158 | } | 152 | } |
159 | 153 | ||
160 | static int compat_to_user(void __user *dst, void *src) | 154 | static int limit_mt_compat_to_user(void __user *dst, void *src) |
161 | { | 155 | { |
162 | const struct xt_rateinfo *m = src; | 156 | const struct xt_rateinfo *m = src; |
163 | struct compat_xt_rateinfo cm = { | 157 | struct compat_xt_rateinfo cm = { |
@@ -173,39 +167,39 @@ static int compat_to_user(void __user *dst, void *src) | |||
173 | } | 167 | } |
174 | #endif /* CONFIG_COMPAT */ | 168 | #endif /* CONFIG_COMPAT */ |
175 | 169 | ||
176 | static struct xt_match xt_limit_match[] __read_mostly = { | 170 | static struct xt_match limit_mt_reg[] __read_mostly = { |
177 | { | 171 | { |
178 | .name = "limit", | 172 | .name = "limit", |
179 | .family = AF_INET, | 173 | .family = AF_INET, |
180 | .checkentry = ipt_limit_checkentry, | 174 | .checkentry = limit_mt_check, |
181 | .match = ipt_limit_match, | 175 | .match = limit_mt, |
182 | .matchsize = sizeof(struct xt_rateinfo), | 176 | .matchsize = sizeof(struct xt_rateinfo), |
183 | #ifdef CONFIG_COMPAT | 177 | #ifdef CONFIG_COMPAT |
184 | .compatsize = sizeof(struct compat_xt_rateinfo), | 178 | .compatsize = sizeof(struct compat_xt_rateinfo), |
185 | .compat_from_user = compat_from_user, | 179 | .compat_from_user = limit_mt_compat_from_user, |
186 | .compat_to_user = compat_to_user, | 180 | .compat_to_user = limit_mt_compat_to_user, |
187 | #endif | 181 | #endif |
188 | .me = THIS_MODULE, | 182 | .me = THIS_MODULE, |
189 | }, | 183 | }, |
190 | { | 184 | { |
191 | .name = "limit", | 185 | .name = "limit", |
192 | .family = AF_INET6, | 186 | .family = AF_INET6, |
193 | .checkentry = ipt_limit_checkentry, | 187 | .checkentry = limit_mt_check, |
194 | .match = ipt_limit_match, | 188 | .match = limit_mt, |
195 | .matchsize = sizeof(struct xt_rateinfo), | 189 | .matchsize = sizeof(struct xt_rateinfo), |
196 | .me = THIS_MODULE, | 190 | .me = THIS_MODULE, |
197 | }, | 191 | }, |
198 | }; | 192 | }; |
199 | 193 | ||
200 | static int __init xt_limit_init(void) | 194 | static int __init limit_mt_init(void) |
201 | { | 195 | { |
202 | return xt_register_matches(xt_limit_match, ARRAY_SIZE(xt_limit_match)); | 196 | return xt_register_matches(limit_mt_reg, ARRAY_SIZE(limit_mt_reg)); |
203 | } | 197 | } |
204 | 198 | ||
205 | static void __exit xt_limit_fini(void) | 199 | static void __exit limit_mt_exit(void) |
206 | { | 200 | { |
207 | xt_unregister_matches(xt_limit_match, ARRAY_SIZE(xt_limit_match)); | 201 | xt_unregister_matches(limit_mt_reg, ARRAY_SIZE(limit_mt_reg)); |
208 | } | 202 | } |
209 | 203 | ||
210 | module_init(xt_limit_init); | 204 | module_init(limit_mt_init); |
211 | module_exit(xt_limit_fini); | 205 | module_exit(limit_mt_exit); |