summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 3553b43d..39f717ca 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -762,6 +762,24 @@ struct chain *chain_lookup(const struct table *table, const struct handle *h)
return NULL;
}
+struct chain *chain_lookup_fuzzy(const struct handle *h,
+ const struct nft_cache *cache,
+ const struct table **t)
+{
+ struct table *table;
+ struct chain *chain;
+
+ list_for_each_entry(table, &cache->list, list) {
+ list_for_each_entry(chain, &table->chains, list) {
+ if (!strcmp(chain->handle.chain.name, h->chain.name)) {
+ *t = table;
+ return chain;
+ }
+ }
+ }
+ return NULL;
+}
+
const char *family2str(unsigned int family)
{
switch (family) {