|
CNDP 22.08.0
|
#include <sys/queue.h>#include <pthread.h>#include <json-c/json_object.h>#include <json-c/json_tokener.h>#include <json-c/json_util.h>#include <json-c/json_visit.h>#include <json-c/linkhash.h>#include <stddef.h>#include <stdint.h>#include "jcfg.h"Go to the source code of this file.
Functions | |
| int | jcfg_list_add (jcfg_list_t *lst, void *obj) |
| int | _decode_defaults (struct json_object *obj, int flags, struct json_object *parent, const char *key, size_t *index, void *arg) |
| int | jcfg_decode_lport_groups_end (jcfg_info_t *jinfo, void *arg) |
| int | __decoder_val_get (obj_value_t *val, uint64_t *v) |
| int | __decoder_array_val_get (obj_value_t *val, obj_value_t **arr) |
| int | __decode_object (obj_value_t *val, struct json_object *obj, enum json_type type) |
The internal decode APIs and defines for JCFG.
Definition in file jcfg_decode.h.
| int jcfg_list_add | ( | jcfg_list_t * | lst, |
| void * | obj ) |
Add an object pointer to a jcfg_list_t structure
The jcfg_list_t.list array uses realloc() to grow the list as needed.
| lst | The pointer to a jcfg_list_ structure |
| obj | The object pointer to add to the list array. |
| int _decode_defaults | ( | struct json_object * | obj, |
| int | flags, | ||
| struct json_object * | parent, | ||
| const char * | key, | ||
| size_t * | index, | ||
| void * | arg ) |
Decode the default,umem,lport, ... sections in the JSON file (private or internal)
These are private functions and each supports the different sections in the JSON file format.
| obj | The json object to decode from JSON object |
| flags | The flags used by the JSON-C parser |
| parent | The JSON-C parent of this object. |
| key | The pointer to the key value of the JSON object |
| index | The new index value returned from JSON parsing to be placed in this index pointer location |
| arg | The user supplied argument to be passed to the callback routines |
| int jcfg_decode_lport_groups_end | ( | jcfg_info_t * | jinfo, |
| void * | arg ) |
Finish lport_group decoding after all sections have been decoded
This function creates logical ports and assigns them to threads, which can only be done after all other sections have been decoded.
| jinfo | The jcfg information structure pointer |
| arg | The user supplied argument (currently unused) |
| int __decoder_val_get | ( | obj_value_t * | val, |
| uint64_t * | v ) |
Decoder value get routine for scalar object.
| val | The obj_value_t pointer to extract the value into 'v' return pointer. |
| v | The location to put the returned object value. |
| int __decoder_array_val_get | ( | obj_value_t * | val, |
| obj_value_t ** | arr ) |
Decoder value get routine for array object.
| val | The obj_value_t pointer to extract the values into 'arr' return pointer. |
| arr | The location to put the array of returned object values. |
| int __decode_object | ( | obj_value_t * | val, |
| struct json_object * | obj, | ||
| enum json_type | type ) |
Decode a common object given its type and value.
| val | The object value pointer to decode the object from JSON to JCFG |
| obj | The JSON object to decode |
| type | The type of JSON object to decode |