DPDK  21.08.0
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 
28 #include <rte_compat.h>
29 
31 #define RTE_KVARGS_MAX 32
32 
34 #define RTE_KVARGS_PAIRS_DELIM ","
35 
37 #define RTE_KVARGS_KV_DELIM "="
38 
40 typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
41 
44  char *key;
45  char *value;
46 };
47 
49 struct rte_kvargs {
50  char *str;
51  unsigned count;
53 };
54 
73 struct rte_kvargs *rte_kvargs_parse(const char *args,
74  const char *const valid_keys[]);
75 
101 __rte_experimental
102 struct rte_kvargs *rte_kvargs_parse_delim(const char *args,
103  const char *const valid_keys[],
104  const char *valid_ends);
105 
115 void rte_kvargs_free(struct rte_kvargs *kvlist);
116 
134 __rte_experimental
135 const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key);
136 
158 int rte_kvargs_process(const struct rte_kvargs *kvlist,
159  const char *key_match, arg_handler_t handler, void *opaque_arg);
160 
172 unsigned rte_kvargs_count(const struct rte_kvargs *kvlist,
173  const char *key_match);
174 
198 __rte_experimental
199 int rte_kvargs_strcmp(const char *key, const char *value, void *opaque);
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif
#define RTE_KVARGS_MAX
Definition: rte_kvargs.h:31
void *(* handler)(void *sock_id)
unsigned count
Definition: rte_kvargs.h:51
__rte_experimental const char * rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key)
void rte_kvargs_free(struct rte_kvargs *kvlist)
unsigned rte_kvargs_count(const struct rte_kvargs *kvlist, const char *key_match)
__rte_experimental struct rte_kvargs * rte_kvargs_parse_delim(const char *args, const char *const valid_keys[], const char *valid_ends)
int(* arg_handler_t)(const char *key, const char *value, void *opaque)
Definition: rte_kvargs.h:40
char * str
Definition: rte_kvargs.h:50
struct rte_kvargs * rte_kvargs_parse(const char *args, const char *const valid_keys[])
int rte_kvargs_process(const struct rte_kvargs *kvlist, const char *key_match, arg_handler_t handler, void *opaque_arg)
__rte_experimental int rte_kvargs_strcmp(const char *key, const char *value, void *opaque)