diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 05:35:20 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:20 -0400 |
commit | 916a917dfec18535ff9e2afdafba82e6279eb4f4 (patch) | |
tree | ebd2e944684f3f1a9c184e3e69d06d1465ed2f69 /include | |
parent | a2df1648ba615dd5908e9a1fa7b2f133fa302487 (diff) |
netfilter: xtables: provide invoked family value to extensions
By passing in the family through which extensions were invoked, a bit
of data space can be reclaimed. The "family" member will be added to
the parameter structures and the check functions be adjusted.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/x_tables.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index e3b3b669a143..be41b609c88f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -183,6 +183,8 @@ struct xt_counters_info | |||
183 | * @fragoff: packet is a fragment, this is the data offset | 183 | * @fragoff: packet is a fragment, this is the data offset |
184 | * @thoff: position of transport header relative to skb->data | 184 | * @thoff: position of transport header relative to skb->data |
185 | * @hotdrop: drop packet if we had inspection problems | 185 | * @hotdrop: drop packet if we had inspection problems |
186 | * @family: Actual NFPROTO_* through which the function is invoked | ||
187 | * (helpful when match->family == NFPROTO_UNSPEC) | ||
186 | */ | 188 | */ |
187 | struct xt_match_param { | 189 | struct xt_match_param { |
188 | const struct net_device *in, *out; | 190 | const struct net_device *in, *out; |
@@ -191,6 +193,7 @@ struct xt_match_param { | |||
191 | int fragoff; | 193 | int fragoff; |
192 | unsigned int thoff; | 194 | unsigned int thoff; |
193 | bool *hotdrop; | 195 | bool *hotdrop; |
196 | u_int8_t family; | ||
194 | }; | 197 | }; |
195 | 198 | ||
196 | /** | 199 | /** |
@@ -210,12 +213,14 @@ struct xt_mtchk_param { | |||
210 | const struct xt_match *match; | 213 | const struct xt_match *match; |
211 | void *matchinfo; | 214 | void *matchinfo; |
212 | unsigned int hook_mask; | 215 | unsigned int hook_mask; |
216 | u_int8_t family; | ||
213 | }; | 217 | }; |
214 | 218 | ||
215 | /* Match destructor parameters */ | 219 | /* Match destructor parameters */ |
216 | struct xt_mtdtor_param { | 220 | struct xt_mtdtor_param { |
217 | const struct xt_match *match; | 221 | const struct xt_match *match; |
218 | void *matchinfo; | 222 | void *matchinfo; |
223 | u_int8_t family; | ||
219 | }; | 224 | }; |
220 | 225 | ||
221 | /** | 226 | /** |
@@ -232,6 +237,7 @@ struct xt_target_param { | |||
232 | unsigned int hooknum; | 237 | unsigned int hooknum; |
233 | const struct xt_target *target; | 238 | const struct xt_target *target; |
234 | const void *targinfo; | 239 | const void *targinfo; |
240 | u_int8_t family; | ||
235 | }; | 241 | }; |
236 | 242 | ||
237 | /** | 243 | /** |
@@ -249,12 +255,14 @@ struct xt_tgchk_param { | |||
249 | const struct xt_target *target; | 255 | const struct xt_target *target; |
250 | void *targinfo; | 256 | void *targinfo; |
251 | unsigned int hook_mask; | 257 | unsigned int hook_mask; |
258 | u_int8_t family; | ||
252 | }; | 259 | }; |
253 | 260 | ||
254 | /* Target destructor parameters */ | 261 | /* Target destructor parameters */ |
255 | struct xt_tgdtor_param { | 262 | struct xt_tgdtor_param { |
256 | const struct xt_target *target; | 263 | const struct xt_target *target; |
257 | void *targinfo; | 264 | void *targinfo; |
265 | u_int8_t family; | ||
258 | }; | 266 | }; |
259 | 267 | ||
260 | struct xt_match | 268 | struct xt_match |
@@ -393,9 +401,9 @@ extern void xt_unregister_match(struct xt_match *target); | |||
393 | extern int xt_register_matches(struct xt_match *match, unsigned int n); | 401 | extern int xt_register_matches(struct xt_match *match, unsigned int n); |
394 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); | 402 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); |
395 | 403 | ||
396 | extern int xt_check_match(struct xt_mtchk_param *, u_int8_t family, | 404 | extern int xt_check_match(struct xt_mtchk_param *, |
397 | unsigned int size, u_int8_t proto, bool inv_proto); | 405 | unsigned int size, u_int8_t proto, bool inv_proto); |
398 | extern int xt_check_target(struct xt_tgchk_param *, u_int8_t family, | 406 | extern int xt_check_target(struct xt_tgchk_param *, |
399 | unsigned int size, u_int8_t proto, bool inv_proto); | 407 | unsigned int size, u_int8_t proto, bool inv_proto); |
400 | 408 | ||
401 | extern struct xt_table *xt_register_table(struct net *net, | 409 | extern struct xt_table *xt_register_table(struct net *net, |