#include <netinet/in.h>
#include <cne_common.h>
Go to the source code of this file.
|
CNDP_API struct cli_map * | cli_mapping (struct cli_map *maps, int argc, char **argv) |
|
CNDP_API void | cli_map_show (struct cli_map *m) |
|
CNDP_API void | cli_maps_show (struct cli_map *maps, int argc, char **argv) |
|
CNDP_API void | cli_map_dump (struct cli_map *maps, int argc, char **argv) |
|
CNDP_API int | cli_map_list_search (const char *fmt, char *item, int index) |
|
String-related functions as replacement for libc equivalents
Definition in file cli_map.h.
◆ cli_mapping()
CNDP_API struct cli_map* cli_mapping |
( |
struct cli_map * |
maps, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Parse a string argv
looking for matching mapping.
- Parameters
-
maps | Array string points with mapping formats using a special % formats d - decimal number 32bit D - decimal number 64bit h - hexadecimal number 32 bit number H - hexadecimal number 64 bit number P - Portlist C - Corelist s - string m - MAC address format %4 - IPv4 address %6 - IPv6 address k - kvargs list of <key>=<value>[,...] strings l - list format, if constains space then quote the string first %|<fixed-list> - Fixed list of valid strings |
argc | Number of arguments in argv |
argv | Array of command line string pointers |
- Returns
- return pointer map entry or NULL if not found
◆ cli_map_show()
CNDP_API void cli_map_show |
( |
struct cli_map * |
m | ) |
|
Dump out the map entry
- Parameters
-
m | The cli_map structure pointer |
- Returns
- None
◆ cli_maps_show()
CNDP_API void cli_maps_show |
( |
struct cli_map * |
maps, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Show the map table entries
- Parameters
-
maps | The cli_map structure pointer |
argc | Number of arguments in argv |
argv | Array of command line string pointers |
- Returns
- None
◆ cli_map_dump()
CNDP_API void cli_map_dump |
( |
struct cli_map * |
maps, |
|
|
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Dump out the map table entry matching the argc/argv
- Parameters
-
maps | The cli_map structure pointer |
argc | Number of argumemts |
argv | List of argument strings |
- Returns
- None
◆ cli_map_list_search()
CNDP_API int cli_map_list_search |
( |
const char * |
fmt, |
|
|
char * |
item, |
|
|
int |
index |
|
) |
| |
Determine index value for the list item
- Parameters
-
fmt | cli_map format string |
item | pointer to the item to search for in the list. |
index | value for which list in format string to scan |
- Returns
- -1 on error or index into list selections.