summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/xtables.h.in2
-rw-r--r--xtables.c14
2 files changed, 16 insertions, 0 deletions
diff --git a/include/xtables.h.in b/include/xtables.h.in
index 037fae19..222e2a9f 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -233,7 +233,9 @@ extern struct xtables_target *xtables_find_target(const char *name,
/* Your shared library should call one of these. */
extern void xtables_register_match(struct xtables_match *me);
+extern void xtables_register_matches(struct xtables_match *, unsigned int);
extern void xtables_register_target(struct xtables_target *me);
+extern void xtables_register_targets(struct xtables_target *, unsigned int);
extern bool xtables_strtoul(const char *, char **, unsigned long *,
unsigned long, unsigned long);
diff --git a/xtables.c b/xtables.c
index 05154dd8..1ff6e82b 100644
--- a/xtables.c
+++ b/xtables.c
@@ -794,6 +794,13 @@ void xtables_register_match(struct xtables_match *me)
me->mflags = 0;
}
+void xtables_register_matches(struct xtables_match *match, unsigned int n)
+{
+ do {
+ xtables_register_match(&match[--n]);
+ } while (n > 0);
+}
+
void xtables_register_target(struct xtables_target *me)
{
struct xtables_target *old;
@@ -868,6 +875,13 @@ void xtables_register_target(struct xtables_target *me)
me->tflags = 0;
}
+void xtables_register_targets(struct xtables_target *target, unsigned int n)
+{
+ do {
+ xtables_register_target(&target[--n]);
+ } while (n > 0);
+}
+
/**
* xtables_param_act - act on condition
* @status: a constant from enum xtables_exittype