yumapro  23.10T-5
YumaPro SDK
Loading...
Searching...
No Matches
List Key Map for GETNEXT Support

Key Map provides a YANG row cache to automate the processing of GET2 callback parameters to setup the next entry. More...

Collaboration diagram for List Key Map for GETNEXT Support:

Functions

keymap_set_tkeymap_new_set (obj_template_t *listobj, uint32 anckey_cnt, status_t *res)
 create a new keymap set More...
 
void keymap_free_set (keymap_set_t *mapset)
 free a keymap set More...
 
keymap_map_tkeymap_new_map (keymap_set_t *mapset, void *cookie, status_t *res,...)
 create a new keymap More...
 
void keymap_free_map (keymap_set_t *mapset, keymap_map_t *cb)
 free a keymap More...
 
keymap_map_tkeymap_get_map (keymap_set_t *mapset,...)
 retrieve an existing keymap from its ancestor keys More...
 
status_t keymap_add_row (keymap_map_t *cb, void *cookie,...)
 create a new row in a keymap More...
 
status_t keymap_remove_row (keymap_map_t *cb,...)
 remove and delete a row in a keymap More...
 
void keymap_dump_map (keymap_map_t *cb)
 debug dump a keymap More...
 
status_t keymap_get_return_keys (keymap_map_t *cb, boolean getnext, boolean *islast, void **cookie, dlq_hdr_t *keyQ,...)
 get the return keys for the GET or GETNEXT request More...
 

Detailed Description

Key Map provides a YANG row cache to automate the processing of GET2 callback parameters to setup the next entry.

Function Documentation

◆ keymap_add_row()

status_t keymap_add_row ( keymap_map_t cb,
void *  cookie,
  ... 
)

create a new row in a keymap

Data added to cb; Must be freed with keymap_free_map Each parameter after 'cookie' is a pointer to an xmlString. There must be the exact number of strings for the list The program may crash if there are not enough strings to match the list definition

Parameters
cbkeymap control block to use
cookie== optional cookie to store with the row
Returns
return status
  • ERR_INTERNAL_MEM there is not enough memory
  • ERR_NCX_INVALID_VALUE the object is not a list or no keys
  • ERR_NCX_MISSING_PARM if listobj parameter is missing
Here is the call graph for this function:

◆ keymap_dump_map()

void keymap_dump_map ( keymap_map_t cb)

debug dump a keymap

log-level=debug is required or nothing will be printed

Parameters
cbkeymap control block to use
Here is the call graph for this function:

◆ keymap_free_map()

void keymap_free_map ( keymap_set_t mapset,
keymap_map_t cb 
)

free a keymap

Parameters
mapsettop map set containing the CB, NULL if none
  • cb will be removed from this mapset first if non-NULL
cbkeymap control block to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keymap_free_set()

void keymap_free_set ( keymap_set_t mapset)

free a keymap set

The function will simply return if 'mapset' is NULL.

Parameters
mapsetkeymap set to free
See also
keymap_new_set
Here is the call graph for this function:

◆ keymap_get_map()

keymap_map_t * keymap_get_map ( keymap_set_t mapset,
  ... 
)

retrieve an existing keymap from its ancestor keys

The variable parameters represent the ancestor keys to match. If no ancestor keys then retrieve the one keymap allowed

Parameters
mapsetobject to use to find the key map
Returns
the found map set or NULL if not found
Here is the call graph for this function:

◆ keymap_get_return_keys()

status_t keymap_get_return_keys ( keymap_map_t cb,
boolean  getnext,
boolean *  islast,
void **  cookie,
dlq_hdr_t *  keyQ,
  ... 
)

get the return keys for the GET or GETNEXT request

Process the key information for the request and produce a queue of val_value_t structs representing the return keys. Handle the missing and fixed key properties for each key

For each key, there are 2 parameters passed in order

  • value string : key value or NULL for not present
  • fixed : TRUE for fixed key or FALSE for increment allowed There must be exactly the number of pairs to match the number of key leafs defined for the list object
Parameters
cbkeymap control block to use
getnextTRUE for a GETNEXT request; FALSE for GET
[out]islastTRUE if returning the last entry; FALSE otherwise
  • NULL to skip retrieval of this flag
[out]cookiethe cookie found for the found row
  • This is only set if the return value is NO_ERR
  • Set to NULL to ignore the cookie and not retrieve it
[out]keyQQueue of val_value_t to store the return keys
  • This queue must be cleaned. e.g., use val_clean_valQ
  • There may be partial results in this queue if error
  • For getcb, use GETCB_GET2_RETURN_KEYQ(get2cb)
Returns
return status
  • ERR_INTERNAL_MEM there is not enough memory during processing
  • ERR_NCX_NO_INSTANCE if no return row found
Here is the call graph for this function:

◆ keymap_new_map()

keymap_map_t * keymap_new_map ( keymap_set_t mapset,
void *  cookie,
status_t res,
  ... 
)

create a new keymap

Must be freed with keymap_free_map

Each variable parameter represents an ancestor key. To match all entries for a specific ancestor key, provide a NULL pointer. Otherwise provide a pointer to a string. This is the exact value that much match the (converted) string value of the ancestor key.

Parameters
mapsetobject to use for the key map
cookiepointer to save with the keymap
  • use KEYMAP_MAP_COOKIE macro to access this field
[out]resreturn status
  • ERR_INTERNAL_MEM there is not enough memory
  • ERR_NCX_INVALID_VALUE the object is not a list or no keys
  • ERR_NCX_MISSING_PARM if listobj parameter is missing
Returns
malloced keymap for the specified object
NULL if *res == some error
Here is the call graph for this function:

◆ keymap_new_set()

keymap_set_t * keymap_new_set ( obj_template_t listobj,
uint32  anckey_cnt,
status_t res 
)

create a new keymap set

Must be freed with keymap_free_set

Parameters
listobjobject to use for the key map
anckey_cntnumber of ancestor keys for this keymap set
[out]resreturn status
  • ERR_INTERNAL_MEM there is not enough memory
  • ERR_NCX_INVALID_VALUE the object is not a list or no keys
  • ERR_NCX_MISSING_PARM if listobj parameter is missing
Returns
malloced keymap set for the specified object
  • NULL if *res == some error
  • Must call 'keymap_free_set' if not-NULL value returned
Here is the call graph for this function:

◆ keymap_remove_row()

status_t keymap_remove_row ( keymap_map_t cb,
  ... 
)

remove and delete a row in a keymap

Each parameter after 'cb' is a pointer to a string. There must be the exact number of strings for the list The program may crash if there are not enough strings to match the list definition.

Parameters
cbkeymap control block to use
Returns
return status
  • ERR_NCX_NOT_FOUND if entry was not found
Here is the call graph for this function: