} val;
};
+/**
+ * @ext_name: name of extension currently being processed
+ * @data: per-extension data block
+ * @xflags: options of the extension that have been used
+ */
+struct xt_fcheck_call {
+ const char *ext_name;
+ void *data;
+ unsigned int xflags;
+};
+
/* Include file for additions: new matches and targets. */
struct xtables_match
{
/* New parser */
void (*x6_parse)(struct xt_option_call *);
+ void (*x6_fcheck)(struct xt_fcheck_call *);
const struct xt_option_entry *x6_options;
/* Ignore these men behind the curtain: */
/* New parser */
void (*x6_parse)(struct xt_option_call *);
+ void (*x6_fcheck)(struct xt_fcheck_call *);
const struct xt_option_entry *x6_options;
/* Ignore these men behind the curtain: */
struct xtables_target *, void *);
extern void xtables_option_mpcall(unsigned int, char **, bool,
struct xtables_match *, void *);
+extern void xtables_option_tfcall(struct xtables_target *);
+extern void xtables_option_mfcall(struct xtables_match *);
extern void xtables_options_fcheck(const char *, unsigned int,
const struct xt_option_entry *);
cs.invert = FALSE;
}
- for (matchp = cs.matches; matchp; matchp = matchp->next) {
- if (matchp->match->x6_options != NULL)
- xtables_options_fcheck(matchp->match->name,
- matchp->match->mflags,
- matchp->match->x6_options);
- if (matchp->match->final_check != NULL)
- matchp->match->final_check(matchp->match->mflags);
- }
-
- if (cs.target != NULL && cs.target->x6_options != NULL)
- xtables_options_fcheck(cs.target->name, cs.target->tflags,
- cs.target->x6_options);
- if (cs.target != NULL && cs.target->final_check != NULL)
- cs.target->final_check(cs.target->tflags);
+ for (matchp = cs.matches; matchp; matchp = matchp->next)
+ xtables_option_mfcall(matchp->match);
+ if (cs.target != NULL)
+ xtables_option_tfcall(cs.target);
/* Fix me: must put inverse options checking here --MN */
"\nThe \"nat\" table is not intended for filtering, "
"the use of DROP is therefore inhibited.\n\n");
- for (matchp = cs.matches; matchp; matchp = matchp->next) {
- if (matchp->match->x6_options != NULL)
- xtables_options_fcheck(matchp->match->name,
- matchp->match->mflags,
- matchp->match->x6_options);
- if (matchp->match->final_check != NULL)
- matchp->match->final_check(matchp->match->mflags);
- }
-
- if (cs.target != NULL && cs.target->x6_options != NULL)
- xtables_options_fcheck(cs.target->name, cs.target->tflags,
- cs.target->x6_options);
- if (cs.target != NULL && cs.target->final_check != NULL)
- cs.target->final_check(cs.target->tflags);
+ for (matchp = cs.matches; matchp; matchp = matchp->next)
+ xtables_option_mfcall(matchp->match);
+ if (cs.target != NULL)
+ xtables_option_tfcall(cs.target);
/* Fix me: must put inverse options checking here --MN */
}
}
}
+
+/**
+ * Dispatch arguments to the appropriate final_check function, based upon the
+ * extension's choice of API.
+ */
+void xtables_option_tfcall(struct xtables_target *t)
+{
+ if (t->x6_fcheck != NULL) {
+ struct xt_fcheck_call cb;
+
+ cb.ext_name = t->name;
+ cb.data = t->t->data;
+ cb.xflags = t->tflags;
+ t->x6_fcheck(&cb);
+ } else if (t->final_check != NULL) {
+ t->final_check(t->tflags);
+ }
+ if (t->x6_options != NULL)
+ xtables_options_fcheck(t->name, t->tflags, t->x6_options);
+}
+
+/**
+ * Dispatch arguments to the appropriate final_check function, based upon the
+ * extension's choice of API.
+ */
+void xtables_option_mfcall(struct xtables_match *m)
+{
+ if (m->x6_fcheck != NULL) {
+ struct xt_fcheck_call cb;
+
+ cb.ext_name = m->name;
+ cb.data = m->m->data;
+ cb.xflags = m->mflags;
+ m->x6_fcheck(&cb);
+ } else if (m->final_check != NULL) {
+ m->final_check(m->mflags);
+ }
+ if (m->x6_options != NULL)
+ xtables_options_fcheck(m->name, m->mflags, m->x6_options);
+}