Support YANG Module parser extension statement.
More...
|
ext_template_t * | ext_new_template (void) |
| Malloc and initialize the fields in a ext_template_t. More...
|
|
void | ext_free_template (ext_template_t *ext) |
| Scrub the memory in a ext_template_t by freeing all the sub-fields and then freeing the entire struct itself. More...
|
|
void | ext_clean_extensionQ (dlq_hdr_t *que) |
| Clean a queue of ext_template_t structs. More...
|
|
ext_template_t * | ext_find_extension (ncx_module_t *mod, const xmlChar *name) |
| Search a module for an ext_template_t structs with a given name Search mod to find extension name . More...
|
|
ext_template_t * | ext_find_extension_que (dlq_hdr_t *extensionQ, const xmlChar *name) |
| Find an ext_template_t struct in the specified Q. More...
|
|
ext_template_t * | ext_find_extension_all (ncx_module_t *mod, const xmlChar *name) |
| Search a module of ext_template_t structs for a given name Check all submodules as well. More...
|
|
void | ext_init (void) |
| Init the extension callback handler queue. More...
|
|
void | ext_cleanup (void) |
| Cleanup the extension callback handler queue. More...
|
|
status_t | ext_register_cbfn (const xmlChar *modname, const xmlChar *extname, ext_cbfn_t cbfn, void *cbfn_cookie) |
| Register a callback function for the specified extension If multiple callbacks for same extension, then last one wins. More...
|
|
void | ext_find_cbfn (const xmlChar *modname, const xmlChar *extname, ext_template_t *ext) |
| Find the registered callback for the specified extension Set the callback handler if found. More...
|
|
status_t | yang_ext_consume_extension (tk_chain_t *tkc, ncx_module_t *mod) |
| Parse the next N tokens as an extension-stmt. More...
|
|
Support YANG Module parser extension statement.
◆ ext_cbfn_t
One YANG Extension Handler Callback.
ext_cbfn_t
Handle the parsing and processing of an external statement using the associated YANG extension statement
This callback is invoked when the external statement is first encountered. The current token is the argument string if any or the identifier token if none. The next token is expected to be a semi-colon or a left brace The callback is expected to parse the closing semi-colon or entire sub-section including starting brace
- Parameters
-
rawpcb | parser control block in progress (cast as void *) |
mod | module being processed |
tkc | token chain of module tokens parse in progress |
ext | extension definition record (allows a handler to process multiple extension types) |
cookie | cbfn_cookie from the extension 'ext' |
arg | argument string used in the external statement (if any) |
node_type | type of node being processed; direct parent statement of the external statement using the extension If NULL, then the parent statement is the module itself, and 'mod' should be used as the 'node' pointer |
node | pointer to node indicated by node_type |
- Returns
- status of processing
◆ ext_clean_extensionQ()
void ext_clean_extensionQ |
( |
dlq_hdr_t * |
que | ) |
|
◆ ext_cleanup()
void ext_cleanup |
( |
void |
| ) |
|
Cleanup the extension callback handler queue.
◆ ext_find_cbfn()
void ext_find_cbfn |
( |
const xmlChar * |
modname, |
|
|
const xmlChar * |
extname, |
|
|
ext_template_t * |
ext |
|
) |
| |
Find the registered callback for the specified extension Set the callback handler if found.
- Parameters
-
modname | module name defining the extension |
extname | extension name |
ext | extension template to fill in |
◆ ext_find_extension()
Search a module for an ext_template_t structs with a given name Search mod
to find extension name
.
- Parameters
-
mod | module to search |
name | name string to find |
- Returns
- pointer to found entry, or NULL if not found
◆ ext_find_extension_all()
Search a module of ext_template_t structs for a given name Check all submodules as well.
- Parameters
-
mod | module to check |
name | name string to find |
- Returns
- pointer to found entry, or NULL if not found
◆ ext_find_extension_que()
ext_template_t * ext_find_extension_que |
( |
dlq_hdr_t * |
extensionQ, |
|
|
const xmlChar * |
name |
|
) |
| |
Find an ext_template_t struct in the specified Q.
- Parameters
-
extensionQ | Q of ext_template_t data structures to search |
name | extension name to find |
- Returns
- pointer to found extension or NULL if not found
◆ ext_free_template()
Scrub the memory in a ext_template_t by freeing all the sub-fields and then freeing the entire struct itself.
The struct must be removed from any queue it is in before this function is called.
- Parameters
-
◆ ext_init()
Init the extension callback handler queue.
◆ ext_new_template()
Malloc and initialize the fields in a ext_template_t.
- Returns
- pointer to the malloced and initialized struct or NULL if an error
◆ ext_register_cbfn()
status_t ext_register_cbfn |
( |
const xmlChar * |
modname, |
|
|
const xmlChar * |
extname, |
|
|
ext_cbfn_t |
cbfn, |
|
|
void * |
cbfn_cookie |
|
) |
| |
Register a callback function for the specified extension If multiple callbacks for same extension, then last one wins.
- Parameters
-
modname | module name defining the extension |
extname | extension name |
cbfn | pointer to callback function to register |
cbfn_cookie | optional cookie to register; will not be freed when the extension is freed Use macro EXT_CBFN_COOKIE(ext) to access from callback; (may be NULL if not used) |
- Returns
- status
◆ yang_ext_consume_extension()
Parse the next N tokens as an extension-stmt.
Create an ext_template_t struct and add it to the specified Q
Error messages are printed by this function!! Do not duplicate error messages upon error return
Current token is the 'extension' keyword
- Parameters
-
tkc | token chain to parse |
mod | module in progress |
- Returns
- status of the operation