yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
External Statement (ncx_appinfo_t)

NCX appinfo is used to store YANG external statements. More...

Collaboration diagram for External Statement (ncx_appinfo_t):

Functions

ncx_appinfo_tncx_new_appinfo (boolean isclone)
 Create an appinfo entry. More...
 
void ncx_free_appinfo (ncx_appinfo_t *appinfo)
 Free an appinfo entry. More...
 
ncx_appinfo_tncx_find_appinfo (dlq_hdr_t *appinfoQ, const xmlChar *prefix, const xmlChar *varname)
 Find an appinfo entry by name (First match is returned) The entry returned is not removed from the Q. More...
 
const ncx_appinfo_tncx_find_const_appinfo (const dlq_hdr_t *appinfoQ, const xmlChar *prefix, const xmlChar *varname)
 Find an appinfo entry by name (First match is returned) The entry returned is not removed from the Q (CONST version) More...
 
const ncx_appinfo_tncx_find_next_appinfo (const ncx_appinfo_t *current, const xmlChar *prefix, const xmlChar *varname)
 Find the next instance of an appinfo entry by name (First match is returned) The entry returned is not removed from the Q. More...
 
ncx_appinfo_tncx_find_next_appinfo2 (ncx_appinfo_t *current, const xmlChar *prefix, const xmlChar *varname)
 Find the next instance of an appinfo entry by name (First match is returned, not const version) The entry returned is not removed from the Q. More...
 
ncx_appinfo_tncx_clone_appinfo (ncx_appinfo_t *appinfo)
 Clone an appinfo value. More...
 
void ncx_clean_appinfoQ (dlq_hdr_t *appinfoQ)
 Check an initialized appinfoQ for any entries Remove them from the queue and delete them. More...
 
status_t ncx_consume_appinfo (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
 Check if an appinfo clause is present. More...
 
status_t ncx_consume_top_appinfo (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ, boolean struct_ok)
 Check if an appinfo clause is present Called from the body_stmt handler Only top-level extension handlers are allowed to take over the consume_appinfo phase. More...
 
status_t ncx_consume_appinfo2 (tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ, boolean plain_ok)
 Check if an appinfo clause is present Do not backup the current token The TK_TT_MSTRING token has not been seen yet Called from yang_consume_semiapp. More...
 
status_t ncx_resolve_appinfoQ (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ)
 Validate all the appinfo clauses present in the specified Q. More...
 
status_t ncx_resolve_appinfoQ_ex (yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, dlq_hdr_t *appinfoQ, ncx_node_t node_type, void *node)
 Validate all the appinfo clauses present in the specified Q. More...
 
const xmlChar * ncx_get_appinfo_value (const ncx_appinfo_t *appinfo)
 Get the value string from an appinfo struct. More...
 

Detailed Description

NCX appinfo is used to store YANG external statements.

The YANG syntax for external statements is fully supported. Almost every YANG construct stores its own local appinfo so server code can test properties from annotations.

Function Documentation

◆ ncx_clean_appinfoQ()

void ncx_clean_appinfoQ ( dlq_hdr_t *  appinfoQ)

Check an initialized appinfoQ for any entries Remove them from the queue and delete them.

Parameters
appinfoQQ of ncx_appinfo_t data structures to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_clone_appinfo()

ncx_appinfo_t * ncx_clone_appinfo ( ncx_appinfo_t appinfo)

Clone an appinfo value.

Parameters
appinfoncx_appinfo_t data structure to clone
Returns
pointer to the malloced ncx_appinfo_t struct clone of appinfo
NULL if a malloc error
Here is the call graph for this function:

◆ ncx_consume_appinfo()

status_t ncx_consume_appinfo ( tk_chain_t tkc,
ncx_module_t mod,
dlq_hdr_t *  appinfoQ 
)

Check if an appinfo clause is present.

Save in appinfoQ if non-NULL

Error messages are printed by this function!! Do not duplicate error messages upon error return

Parameters
tkctoken chain to use
modncx_module_t in progress (NULL if none)
appinfoQqueue to use for any found entries (may be NULL)
Returns
status of the operation
Here is the caller graph for this function:

◆ ncx_consume_appinfo2()

status_t ncx_consume_appinfo2 ( tk_chain_t tkc,
ncx_module_t mod,
dlq_hdr_t *  appinfoQ,
boolean  plain_ok 
)

Check if an appinfo clause is present Do not backup the current token The TK_TT_MSTRING token has not been seen yet Called from yang_consume_semiapp.

Save in appinfoQ if non-NULL

Error messages are printed by this function!! Do not duplicate error messages upon error return

Parameters
tkctoken chain to use
modncx_module_t in progress (NULL if none)
appinfoQqueue to use for any found entries (may be NULL)
plain_okTRUE if plain YANG OK; FALSE if only ext. stmts
Returns
status of the operation
Here is the caller graph for this function:

◆ ncx_consume_top_appinfo()

status_t ncx_consume_top_appinfo ( yang_pcb_t pcb,
tk_chain_t tkc,
ncx_module_t mod,
dlq_hdr_t *  appinfoQ,
boolean  struct_ok 
)

Check if an appinfo clause is present Called from the body_stmt handler Only top-level extension handlers are allowed to take over the consume_appinfo phase.

Save in appinfoQ if non-NULL

Error messages are printed by this function!! Do not duplicate error messages upon error return

Parameters
pcbYANG parser block
tkctoken chain to use
modncx_module_t in progress (NULL if none)
appinfoQqueue to use for any found entries (may be NULL)
struct_oktrue if the structure and augment-structure extensions should be processed now. If false then the TKC is already backed up and it will be re-processed
Returns
status of the operation

◆ ncx_find_appinfo()

ncx_appinfo_t * ncx_find_appinfo ( dlq_hdr_t *  appinfoQ,
const xmlChar *  prefix,
const xmlChar *  varname 
)

Find an appinfo entry by name (First match is returned) The entry returned is not removed from the Q.

This original code design is very fragile because it relies on the YANG prefix being unique within the server.

This is a customer API to support custom object flags All extensions are stored in the object appinfoQ dusring parsing

Parameters
appinfoQpointer to Q of ncx_appinfo_t data structure to check
prefixmodule prefix that defines the extension
NULL to pick the first match (not expecting appinfo name collisions)
varnamename string of the appinfo variable to find
Returns
pointer to the ncx_appinfo_t struct for the entry if found NULL if the entry is not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_find_const_appinfo()

const ncx_appinfo_t * ncx_find_const_appinfo ( const dlq_hdr_t *  appinfoQ,
const xmlChar *  prefix,
const xmlChar *  varname 
)

Find an appinfo entry by name (First match is returned) The entry returned is not removed from the Q (CONST version)

Parameters
appinfoQpointer to Q of ncx_appinfo_t data structure to check
prefixmodule prefix that defines the extension
NULL to pick the first match (not expecting appinfo name collisions)
varnamename string of the appinfo variable to find
Returns
pointer to the ncx_appinfo_t struct for the entry if found
NULL if the entry is not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_find_next_appinfo()

const ncx_appinfo_t * ncx_find_next_appinfo ( const ncx_appinfo_t current,
const xmlChar *  prefix,
const xmlChar *  varname 
)

Find the next instance of an appinfo entry by name (First match is returned) The entry returned is not removed from the Q.

Parameters
currentpointer to current ncx_appinfo_t data structure to check
prefixmodule prefix that defines the extension
NULL to pick the first match (not expecting appinfo name collisions)
varnamename string of the appinfo variable to find
Returns
pointer to the ncx_appinfo_t struct for the entry if found
NULL if the entry is not found
Here is the call graph for this function:

◆ ncx_find_next_appinfo2()

ncx_appinfo_t * ncx_find_next_appinfo2 ( ncx_appinfo_t current,
const xmlChar *  prefix,
const xmlChar *  varname 
)

Find the next instance of an appinfo entry by name (First match is returned, not const version) The entry returned is not removed from the Q.

Parameters
currentpointer to current ncx_appinfo_t data structure to check
prefixmodule prefix that defines the extension
NULL to pick the first match (not expecting appinfo name collisions)
varnamename string of the appinfo variable to find
Returns
pointer to the ncx_appinfo_t struct for the entry if found
NULL if the entry is not found
Here is the call graph for this function:

◆ ncx_free_appinfo()

void ncx_free_appinfo ( ncx_appinfo_t appinfo)

Free an appinfo entry.

Parameters
appinfoncx_appinfo_t data structure to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_get_appinfo_value()

const xmlChar * ncx_get_appinfo_value ( const ncx_appinfo_t appinfo)

Get the value string from an appinfo struct.

This is a customer API for SIL code to get the value of external statements from their YANG module. The OBJ_USER_FLAGS() macro can be used to set custom object properties based on extensions

Parameters
appinfoncx_appinfo_t data structure to use
Returns
pointer to the string value if name
NULL if no value
Here is the caller graph for this function:

◆ ncx_new_appinfo()

ncx_appinfo_t * ncx_new_appinfo ( boolean  isclone)

Create an appinfo entry.

Parameters
iscloneTRUE if this is for a cloned object
Returns
malloced appinfo entry or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_resolve_appinfoQ()

status_t ncx_resolve_appinfoQ ( yang_pcb_t pcb,
tk_chain_t tkc,
ncx_module_t mod,
dlq_hdr_t *  appinfoQ 
)

Validate all the appinfo clauses present in the specified Q.

Error messages are printed by this function!! Do not duplicate error messages upon error return

Parameters
pcbparser control block to use
tkctoken chain to use
modncx_module_t in progress
appinfoQqueue to check
Returns
status of the operation
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ncx_resolve_appinfoQ_ex()

status_t ncx_resolve_appinfoQ_ex ( yang_pcb_t pcb,
tk_chain_t tkc,
ncx_module_t mod,
dlq_hdr_t *  appinfoQ,
ncx_node_t  node_type,
void *  node 
)

Validate all the appinfo clauses present in the specified Q.

Error messages are printed by this function!! Do not duplicate error messages upon error return

Parameters
pcbparser control block to use
tkctoken chain to use
modncx_module_t in progress
appinfoQqueue to check
node_typenode type enum for ext callback
nodedata node containing this extension for callback
Returns
status of the operation
Here is the call graph for this function:
Here is the caller graph for this function: