DPDK 22.11.6
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
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
52typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
53
56 char *key;
57 char *value;
58};
59
61struct rte_kvargs {
62 char *str;
63 unsigned count;
65};
66
85struct rte_kvargs *rte_kvargs_parse(const char *args,
86 const char *const valid_keys[]);
87
113struct rte_kvargs *rte_kvargs_parse_delim(const char *args,
114 const char *const valid_keys[],
115 const char *valid_ends);
116
126void rte_kvargs_free(struct rte_kvargs *kvlist);
127
145const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key);
146
170__rte_experimental
171const char *rte_kvargs_get_with_value(const struct rte_kvargs *kvlist,
172 const char *key, const char *value);
173
195int rte_kvargs_process(const struct rte_kvargs *kvlist,
196 const char *key_match, arg_handler_t handler, void *opaque_arg);
197
209unsigned rte_kvargs_count(const struct rte_kvargs *kvlist,
210 const char *key_match);
211
212#ifdef __cplusplus
213}
214#endif
215
216#endif
void rte_kvargs_free(struct rte_kvargs *kvlist)
struct rte_kvargs * rte_kvargs_parse(const char *args, const char *const valid_keys[])
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:31
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:52
__rte_experimental const char * rte_kvargs_get_with_value(const struct rte_kvargs *kvlist, const char *key, const char *value)
void *(* handler)(void *sock_id)
unsigned count
Definition: rte_kvargs.h:63
char * str
Definition: rte_kvargs.h:62
struct rte_kvargs_pair pairs[RTE_KVARGS_MAX]
Definition: rte_kvargs.h:64