aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:19 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:19 -0400
commitaf5d6dc200eb0fcc6fbd3df1ab4d8969004cb37f (patch)
tree06f5805d0a98a421f23380bdb044f93216204b9d /include/linux
parent7eb3558655aaa87a3e71a0c065dfaddda521fa6d (diff)
netfilter: xtables: move extension arguments into compound structure (5/6)
This patch does this for target 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.h29
-rw-r--r--include/linux/netfilter_bridge/ebtables.h4
2 files changed, 22 insertions, 11 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 46d0cb1ad340..8daeb496ba7a 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -234,6 +234,23 @@ struct xt_target_param {
234 const void *targinfo; 234 const void *targinfo;
235}; 235};
236 236
237/**
238 * struct xt_tgchk_param - parameters for target extensions'
239 * checkentry functions
240 *
241 * @entryinfo: the family-specific rule data
242 * (struct ipt_entry, ip6t_entry, arpt_entry, ebt_entry)
243 *
244 * Other fields see above.
245 */
246struct xt_tgchk_param {
247 const char *table;
248 void *entryinfo;
249 const struct xt_target *target;
250 void *targinfo;
251 unsigned int hook_mask;
252};
253
237struct xt_match 254struct xt_match
238{ 255{
239 struct list_head list; 256 struct list_head list;
@@ -291,11 +308,7 @@ struct xt_target
291 hook_mask is a bitmask of hooks from which it can be 308 hook_mask is a bitmask of hooks from which it can be
292 called. */ 309 called. */
293 /* Should return true or false. */ 310 /* Should return true or false. */
294 bool (*checkentry)(const char *tablename, 311 bool (*checkentry)(const struct xt_tgchk_param *);
295 const void *entry,
296 const struct xt_target *target,
297 void *targinfo,
298 unsigned int hook_mask);
299 312
300 /* Called when entry of this type deleted. */ 313 /* Called when entry of this type deleted. */
301 void (*destroy)(const struct xt_target *target, void *targinfo); 314 void (*destroy)(const struct xt_target *target, void *targinfo);
@@ -376,10 +389,8 @@ extern void xt_unregister_matches(struct xt_match *match, unsigned int n);
376 389
377extern int xt_check_match(struct xt_mtchk_param *, u_int8_t family, 390extern int xt_check_match(struct xt_mtchk_param *, u_int8_t family,
378 unsigned int size, u_int8_t proto, bool inv_proto); 391 unsigned int size, u_int8_t proto, bool inv_proto);
379extern int xt_check_target(const struct xt_target *target, unsigned short family, 392extern int xt_check_target(struct xt_tgchk_param *, u_int8_t family,
380 unsigned int size, const char *table, unsigned int hook, 393 unsigned int size, u_int8_t proto, bool inv_proto);
381 unsigned short proto, int inv_proto,
382 const void *entry, void *targinfo);
383 394
384extern struct xt_table *xt_register_table(struct net *net, 395extern struct xt_table *xt_register_table(struct net *net,
385 struct xt_table *table, 396 struct xt_table *table,
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 568a690f6a62..d45e29cd1cfb 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -310,9 +310,9 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
310#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) 310#define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg))
311/* True if the hook mask denotes that the rule is in a base chain, 311/* True if the hook mask denotes that the rule is in a base chain,
312 * used in the check() functions */ 312 * used in the check() functions */
313#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS)) 313#define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS))
314/* Clear the bit in the hook mask that tells if the rule is on a base chain */ 314/* Clear the bit in the hook mask that tells if the rule is on a base chain */
315#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS)) 315#define CLEAR_BASE_CHAIN_BIT (par->hook_mask &= ~(1 << NF_BR_NUMHOOKS))
316/* True if the target is not a standard target */ 316/* True if the target is not a standard target */
317#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) 317#define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0)
318 318