DPDK 25.03.0-rc0
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
25extern "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
50typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
51
54 char *key;
55 char *value;
56};
57
59struct rte_kvargs {
60 char *str;
61 unsigned count;
63};
64
83struct rte_kvargs *rte_kvargs_parse(const char *args,
84 const char *const valid_keys[]);
85
111struct rte_kvargs *rte_kvargs_parse_delim(const char *args,
112 const char *const valid_keys[],
113 const char *valid_ends);
114
124void rte_kvargs_free(struct rte_kvargs *kvlist);
125
143const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key);
144
165const char *rte_kvargs_get_with_value(const struct rte_kvargs *kvlist,
166 const char *key, const char *value);
167
192int rte_kvargs_process(const struct rte_kvargs *kvlist,
193 const char *key_match, arg_handler_t handler, void *opaque_arg);
194
216int rte_kvargs_process_opt(const struct rte_kvargs *kvlist,
217 const char *key_match, arg_handler_t handler, void *opaque_arg);
218
230unsigned rte_kvargs_count(const struct rte_kvargs *kvlist,
231 const char *key_match);
232
233#ifdef __cplusplus
234}
235#endif
236
237#endif
void rte_kvargs_free(struct rte_kvargs *kvlist)
struct rte_kvargs * rte_kvargs_parse(const char *args, const char *const valid_keys[])
const char * rte_kvargs_get_with_value(const struct rte_kvargs *kvlist, const char *key, const char *value)
int rte_kvargs_process_opt(const struct rte_kvargs *kvlist, const char *key_match, arg_handler_t handler, void *opaque_arg)
unsigned rte_kvargs_count(const struct rte_kvargs *kvlist, const char *key_match)
const char * rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key)
int rte_kvargs_process(const struct rte_kvargs *kvlist, const char *key_match, arg_handler_t handler, void *opaque_arg)
#define RTE_KVARGS_MAX
Definition: rte_kvargs.h:29
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:50
void *(* handler)(void *sock_id)
unsigned count
Definition: rte_kvargs.h:61
char * str
Definition: rte_kvargs.h:60
struct rte_kvargs_pair pairs[RTE_KVARGS_MAX]
Definition: rte_kvargs.h:62