summaryrefslogtreecommitdiff
path: root/lib/meta-flow.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/meta-flow.c')
-rw-r--r--lib/meta-flow.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index e25adec1c..6fc8ff98f 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -80,6 +80,17 @@ mf_from_name(const char *name)
return shash_find_data(&mf_by_name, name);
}
+/* Returns the field with the given 'name' (which is 'len' bytes long), or a
+ * null pointer if no field has that name. */
+const struct mf_field *
+mf_from_name_len(const char *name, size_t len)
+{
+ nxm_init();
+
+ struct shash_node *node = shash_find_len(&mf_by_name, name, len);
+ return node ? node->data : NULL;
+}
+
static void
nxm_do_init(void)
{