free(kvlist);
}
+/* Lookup a value in an rte_kvargs list by its key. */
+const char *
+rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key)
+{
+ unsigned int i;
+
+ if (kvlist == NULL || key == NULL)
+ return NULL;
+ for (i = 0; i < kvlist->count; ++i) {
+ if (strcmp(kvlist->pairs[i].key, key) == 0)
+ return kvlist->pairs[i].value;
+ }
+ return NULL;
+}
+
/*
* Parse the arguments "key=value,key=value,..." string and return
* an allocated structure that contains a key/value list. Also
*/
void rte_kvargs_free(struct rte_kvargs *kvlist);
+/**
+ * Get the value associated with a given key.
+ *
+ * If multiple key matches, the value of the first one is returned.
+ *
+ * The memory returned is allocated as part of the rte_kvargs structure,
+ * it must never be modified.
+ *
+ * @param kvlist
+ * A list of rte_kvargs pair of 'key=value'.
+ * @param key
+ * The matching key.
+
+ * @return
+ * NULL if no key matches the input,
+ * a value associated with a matching key otherwise.
+ */
+__rte_experimental
+const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key);
+
/**
* Call a handler function for each key/value matching the key
*