diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 05:35:18 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:18 -0400 |
commit | 9b4fce7a3508a9776534188b6065b206a9608ccf (patch) | |
tree | 7df90f099a72738900deb93124ad86724a2df207 /include/linux | |
parent | f7108a20dee44e5bb037f9e48f6a207b42e6ae1c (diff) |
netfilter: xtables: move extension arguments into compound structure (2/6)
This patch does this for match extensions' checkentry functions.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netfilter/x_tables.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index bcd40ec83257..763a704ce83f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -193,6 +193,25 @@ struct xt_match_param { | |||
193 | bool *hotdrop; | 193 | bool *hotdrop; |
194 | }; | 194 | }; |
195 | 195 | ||
196 | /** | ||
197 | * struct xt_mtchk_param - parameters for match extensions' | ||
198 | * checkentry functions | ||
199 | * | ||
200 | * @table: table the rule is tried to be inserted into | ||
201 | * @entryinfo: the family-specific rule data | ||
202 | * (struct ipt_ip, ip6t_ip, ebt_entry) | ||
203 | * @match: struct xt_match through which this function was invoked | ||
204 | * @matchinfo: per-match data | ||
205 | * @hook_mask: via which hooks the new rule is reachable | ||
206 | */ | ||
207 | struct xt_mtchk_param { | ||
208 | const char *table; | ||
209 | const void *entryinfo; | ||
210 | const struct xt_match *match; | ||
211 | void *matchinfo; | ||
212 | unsigned int hook_mask; | ||
213 | }; | ||
214 | |||
196 | struct xt_match | 215 | struct xt_match |
197 | { | 216 | { |
198 | struct list_head list; | 217 | struct list_head list; |
@@ -208,12 +227,7 @@ struct xt_match | |||
208 | const struct xt_match_param *); | 227 | const struct xt_match_param *); |
209 | 228 | ||
210 | /* Called when user tries to insert an entry of this type. */ | 229 | /* Called when user tries to insert an entry of this type. */ |
211 | /* Should return true or false. */ | 230 | bool (*checkentry)(const struct xt_mtchk_param *); |
212 | bool (*checkentry)(const char *tablename, | ||
213 | const void *ip, | ||
214 | const struct xt_match *match, | ||
215 | void *matchinfo, | ||
216 | unsigned int hook_mask); | ||
217 | 231 | ||
218 | /* Called when entry of this type deleted. */ | 232 | /* Called when entry of this type deleted. */ |
219 | void (*destroy)(const struct xt_match *match, void *matchinfo); | 233 | void (*destroy)(const struct xt_match *match, void *matchinfo); |
@@ -342,10 +356,8 @@ extern void xt_unregister_match(struct xt_match *target); | |||
342 | extern int xt_register_matches(struct xt_match *match, unsigned int n); | 356 | extern int xt_register_matches(struct xt_match *match, unsigned int n); |
343 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); | 357 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); |
344 | 358 | ||
345 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 359 | extern int xt_check_match(struct xt_mtchk_param *, u_int8_t family, |
346 | unsigned int size, const char *table, unsigned int hook, | 360 | unsigned int size, u_int8_t proto, bool inv_proto); |
347 | unsigned short proto, int inv_proto, | ||
348 | const void *entry, void *matchinfo); | ||
349 | extern int xt_check_target(const struct xt_target *target, unsigned short family, | 361 | extern int xt_check_target(const struct xt_target *target, unsigned short family, |
350 | unsigned int size, const char *table, unsigned int hook, | 362 | unsigned int size, const char *table, unsigned int hook, |
351 | unsigned short proto, int inv_proto, | 363 | unsigned short proto, int inv_proto, |