DPDK  18.05.1
rte_kvargs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2013 Intel Corporation.
3  * Copyright(c) 2014 6WIND S.A.
4  */
5 
6 #ifndef _RTE_KVARGS_H_
7 #define _RTE_KVARGS_H_
8 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
29 #define RTE_KVARGS_MAX 32
30 
32 #define RTE_KVARGS_PAIRS_DELIM ","
33 
35 #define RTE_KVARGS_KV_DELIM "="
36 
38 typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
39 
42  char *key;
43  char *value;
44 };
45 
47 struct rte_kvargs {
48  char *str;
49  unsigned count;
51 };
52 
71 struct rte_kvargs *rte_kvargs_parse(const char *args,
72  const char *const valid_keys[]);
73 
83 void rte_kvargs_free(struct rte_kvargs *kvlist);
84 
107 int rte_kvargs_process(const struct rte_kvargs *kvlist,
108  const char *key_match, arg_handler_t handler, void *opaque_arg);
109 
121 unsigned rte_kvargs_count(const struct rte_kvargs *kvlist,
122  const char *key_match);
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif