yumapro
24.10-3
YumaPro SDK
|
NCX appinfo is used to store YANG external statements. More...
Functions | |
ncx_appinfo_t * | ncx_new_appinfo (boolean isclone) |
Create an appinfo entry. More... | |
void | ncx_free_appinfo (ncx_appinfo_t *appinfo) |
Free an appinfo entry. More... | |
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. More... | |
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) More... | |
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. More... | |
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. More... | |
ncx_appinfo_t * | ncx_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... | |
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.
void ncx_clean_appinfoQ | ( | dlq_hdr_t * | appinfoQ | ) |
Check an initialized appinfoQ for any entries Remove them from the queue and delete them.
appinfoQ | Q of ncx_appinfo_t data structures to free |
ncx_appinfo_t * ncx_clone_appinfo | ( | ncx_appinfo_t * | appinfo | ) |
Clone an appinfo value.
appinfo | ncx_appinfo_t data structure to clone |
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
tkc | token chain to use |
mod | ncx_module_t in progress (NULL if none) |
appinfoQ | queue to use for any found entries (may be NULL) |
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
tkc | token chain to use |
mod | ncx_module_t in progress (NULL if none) |
appinfoQ | queue to use for any found entries (may be NULL) |
plain_ok | TRUE if plain YANG OK; FALSE if only ext. stmts |
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
pcb | YANG parser block |
tkc | token chain to use |
mod | ncx_module_t in progress (NULL if none) |
appinfoQ | queue to use for any found entries (may be NULL) |
struct_ok | true 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 |
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
appinfoQ | pointer to Q of ncx_appinfo_t data structure to check |
prefix | module prefix that defines the extension NULL to pick the first match (not expecting appinfo name collisions) |
varname | name string of the appinfo variable to find |
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)
appinfoQ | pointer to Q of ncx_appinfo_t data structure to check |
prefix | module prefix that defines the extension NULL to pick the first match (not expecting appinfo name collisions) |
varname | name string of the appinfo variable to find |
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.
current | pointer to current ncx_appinfo_t data structure to check |
prefix | module prefix that defines the extension NULL to pick the first match (not expecting appinfo name collisions) |
varname | name string of the appinfo variable to find |
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.
current | pointer to current ncx_appinfo_t data structure to check |
prefix | module prefix that defines the extension NULL to pick the first match (not expecting appinfo name collisions) |
varname | name string of the appinfo variable to find |
void ncx_free_appinfo | ( | ncx_appinfo_t * | appinfo | ) |
Free an appinfo entry.
appinfo | ncx_appinfo_t data structure to free |
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
appinfo | ncx_appinfo_t data structure to use |
ncx_appinfo_t * ncx_new_appinfo | ( | boolean | isclone | ) |
Create an appinfo entry.
isclone | TRUE if this is for a cloned object |
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
pcb | parser control block to use |
tkc | token chain to use |
mod | ncx_module_t in progress |
appinfoQ | queue to check |
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
pcb | parser control block to use |
tkc | token chain to use |
mod | ncx_module_t in progress |
appinfoQ | queue to check |
node_type | node type enum for ext callback |
node | data node containing this extension for callback |