summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-03-06 16:24:43 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-04-13 18:09:26 +0200
commit2e0ec4fa0fb5162c441cd666f55fe76777e40d5e (patch)
tree647f436d6d5c2a8fc9c0656c27fc3afe043b8c75 /include
parent1e6c1ee1bf2822d5fdf61725148700a410fb8b86 (diff)
libxtables: linked-list name<->id map
This consolidates the maps from libxt_devgroup and libxt_realm. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'include')
-rw-r--r--include/xtables.h.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/xtables.h.in b/include/xtables.h.in
index c361bdbd..30d9e73b 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -134,6 +134,16 @@ struct xt_fcheck_call {
unsigned int xflags;
};
+/**
+ * A "linear"/linked-list based name<->id map, for files similar to
+ * /etc/iproute2/.
+ */
+struct xtables_lmap {
+ char *name;
+ int id;
+ struct xtables_lmap *next;
+};
+
/* Include file for additions: new matches and targets. */
struct xtables_match
{
@@ -418,6 +428,11 @@ extern void xtables_option_mfcall(struct xtables_match *);
extern void xtables_options_fcheck(const char *, unsigned int,
const struct xt_option_entry *);
+extern struct xtables_lmap *xtables_lmap_init(const char *);
+extern void xtables_lmap_free(struct xtables_lmap *);
+extern int xtables_lmap_name2id(const struct xtables_lmap *, const char *);
+extern const char *xtables_lmap_id2name(const struct xtables_lmap *, int);
+
#ifdef XTABLES_INTERNAL
/* Shipped modules rely on this... */