yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
keymap.h File Reference

YANG List Key Map APIs. More...

#include "dlq.h"
#include "obj.h"
#include "status_enum.h"
Include dependency graph for keymap.h:

Go to the source code of this file.

Data Structures

struct  keymap_set_t
 one set of keymaps contains all row entries for one list object Used by SIL or SIL-SA code to cache list entries or just keys so GET2 return key processing can be automated More...
 
struct  keymap_map_t
 one keymap contains all row entries for one list object Used by SIL or SIL-SA code to cache list entries or just keys so GET2 return key processing can be automated More...
 

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

YANG List Key Map APIs.

Top Level: keymap_mapset_t

  • Use keymap_new_set to create a mapset for a list object
  • Set of keymaps for one YANG list object
  • Stores a cookie with each map
  • At least one mapset is required
  • There can be one map for each set of ancestor key values
  • Wildcards are allowed for each ancestor key
    • The key will match any value used for that ancestor key

Map Level: keymap_map_t

  • Use keymap_new_map to create a map for some ancestor keys
  • Stores key leaf tuples as rows
  • Stores a cookie with each row
  • There will only be one entry allowed if there are no ancestor keys.

Key Level: keymap_key_t (internal)

  • Used to Process GET callback parameters to produce the return keys for a GET2 callback
  • Ancestor keys are always present
  • For each list key there will be 3 values
    • k_prefix_leafname (k_my8_A) is the value of the leaf only if leafname_present (A_fixed) is true
    • leafname_fixed: TRUE if the key is a fixed leaf The value is not allowed to change for this key leaf. Only entries matching the supplied value are expected for this leaf. Only interesting if the list has multiple keys defined.

Translate GET2 parms to keymap

  • If A_present == FALSE then the key string must be NULL
  • If A_present == TRUE then the key string must be set. The value must be converted to an xmlChar string if it is not already a string.
  • Suggest using val_make_sprintf_string to convert a value to the proper string
  • The leafname_fixed parameter is passed directly