yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
GET2 Callback Support

NCX Data Model Get Operation callback handler for virtual data that is not stored in a val_value_t tree. More...

Collaboration diagram for GET2 Callback Support:

Data Structures

struct  getcb_keyval_t
 Key value holder, temp Q of ordered key leaf values used while parsing a path to store the keys until they are all collected. More...
 
struct  getcb_get2_lookup_t
 GET2 lookup struct. More...
 
struct  getcb_get2_select_t
 GET2 select struct. More...
 
struct  getcb_get2_getbulk_t
 GET2 getbulk struct This is only used for YANG list objects to produce N getnext entries at a time. More...
 
struct  getcb_get2_t
 GET2 control block. More...
 

Macros

#define GETCB_GET2_SM_MPID_MALLOCED(G)   (G)->sm_mpid_malloced
 set to TRUE on SIL-SA because the MPID is live set to FALSE on SIL because the MPID is a backptr to a real MP valroot
 

Typedefs

typedef status_t(* getcb_fn_t) (ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
 GET1 Callback function for agent node get handler. More...
 
typedef status_t(* getcb_fn2_t) (ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *get2cb)
 GET2 PRODUCER FUNCTION. More...
 
typedef getcb_walker_status_t(* getcb_get2_walker_fn_t) (getcb_walker_mode_t walker_mode, getcb_get2_t *get2cb, obj_template_t *obj, val_value_t *val, void *cookie)
 GET2 CONSUMER FUNCTION. More...
 

Enumerations

enum  getcb_mode_t {
  GETCB_NONE ,
  GETCB_GET_VALUE ,
  GETCB_GETNEXT_VALUE
}
 get callback retrieval types; only get2 supports getnext More...
 
enum  getcb_walker_mode_t
 get2 walker callback modes

 
enum  getcb_walker_status_t
 get2 walker callback return status values
 

Functions

void getcb_init_get2cb (getcb_get2_t *get2cb)
 Init a GET2 control block. More...
 
getcb_get2_tgetcb_new_get2cb (void)
 Malloc and init a new get2 control block. More...
 
void getcb_free_get2cb (getcb_get2_t *get2cb)
 Clean and free a malloced GET2 control block. More...
 
void getcb_clean_get2cb (getcb_get2_t *get2cb, boolean reuse)
 Clean a get2 control block. More...
 
void getcb_add_return_val (getcb_get2_t *get2cb, val_value_t *val)
 Add a return val to a get2cb return_valQ. More...
 
val_value_tgetcb_find_return_val (getcb_get2_t *get2cb, obj_template_t *obj)
 Find a return val in the get2cb return_valQ. More...
 
val_value_tgetcb_find_return_val2 (getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name)
 Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer. More...
 
val_value_tgetcb_find_return_val_str (getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name, const xmlChar *valstr)
 Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer. More...
 
val_value_tgetcb_find_next_return_val (getcb_get2_t *get2cb, val_value_t *curval)
 Find the next matching return val in the get2cb return_valQ. More...
 
val_value_tgetcb_find_key (getcb_get2_t *get2cb, obj_template_t *obj)
 Find an input keyval in the get2cb keyQ. More...
 
val_value_tgetcb_find_key_str (getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
 Find an input keyval in the get2cb keyQ with a string. More...
 
val_value_tgetcb_find_key_num (getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname, uint32 keynum)
 Find an input keyval in the get2cb keyQ. More...
 
val_value_tgetcb_find_key_lvl (getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname, uint32 objlvl)
 Find an input keyval in the get2cb keyQ. More...
 
val_value_tgetcb_find_match (getcb_get2_t *get2cb, obj_template_t *obj)
 Find an input keyval in the get2cb matchQ. More...
 
void getcb_add_key (getcb_get2_t *get2cb, val_value_t *val)
 Add a keyval to a get2cb keyQ. More...
 
void getcb_add_match (getcb_get2_t *get2cb, val_value_t *val)
 Add a match node to a get2cb matchQ. More...
 
status_t getcb_add_select (getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
 Add a select node to a get2cb matchQ. More...
 
void getcb_add_return_key (getcb_get2_t *get2cb, val_value_t *val)
 Add a return keyval to a get2cb return_keyQ. More...
 
val_value_tgetcb_find_return_key (getcb_get2_t *get2cb, obj_template_t *obj)
 Find a return keyval in the get2cb return_keyQ. More...
 
val_value_tgetcb_find_return_key2 (getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name)
 Find a return keyval in the get2cb return_keyQ Use { NSID, NAME } instead of object pointer. More...
 
void getcb_move_return_keys (getcb_get2_t *get2cb)
 Move the return keys to the keyQ replacing the nodes in the keyQ if already there. More...
 
void getcb_undo_move_return_keys (getcb_get2_t *get2cb)
 Move back the return keys from the keyQ. More...
 
void getcb_clean_return_data (getcb_get2_t *get2cb)
 Clean the return data in the return_val and return_valQ. More...
 
val_value_tgetcb_get2cb_to_request_val (getcb_get2_t *get2cb, obj_template_t *get_request_obj, boolean preserve_data, xml_msg_hdr_t *msg, status_t *res)
 Convert a get2cb struct to a <get-request> value tree. More...
 
getcb_get2_tgetcb_request_val_to_get2cb (val_value_t *get_request_val, boolean preserve_data, status_t *res)
 Convert a <get-request> value tree into a get2cb struct. More...
 
val_value_tgetcb_get2cb_to_response_val (getcb_get2_t *get2cb, obj_template_t *response_obj, boolean preserve_data, status_t *res)
 Convert a get2cb struct to a <get-response> value tree. More...
 
getcb_get2_tgetcb_response_val_to_get2cb (val_value_t *response_val, boolean preserve_data, status_t *res)
 Convert a <get-response> value to a get2cb struct. More...
 
void getcb_add_return_get2cb (getcb_get2_t *get2cb, getcb_get2_t *return_get2cb)
 Add a return get2cb to a get2cb responseQ Used for get-bulk support. More...
 
status_t getcb_move_response_get2cb (getcb_get2_t *response_get2cb, getcb_get2_t *get2cb)
 Move the return fields from the return get2cb to the target get2cb. More...
 
status_t getcb_replace_response_get2cb (getcb_get2_t *response_get2cb, getcb_get2_t *get2cb, boolean replace_mode)
 Move the return fields from the return get2cb to the target get2cb Can clean out old data first. More...
 
status_t getcb_get2_child_obj (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *parentval, getcb_get2_t *parent_get2cb, obj_template_t *obj, boolean with_defaults, getcb_get2_walker_fn_t walkerfn, void *cookie)
 Process the instances of an object for the object itself and 0 or more nest levels of descendant nodes. More...
 
status_t getcb_get2_child_obj_ex (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *parentval, getcb_get2_t *parent_get2cb, obj_template_t *obj, boolean with_defaults, getcb_get2_walker_fn_t walkerfn, void *cookie, getcb_get2_t *force_get2cb, getcb_api_mode_t api_mode)
 Process the instances of an object for the object itself and 0 or more nest levels of descendant nodes Use the get2cb pointer if provided. More...
 
status_t getcb_handle_acmtest (ses_cb_t *scb, xml_msg_hdr_t *msg, val_nodetest_fn_t testfn, getcb_get2_t *get2cb)
 check the access control and testfn callback for a node that would have it skipped because the write_full_check_val function is skipped More...
 
getcb_keyval_tgetcb_new_keyval (const xmlChar *keyval)
 Create a new GET2 keyval holder. More...
 
getcb_keyval_tgetcb_new_keyval2 (val_value_t *keynode, obj_template_t *keyobj, boolean fixed_value)
 Create a new Get2 keyval holder using val backptr. More...
 
getcb_keyval_tgetcb_new_keyval3 (const xmlChar *keyval, obj_template_t *keyobj, boolean fixed_value)
 Create a new Get2 keyval holder using value string. More...
 
void getcb_free_keyval (getcb_keyval_t *keyval)
 Free a GET2 keyval. More...
 
void getcb_clean_keyvalQ (dlq_hdr_t *que)
 Free all the Get2 keyvals from a dlq_hdr. More...
 
getcb_get2_lookup_tgetcb_new_get2_lookup (obj_template_t *obj, dlq_hdr_t *keyvalQ)
 Create a new getcb_get2_lookup struct. More...
 
void getcb_free_get2_lookup (getcb_get2_lookup_t *lookup)
 Free a getcb_get2_lookup struct. More...
 
void getcb_clean_get2_lookupQ (dlq_hdr_t *lookupQ)
 Clean a queue of getcb_get2_lookup_t. More...
 
getcb_get2_lookup_tgetcb_find_get2_lookup (obj_template_t *obj, dlq_hdr_t *lookupQ)
 Find a getcb_get2_lookup struct. More...
 
getcb_get2_select_tgetcb_new_get2_select (const xmlChar *modname, const xmlChar *objname)
 Create a new getcb_select_t struct. More...
 
void getcb_free_get2_select (getcb_get2_select_t *select_node)
 Free a getcb_get2_select struct. More...
 
boolean getcb_find_get2_select (getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
 Find a getcb_get2_select struct. More...
 
void getcb_dump_get2cb (getcb_get2_t *get2cb)
 Print the interesting fields in a get2cb. More...
 
boolean getcb_need_get2 (obj_template_t *curobj, obj_template_t *reqobj)
 check if the node has a get2 callback or in a choice/case subtree that has get2 callback More...
 
boolean getcb_need_get2_ex (obj_template_t *curobj, obj_template_t *reqobj, uint32 *choicecnt, obj_template_t **top_choice)
 check if the node has a get2 callback or in a choice/case subtree that has get2 callback More...
 
obj_template_tgetcb_first_requested_child (getcb_get2_t *get2cb, obj_template_t *parent_obj)
 Check if the specified object has any terminal nodes that need to be returned for a get2 request. More...
 
obj_template_tgetcb_next_requested_child (getcb_get2_t *get2cb, obj_template_t *curchild)
 Check if the specified object has any more terminal nodes that need to be returned for a get2 request. More...
 
status_t getcb_set_active_case (getcb_get2_t *get2cb, const xmlChar *active_case_modname, const xmlChar *active_case)
 Set the active case to the specified object. More...
 
getcb_get2_getbulk_tgetcb_new_get2_getbulk (void)
 Create a new getcb_get2_getbulk struct. More...
 
void getcb_free_get2_getbulk (getcb_get2_getbulk_t *getbulk)
 Free a getcb_get2_getbulk struct. More...
 
status_t getcb_finish_getbulk_entry (getcb_get2_t *get2cb)
 Gather the current response in a getbulk entry and save it in the getcb->getbulkQ; The getcb is ready to start another getcb GETNEXT response after this function is complete. More...
 
status_t getcb_pre_get2_choices (xml_msg_hdr_t *msg, ses_cb_t *scb, getcb_get2_t *parent_get2cb, obj_template_t *targobj, val_value_t *curval, uint32 choice_cnt, obj_template_t *top_choice, boolean *force_remove, getcb_get2_t **ret_get2cb)
 Invoke the get2 callbacks for each of the implied choice-stmt nodes in a subtree or REST resource request. More...
 
void getcb_log_walker (const xmlChar *caller, getcb_walker_mode_t walker_mode, const xmlChar *objname, const xmlChar *valname)
 Print some logging info for a GET2 walker consumer callback. More...
 
status_t getcb_clone_keyQ (dlq_hdr_t *srcQ, dlq_hdr_t *destQ)
 Copy all the key val_value_t structs to the other queue. More...
 
boolean getcb_is_get_exact (getcb_get2_t *get2cb)
 Check if the getcb represents a response that is for a get-exact or a getnext. More...
 
void getcb_clean_responseQ (getcb_get2_t *get2cb)
 Clean the response Q within a get2cb. More...
 
void getcb_add_return_aioQ (getcb_get2_t *get2cb, val_value_t *val)
 Add a return val to a get2cb return_aioQ. More...
 
void getcb_clean_return_aioQ (getcb_get2_t *get2cb)
 Clean the return data return_aioQ. More...
 
boolean getcb_get2_allowed (xml_msg_hdr_t *msg, obj_template_t *chobj)
 Check if the current node and operation are allowed to use the GET2 callback if there is one; Used to keep NMDA and non-NMDA operations separate. More...
 
getcb_get2_tgetcb_new_parent_get2cb (obj_template_t *obj, dlq_hdr_t *keyQ)
 Create a new get2 control block for the parent Used for XGET operation to fill the list's parent get2cb. More...
 
boolean getcb_match_keys_lookup (obj_template_t *useobj, val_value_t *useval, getcb_get2_lookup_t *lookup)
 Match the requested list entry. More...
 
boolean getcb_match_keys_getcb (obj_template_t *useobj, val_value_t *useval, getcb_get2_t *get2cb)
 Match the requested list entry. More...
 
boolean getcb_match_keys_keyQ (obj_template_t *useobj, val_value_t *useval, dlq_hdr_t *srcQ)
 Match the requested list entry. More...
 
status_t getcb_add_return_aio_buff (getcb_get2_t *get2cb, const xmlChar *buffer)
 Add a return buffer to a get2cb control block and set encoding type. More...
 
void getcb_clean_return_aio_buff (getcb_get2_t *get2cb)
 Clean the return AIO buffer, XML or JSON buffer. More...
 
val_value_tgetcb_get2cb_to_val (getcb_get2_t *get2cb, status_t *retres)
 Convert a GET2 CB to the equivalent val_value_t tree only container and list are supported. More...
 

Detailed Description

NCX Data Model Get Operation callback handler for virtual data that is not stored in a val_value_t tree.

These callback functions are used to provide temporary val_value_t structures that MUST BE FREED by the caller after they are used!!!

The <get> callback function has several sub-mode functions to support the retrieval of virtual data, mixed with the real data tree of a configuration database.

    Submode 1: GETCB_GET_METAQ

       Retrieve a Queue header of val_value_t structs
       representing the attributes for the specified value node


    Submode x: GETCB_GET_LEAFVAL

      Retrieve the simple value contents of a virtual value leaf node

Typedef Documentation

◆ getcb_fn2_t

typedef status_t(* getcb_fn2_t) (ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *get2cb)

GET2 PRODUCER FUNCTION.

Callback function for server object handler get2 callback Used to provide main and/or subsystem retrieval of instances of a specific named object

Parameters
scbsession control block making the request
msgincoming XML message header
[in,out]get2cbget2 control block for this callback request
  • return_keyQ is full of any new keys added for this entry – only if 'obj' is a list
  • return_valQ is filled with malloced val_value_t nodes
  • If object tested is a choice the a backptr to a constant string containing the case name that is active
Returns
status NO_ERR if executed OK and found OK
ERR_NCX_NO_INSTANCE warning if no instance found

◆ getcb_fn_t

typedef status_t(* getcb_fn_t) (ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)

GET1 Callback function for agent node get handler.

Parameters
scbsession that issued the get (may be NULL) can be used for access control purposes
cbmodereason for the callback
virvalplace-holder node in the data model for this virtual value node
[out]dstvalpointer to value output struct
*dstval should be filled in, depending on the callback reason
Returns
status

◆ getcb_get2_walker_fn_t

typedef getcb_walker_status_t(* getcb_get2_walker_fn_t) (getcb_walker_mode_t walker_mode, getcb_get2_t *get2cb, obj_template_t *obj, val_value_t *val, void *cookie)

GET2 CONSUMER FUNCTION.

Callback function for get2 walker to process received instances of a specific object

Parameters
walker_modecallback reason
        GETCB_WALK_MODE_START
           start a list or container instance
        GETCB_WALK_MODE_TERMINAL,
           contains a complete terminal node (leaf, leaf-list, anyxml)
        GETCB_WALK_MODE_END
           end a list or container instance
        GETCB_WALK_MODE_1SHOT
           agt_tree callback mode to retrieve entire get2cb in
           1 callback for procesing.  Only 1 level of processing
           is done in 1-shot mode, even if complex child nodes exist
get2cbget2 control block for this callback request from the get2 producer
objtemplate for object being processed
valinstance of the value but only if walker_mode == GETCB_WALK_MODE_TERMINAL
NULL if not used
cookieconsumer cookie given at the start of walk
Returns
walker status value
           GETCB_WALK_STAT_CONTINUE
                to coninue to the next instance or object
            GETCB_WALK_STAT_STOP_OBJECT
                to coninue to the next object
            GETCB_WALK_STAT_STOP_WALK
                to stop the walk completely

Enumeration Type Documentation

◆ getcb_mode_t

get callback retrieval types; only get2 supports getnext

Enumerator
GETCB_NONE 

not set

GETCB_GET_VALUE 

GET request.

GETCB_GETNEXT_VALUE 

GETNEXT request.

Function Documentation

◆ getcb_add_key()

void getcb_add_key ( getcb_get2_t get2cb,
val_value_t val 
)

Add a keyval to a get2cb keyQ.

This is NOT the return key Q! This is not a user API for a GET2 callback

Parameters
get2cbget2 control block to use
valvalue to add
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_add_match()

void getcb_add_match ( getcb_get2_t get2cb,
val_value_t val 
)

Add a match node to a get2cb matchQ.

This is not a user API for a GET2 callback

Parameters
get2cbget2 control block to use
valvalue to add
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_add_return_aio_buff()

status_t getcb_add_return_aio_buff ( getcb_get2_t get2cb,
const xmlChar *  buffer 
)

Add a return buffer to a get2cb control block and set encoding type.

Parameters
get2cbget2 control block to use
bufferbuffer used in the callback
Returns
status
Here is the call graph for this function:

◆ getcb_add_return_aioQ()

void getcb_add_return_aioQ ( getcb_get2_t get2cb,
val_value_t val 
)

Add a return val to a get2cb return_aioQ.

Parameters
get2cbget2 control block to use
valvalue to add
Here is the call graph for this function:

◆ getcb_add_return_get2cb()

void getcb_add_return_get2cb ( getcb_get2_t get2cb,
getcb_get2_t return_get2cb 
)

Add a return get2cb to a get2cb responseQ Used for get-bulk support.

Parameters
get2cbget2 control block to use
return_get2cbget2 control block to add to get2cb
Here is the call graph for this function:

◆ getcb_add_return_key()

void getcb_add_return_key ( getcb_get2_t get2cb,
val_value_t val 
)

Add a return keyval to a get2cb return_keyQ.

This is an important GET2 callback API for a list node The list must add return keys in order to continue the walk through all list entries

Parameters
get2cbget2 control block to use
valvalue to add; pass off memory here
Here is the call graph for this function:

◆ getcb_add_return_val()

void getcb_add_return_val ( getcb_get2_t get2cb,
val_value_t val 
)

Add a return val to a get2cb return_valQ.

Important API needed by GET2 callbacks to add return values

Parameters
get2cbget2 control block to use
valvalue to add; pass off memory; will be cleaned when the get2cb is freed
Here is the call graph for this function:

◆ getcb_add_select()

status_t getcb_add_select ( getcb_get2_t get2cb,
const xmlChar *  modname,
const xmlChar *  objname 
)

Add a select node to a get2cb matchQ.

This is not a user API for a GET2 callback

Parameters
get2cbget2 control block to use
modnamemodule name of the select node
objnameobject name of the select node
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_clean_get2_lookupQ()

void getcb_clean_get2_lookupQ ( dlq_hdr_t *  lookupQ)

Clean a queue of getcb_get2_lookup_t.

Parameters
lookupQqueue of getcb_get2_lookup_t to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_clean_get2cb()

void getcb_clean_get2cb ( getcb_get2_t get2cb,
boolean  reuse 
)

Clean a get2 control block.

Parameters
get2cbget2 control block to clean
reuseTRUE if the get2cb will be reused
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_clean_keyvalQ()

void getcb_clean_keyvalQ ( dlq_hdr_t *  que)

Free all the Get2 keyvals from a dlq_hdr.

Parameters
queQ of getcb_keyval_t to clean
Here is the call graph for this function:

◆ getcb_clean_responseQ()

void getcb_clean_responseQ ( getcb_get2_t get2cb)

Clean the response Q within a get2cb.

Parameters
get2cbget control block to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_clean_return_aio_buff()

void getcb_clean_return_aio_buff ( getcb_get2_t get2cb)

Clean the return AIO buffer, XML or JSON buffer.

Parameters
get2cbget2 control block to use for cleaning
Here is the caller graph for this function:

◆ getcb_clean_return_aioQ()

void getcb_clean_return_aioQ ( getcb_get2_t get2cb)

Clean the return data return_aioQ.

Parameters
get2cbget2 control block to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_clean_return_data()

void getcb_clean_return_data ( getcb_get2_t get2cb)

Clean the return data in the return_val and return_valQ.

Parameters
get2cbget2 control block to clean
Here is the call graph for this function:

◆ getcb_clone_keyQ()

status_t getcb_clone_keyQ ( dlq_hdr_t *  srcQ,
dlq_hdr_t *  destQ 
)

Copy all the key val_value_t structs to the other queue.

Parameters
srcQsource Q of val_value_t
destQdestination Q of val_value_t
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_dump_get2cb()

void getcb_dump_get2cb ( getcb_get2_t get2cb)

Print the interesting fields in a get2cb.

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

◆ getcb_find_get2_lookup()

getcb_get2_lookup_t * getcb_find_get2_lookup ( obj_template_t obj,
dlq_hdr_t *  lookupQ 
)

Find a getcb_get2_lookup struct.

Parameters
objobject to find
lookupQqueue of getcb_get2_lookup_t to search
Returns
malloced struct

◆ getcb_find_get2_select()

boolean getcb_find_get2_select ( getcb_get2_t get2cb,
const xmlChar *  modname,
const xmlChar *  objname 
)

Find a getcb_get2_select struct.

Parameters
get2cbget2 control block to check
modnamemodule name to find
objnameobject name to find
Returns
TRUE if select node found; FALSE if not
Here is the call graph for this function:

◆ getcb_find_key()

val_value_t * getcb_find_key ( getcb_get2_t get2cb,
obj_template_t obj 
)

Find an input keyval in the get2cb keyQ.

Use an object template to search the return value queue

Parameters
get2cbget2 control block to use
objkey object type to find
Returns
pointer to the found key value or NULL if not found
Here is the caller graph for this function:

◆ getcb_find_key_lvl()

val_value_t * getcb_find_key_lvl ( getcb_get2_t get2cb,
const xmlChar *  modname,
const xmlChar *  objname,
uint32  objlvl 
)

Find an input keyval in the get2cb keyQ.

*** USE string parameters and object level number ****

Parameters
get2cbget2 control block to use
modnamemodule name of object to find
objnamename of object type to find
objlvlobject level
Returns
key value pointer or NULL if not found

◆ getcb_find_key_num()

val_value_t * getcb_find_key_num ( getcb_get2_t get2cb,
const xmlChar *  modname,
const xmlChar *  objname,
uint32  keynum 
)

Find an input keyval in the get2cb keyQ.

*** USE string parameters and key number **** Needed because some nested lists can have the same name

Parameters
get2cbget2 control block to use
modnamemodule name of object to find
objnamename of object type to find
keynumkey number [1 .. N]
Returns
pointer to the found key value or NULL if not found

◆ getcb_find_key_str()

val_value_t * getcb_find_key_str ( getcb_get2_t get2cb,
const xmlChar *  modname,
const xmlChar *  objname 
)

Find an input keyval in the get2cb keyQ with a string.

Use the object name string to search the return value queue

Parameters
get2cbget2 control block to use
modnamemodule name of the key object
objnameobject name of the key object
Returns
pointer to the found key value or NULL if not found

◆ getcb_find_match()

val_value_t * getcb_find_match ( getcb_get2_t get2cb,
obj_template_t obj 
)

Find an input keyval in the get2cb matchQ.

Parameters
get2cbget2 control block to use
objobject type to find
Returns
value struct for the match node or NULL if not found

◆ getcb_find_next_return_val()

val_value_t * getcb_find_next_return_val ( getcb_get2_t get2cb,
val_value_t curval 
)

Find the next matching return val in the get2cb return_valQ.

Parameters
get2cbget2 control block to use
curvalcurrent value pointer
Returns
next return value or NULL if none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_find_return_key()

val_value_t * getcb_find_return_key ( getcb_get2_t get2cb,
obj_template_t obj 
)

Find a return keyval in the get2cb return_keyQ.

Parameters
get2cbget2 control block to use
objobject type to find
Returns
value node for this object or NULL if not found
Here is the caller graph for this function:

◆ getcb_find_return_key2()

val_value_t * getcb_find_return_key2 ( getcb_get2_t get2cb,
xmlns_id_t  obj_nsid,
const xmlChar *  obj_name 
)

Find a return keyval in the get2cb return_keyQ Use { NSID, NAME } instead of object pointer.

Parameters
get2cbget2 control block to use
obj_nsidnamespace ID of object to find
obj_namename of object to find
Returns
value node for this return key or NULL if not found

◆ getcb_find_return_val()

val_value_t * getcb_find_return_val ( getcb_get2_t get2cb,
obj_template_t obj 
)

Find a return val in the get2cb return_valQ.

Parameters
get2cbget2 control block to use
objobject type to find

◆ getcb_find_return_val2()

val_value_t * getcb_find_return_val2 ( getcb_get2_t get2cb,
xmlns_id_t  obj_nsid,
const xmlChar *  obj_name 
)

Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer.

Parameters
get2cbget2 control block to use
obj_nsidobject module namespace to find
obj_nameobject local-name to find
Returns
pointer to found value or NULL if not found

◆ getcb_find_return_val_str()

val_value_t * getcb_find_return_val_str ( getcb_get2_t get2cb,
xmlns_id_t  obj_nsid,
const xmlChar *  obj_name,
const xmlChar *  valstr 
)

Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer.

Used in Leaf-list search to find the actual match

Parameters
get2cbget2 control block to use
obj_nsidobject module namespace to find
obj_nameobject local-name to find
valstrvalue encoded as a string
Returns
value pointer or NULL if not found

◆ getcb_finish_getbulk_entry()

status_t getcb_finish_getbulk_entry ( getcb_get2_t get2cb)

Gather the current response in a getbulk entry and save it in the getcb->getbulkQ; The getcb is ready to start another getcb GETNEXT response after this function is complete.

Parameters
[in,out]get2cbGET2 control block to use
  • current response fields moved to a new getcb_get2_getbulk record and added to the get2cb->getbulkQ
Returns
status
Here is the call graph for this function:

◆ getcb_first_requested_child()

obj_template_t * getcb_first_requested_child ( getcb_get2_t get2cb,
obj_template_t parent_obj 
)

Check if the specified object has any terminal nodes that need to be returned for a get2 request.

Return the first one

The get2cb will be examined:

  • boolean flags
  • select-node queue

Any content-match nodes will be returned but no filtering of these objects will be done

Any key leaf nodes will be skipped; Processing of key leafs is done first and is never skipped

Parameters
get2cbget2 control block to use
parent_objtarget object usually the obj from get2cb but could be the active case object for a choice callback
Returns
pointer to first requested child terminal object
NULL if none
Here is the call graph for this function:

◆ getcb_free_get2_getbulk()

void getcb_free_get2_getbulk ( getcb_get2_getbulk_t getbulk)

Free a getcb_get2_getbulk struct.

Parameters
getbulkgetcb getbulk record to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_free_get2_lookup()

void getcb_free_get2_lookup ( getcb_get2_lookup_t lookup)

Free a getcb_get2_lookup struct.

Parameters
lookupgetcb lookup record to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_free_get2_select()

void getcb_free_get2_select ( getcb_get2_select_t select_node)

Free a getcb_get2_select struct.

Parameters
select_nodegetcb select record to free
Here is the caller graph for this function:

◆ getcb_free_get2cb()

void getcb_free_get2cb ( getcb_get2_t get2cb)

Clean and free a malloced GET2 control block.

Parameters
get2cbget2 control block to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_free_keyval()

void getcb_free_keyval ( getcb_keyval_t keyval)

Free a GET2 keyval.

Parameters
keyvalkeyval to free
Here is the caller graph for this function:

◆ getcb_get2_allowed()

boolean getcb_get2_allowed ( xml_msg_hdr_t msg,
obj_template_t chobj 
)

Check if the current node and operation are allowed to use the GET2 callback if there is one; Used to keep NMDA and non-NMDA operations separate.

Parameters
msgxml_msg_hdr in progress
chobjchild object to check
Returns
true if GET2 allowed; false if not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_get2_child_obj()

status_t getcb_get2_child_obj ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t parentval,
getcb_get2_t parent_get2cb,
obj_template_t obj,
boolean  with_defaults,
getcb_get2_walker_fn_t  walkerfn,
void *  cookie 
)

Process the instances of an object for the object itself and 0 or more nest levels of descendant nodes.

Called from xml_wr and other functions that need to access the operational data returned from a GET2 callback

Parameters
scbthe session control block getting the reply
msgthe xml_msg header in use for the response
parentvalthe parent value; ancestor if parent_get2cb used This is usually the last real val_value_t config node before the child GET2 nodes are accessed
parent_get2cbthe get2 control block of the parent when called recursively for nested complex nodes
objthe object template for the value(s) to write
with_defaultsTRUE if the default nodes should be processed
FALSE if default nodes should be skipped
walkerfnget2 walker callback to process value instances
cookiethe opaque parameter block to pass to the walkerfn
Returns
status
Here is the call graph for this function:

◆ getcb_get2_child_obj_ex()

status_t getcb_get2_child_obj_ex ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_value_t parentval,
getcb_get2_t parent_get2cb,
obj_template_t obj,
boolean  with_defaults,
getcb_get2_walker_fn_t  walkerfn,
void *  cookie,
getcb_get2_t force_get2cb,
getcb_api_mode_t  api_mode 
)

Process the instances of an object for the object itself and 0 or more nest levels of descendant nodes Use the get2cb pointer if provided.

The force_get2cb is for an internal API

The API mode used for access to internal procedures in GET2 Normal mode is a GET2 walk. 1-shot is GET-exact for a leafref lookup, etc.

Parameters
scbthe session control block getting the reply
msgthe xml_msg header in use for the response
parentvalthe parent value; ancestor if parent_get2cb used This is usually the last real val_value_t config node before the child GET2 nodes are accessed
parent_get2cbthe get2 control block of the parent when called recursively for nested complex nodes
objthe object template for the value(s) to write
with_defaultsTRUE if the default nodes should be processed
FALSE if default nodes should be skipped
walkerfnget2 walker callback to process value instances
cookiethe opaque parameter block to pass to the walkerfn
force_get2cbpointer to get2 control block to use instead of a private one inside the function call
api_modenormal for XML, JSON walks; 1shot for tree walk
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_get2cb_to_request_val()

val_value_t * getcb_get2cb_to_request_val ( getcb_get2_t get2cb,
obj_template_t get_request_obj,
boolean  preserve_data,
xml_msg_hdr_t msg,
status_t res 
)

Convert a get2cb struct to a <get-request> value tree.

Parameters
get2cbget2 control block to use
get_request_objobject template for <get-request> object
preserve_dataTRUE to preserve the data in get2cb
FALSE if OK to move some data from request to get2cb instead of cloning it
msgmessage header to use
[out]resaddress of return status; *res return status
Returns
Malloced and filled in val_value_t Need to free with val_free_value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_get2cb_to_response_val()

val_value_t * getcb_get2cb_to_response_val ( getcb_get2_t get2cb,
obj_template_t response_obj,
boolean  preserve_data,
status_t res 
)

Convert a get2cb struct to a <get-response> value tree.

Parameters
get2cbget2 control block to convert
response_objobject template for <get-response>
preserve_dataTRUE to preserve the data in get2cb
FALSE if OK to move some data from get2cb instead of cloning it
[out]resaddress of return status; *res return status
Returns
Malloced and filled in val_value_t Need to free with val_free_value
Here is the call graph for this function:

◆ getcb_get2cb_to_val()

val_value_t * getcb_get2cb_to_val ( getcb_get2_t get2cb,
status_t retres 
)

Convert a GET2 CB to the equivalent val_value_t tree only container and list are supported.

Parameters
get2cbGET CB to convert
[out]retresaddress of return status; *retres status
Returns
val_value_t tree (NULL if ERR_INTERNAL_MEM error) MUST BE FREED LATER WITH val_free_value
Here is the call graph for this function:

◆ getcb_handle_acmtest()

status_t getcb_handle_acmtest ( ses_cb_t scb,
xml_msg_hdr_t msg,
val_nodetest_fn_t  testfn,
getcb_get2_t get2cb 
)

check the access control and testfn callback for a node that would have it skipped because the write_full_check_val function is skipped

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
testfncallback function to use, NULL if not used
get2cbget2 control block to use
Returns
status: ERR_NCX_SKIPPED if tests fail; NO_ERR if they pass
Here is the call graph for this function:

◆ getcb_init_get2cb()

void getcb_init_get2cb ( getcb_get2_t get2cb)

Init a GET2 control block.

Parameters
[in,out]get2cbGET2 control block to initialize
get2cb initialized struct use GETCB_GET2_ macros to get and access fields
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_is_get_exact()

boolean getcb_is_get_exact ( getcb_get2_t get2cb)

Check if the getcb represents a response that is for a get-exact or a getnext.

Parameters
get2cbget control block to check
Returns
TRUE if get-exact; FALSE if get-next (or some error)
Here is the call graph for this function:

◆ getcb_log_walker()

void getcb_log_walker ( const xmlChar *  caller,
getcb_walker_mode_t  walker_mode,
const xmlChar *  objname,
const xmlChar *  valname 
)

Print some logging info for a GET2 walker consumer callback.

Parameters
callerfunction name calling
walker_modeenum for callback mode
objnamename of 'obj' parameter or NULL if none
valnamename of 'val' parameter or NULL if none

◆ getcb_match_keys_getcb()

boolean getcb_match_keys_getcb ( obj_template_t useobj,
val_value_t useval,
getcb_get2_t get2cb 
)

Match the requested list entry.

Use val value list node from All in One callback for check and the KeyQ in get2cb.

Parameters
useobjobject to use
usevalval value to match keys with
get2cbget2 control block to use
Returns
TRUE if keys in get2cb matched useval keys; FALSE otherwise
Here is the call graph for this function:

◆ getcb_match_keys_keyQ()

boolean getcb_match_keys_keyQ ( obj_template_t useobj,
val_value_t useval,
dlq_hdr_t *  srcQ 
)

Match the requested list entry.

Use val value list node from All in One callback for check and the Queue of val values.

Parameters
useobjobject to use
usevalval value to match keys with
srcQQueue of val values key entries
Returns
TRUE if keys in scrQ matched useval keys; FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_match_keys_lookup()

boolean getcb_match_keys_lookup ( obj_template_t useobj,
val_value_t useval,
getcb_get2_lookup_t lookup 
)

Match the requested list entry.

Use val value list node from All in One callback for check and the KeyQ.

Parameters
useobjobject to use
usevalval value to match keys with
lookuprecord to use to generate match expression
Returns
TRUE if keys in lookup matched useval keys; FALSE otherwise
Here is the call graph for this function:

◆ getcb_move_response_get2cb()

status_t getcb_move_response_get2cb ( getcb_get2_t response_get2cb,
getcb_get2_t get2cb 
)

Move the return fields from the return get2cb to the target get2cb.

Parameters
response_get2cbget2 control block to move from
get2cbget2 control block to move to
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_move_return_keys()

void getcb_move_return_keys ( getcb_get2_t get2cb)

Move the return keys to the keyQ replacing the nodes in the keyQ if already there.

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

◆ getcb_need_get2()

boolean getcb_need_get2 ( obj_template_t curobj,
obj_template_t reqobj 
)

check if the node has a get2 callback or in a choice/case subtree that has get2 callback

Parameters
curobjceiling object – data parent of 'reqobj'
reqobjtarget object requested that may have get2 cb
Returns
TRUE if get2 applies; FALSE if get2 does not apply
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_need_get2_ex()

boolean getcb_need_get2_ex ( obj_template_t curobj,
obj_template_t reqobj,
uint32 *  choicecnt,
obj_template_t **  top_choice 
)

check if the node has a get2 callback or in a choice/case subtree that has get2 callback

Parameters
curobjceiling object – data parent of 'reqobj'
reqobjtarget object requested that may have get2 cb
[out]choicecntaddress of return choice count
*choicecnt number of implied choices that need to be retrieved
[out]top_choiceaddress of return top_choice
*top_choice topmost choice that needs to be retrieved
Returns
TRUE if get2 applies; FALSE if get2 does not apply
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_new_get2_getbulk()

getcb_get2_getbulk_t * getcb_new_get2_getbulk ( void  )

Create a new getcb_get2_getbulk struct.

Returns
malloced struct
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_new_get2_lookup()

getcb_get2_lookup_t * getcb_new_get2_lookup ( obj_template_t obj,
dlq_hdr_t *  keyvalQ 
)

Create a new getcb_get2_lookup struct.

Parameters
objobject template to save in the lookup
keyvalQQ of getcb_keyval_t to transfer
Returns
malloced struct
Here is the call graph for this function:

◆ getcb_new_get2_select()

getcb_get2_select_t * getcb_new_get2_select ( const xmlChar *  modname,
const xmlChar *  objname 
)

Create a new getcb_select_t struct.

Parameters
modnamemodule name to use
objnameobject name to use
Returns
malloced struct
Here is the caller graph for this function:

◆ getcb_new_get2cb()

getcb_get2_t * getcb_new_get2cb ( void  )

Malloc and init a new get2 control block.

Returns
malloced and initialized struct use GETCB_GET2_ macros to get and access fields
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_new_keyval()

getcb_keyval_t * getcb_new_keyval ( const xmlChar *  keyval)

Create a new GET2 keyval holder.

Parameters
keyvalkey value string
Returns
pointer to initialized keyval, or NULL if malloc error
Here is the call graph for this function:

◆ getcb_new_keyval2()

getcb_keyval_t * getcb_new_keyval2 ( val_value_t keynode,
obj_template_t keyobj,
boolean  fixed_value 
)

Create a new Get2 keyval holder using val backptr.

Parameters
keynodeval_value_t node for key value
keyobjobject template for real object
fixed_valueTRUE if a fixed value for getnext purposes
Returns
pointer to initialized keyval, or NULL if malloc error

◆ getcb_new_keyval3()

getcb_keyval_t * getcb_new_keyval3 ( const xmlChar *  keyval,
obj_template_t keyobj,
boolean  fixed_value 
)

Create a new Get2 keyval holder using value string.

Parameters
keyvalstring prepresentation of key value
keyobjobject template for real object
fixed_valueTRUE if a fixed value for getnext purposes
Returns
pointer to initialized keyval, or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_new_parent_get2cb()

getcb_get2_t * getcb_new_parent_get2cb ( obj_template_t obj,
dlq_hdr_t *  keyQ 
)

Create a new get2 control block for the parent Used for XGET operation to fill the list's parent get2cb.

Parameters
objobject type to use
keyQQ of keys to transfer
Returns
getcb_get2_t parent get2 control block
Here is the call graph for this function:

◆ getcb_next_requested_child()

obj_template_t * getcb_next_requested_child ( getcb_get2_t get2cb,
obj_template_t curchild 
)

Check if the specified object has any more terminal nodes that need to be returned for a get2 request.

Return the next one

The get2cb will be examined:

  • boolean flags
  • select-node queue

Any content-match nodes will be returned but no filtering of these objects will be done

Any key leaf nodes will be skipped; Processing of key leafs is done first and is never skipped

Parameters
get2cbget2 control block to use
curchildcurrent child; start search with next sibling
Returns
pointer to next requested child terminal object
NULL if none
Here is the call graph for this function:

◆ getcb_pre_get2_choices()

status_t getcb_pre_get2_choices ( xml_msg_hdr_t msg,
ses_cb_t scb,
getcb_get2_t parent_get2cb,
obj_template_t targobj,
val_value_t curval,
uint32  choice_cnt,
obj_template_t top_choice,
boolean *  force_remove,
getcb_get2_t **  ret_get2cb 
)

Invoke the get2 callbacks for each of the implied choice-stmt nodes in a subtree or REST resource request.

These requests will only specify data nodes The choice-stmt and case-stmt are considered schema nodes and not data nodes

Parameters
msgincoming or outgoing message header in progress
scbsession control block
NULL if no read access control is desired
parent_get2cbget2 control block for parent get2 object
targobjobject template for the real object that is 'being retrieved after the choices. Needed to check if the proper case is active
curvalcurrent database node of the parent or ancestor of the object being retrieved
choice_cntnumber of choices found
top_choicepointer to first choice to process
[out]force_removeaddress of return force_remove flag
*force_remove TRUE if the object template for a content match node was missing or if the callback returned any error for the content-match node
FALSE if all content match nodes were OK
[out]ret_get2cbaddress of return get2cb of final choice
*ret_get2cb is set to the get2 control block allocated for the final choice retrieved; may have terminal nodes in it
Returns
status: NO_ERR, ERR_NCX_NO_INSTANCE, some error
Here is the call graph for this function:

◆ getcb_replace_response_get2cb()

status_t getcb_replace_response_get2cb ( getcb_get2_t response_get2cb,
getcb_get2_t get2cb,
boolean  replace_mode 
)

Move the return fields from the return get2cb to the target get2cb Can clean out old data first.

Parameters
response_get2cbget2 control block to move from
get2cbget2 control block to move to
replace_modeTRUE to clean out old data first; FALSE if assumed get2cb return data is empty
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getcb_request_val_to_get2cb()

getcb_get2_t * getcb_request_val_to_get2cb ( val_value_t get_request_val,
boolean  preserve_data,
status_t res 
)

Convert a <get-request> value tree into a get2cb struct.

Parameters
get_request_valvalue tree to convert
preserve_dataTRUE to preserve the data in get_request_val
FALSE if OK to move some data from request to get2cb instead of cloning it
[out]resaddress of return status; *res return status
Returns
Malloced and filled in getcb_get2_t. Need to free with getcb_free_get2cb
Here is the call graph for this function:

◆ getcb_response_val_to_get2cb()

getcb_get2_t * getcb_response_val_to_get2cb ( val_value_t response_val,
boolean  preserve_data,
status_t res 
)

Convert a <get-response> value to a get2cb struct.

Parameters
response_val= response structure to convert
preserve_dataTRUE to preserve the data in get_request_val
FALSE if OK to move some data from request to get2cb instead of cloning it
[out]resaddress of return status; *res return status
Returns
Malloced and filled in getcb_get2_t. Need to free with getcb_free_get2cb
Here is the call graph for this function:

◆ getcb_set_active_case()

status_t getcb_set_active_case ( getcb_get2_t get2cb,
const xmlChar *  active_case_modname,
const xmlChar *  active_case 
)

Set the active case to the specified object.

Parameters
get2cbget2 control block to use
active_case_modnamemodule name to set
active_casecase name to set
Returns
status
Here is the call graph for this function:

◆ getcb_undo_move_return_keys()

void getcb_undo_move_return_keys ( getcb_get2_t get2cb)

Move back the return keys from the keyQ.

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