yumapro
24.10-2
YumaPro SDK
|
XML Message Processing Support. More...
Functions | |
boolean | agt_top_dispatch_msg (ses_cb_t **ppscb) |
Find the appropriate top node handler and call it. More... | |
status_t | agt_val_parse_nc (ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, const xml_node_t *startnode, ncx_data_class_t parentdc, val_value_t *retval) |
Parse NETCONF PDU sub-contents into value fields. More... | |
status_t | agt_xml_consume_node (ses_cb_t *scb, xml_node_t *node, ncx_layer_t layer, xml_msg_hdr_t *msghdr) |
Consume an XML node from libxml2. More... | |
status_t | agt_xml_consume_node_noeof (ses_cb_t *scb, xml_node_t *node, ncx_layer_t layer, xml_msg_hdr_t *msghdr) |
Consume an XML node from libxml2. More... | |
status_t | agt_xml_consume_node_nons (ses_cb_t *scb, xml_node_t *node, ncx_layer_t layer, xml_msg_hdr_t *msghdr) |
Consume an XML node from libxml2. More... | |
status_t | agt_xml_consume_node_noadv (ses_cb_t *scb, xml_node_t *node, ncx_layer_t layer, xml_msg_hdr_t *msghdr) |
Consume an XML node from libxml2. More... | |
XML Message Processing Support.
Uses NCX XML support APIs to process XML messages received from and sent to a session (ses_cb_t).
boolean agt_top_dispatch_msg | ( | ses_cb_t ** | ppscb | ) |
Find the appropriate top node handler and call it.
Called by the transport manager (through the session manager) when a new message is detected
This function might de-allocate the scb, if it does scb will be set to NULL and TRUE will be returned
[out] | ppscb | session control block containing the xmlreader set at the start of an incoming message. *ppscb is set to NULL if the session was deleted |
status_t agt_val_parse_nc | ( | ses_cb_t * | scb, |
xml_msg_hdr_t * | msg, | ||
obj_template_t * | obj, | ||
const xml_node_t * | startnode, | ||
ncx_data_class_t | parentdc, | ||
val_value_t * | retval | ||
) |
Parse NETCONF PDU sub-contents into value fields.
This module does not enforce complex type completeness. Different subsets of configuration data are permitted in several standard (and any proprietary) RPC methods
Makes sure that only allowed value strings or child nodes (and their values) are entered.
Defaults are not added to any objects Missing objects are not checked
A seperate parsing phase is used to fully validate the input contained in the returned val_value_t struct.
This parsing phase checks that simple types are complete and child members of complex types are valid (but maybe missing or incomplete child nodes.
Note that the NETCONF inlineFilterType will be parsed correctly because it is type 'anyxml'. This type is parsed as a struct, and no validation other well-formed XML is done.
scb | session control block | |
[in,out] | msg | incoming RPC message msg->errQ may be appended with new errors |
obj | obj_template_t for the object to parse | |
startnode | top node of the parameter to be parsed | |
parentdc | parent data class For the first call to this function, this will be the data class of a parameter. | |
[out] | retval | address of initialized return value *retval will be filled in |
status_t agt_xml_consume_node | ( | ses_cb_t * | scb, |
xml_node_t * | node, | ||
ncx_layer_t | layer, | ||
xml_msg_hdr_t * | msghdr | ||
) |
Consume an XML node from libxml2.
Parse the next node and return its namespace, type and name The xml_init_node or xml_clean_node API must be called before this function for the node parameter
scb | session control block containing XmlTextReader | |
[in,out] | node | pointer to an initialized xml_node_t struct to be filled in
|
layer | protocol layer of caller (only used if errQ != NULL) | |
[in,out] | msghdr | msg hdr w/ Q to get any rpc-errors as found
|
status_t agt_xml_consume_node_noadv | ( | ses_cb_t * | scb, |
xml_node_t * | node, | ||
ncx_layer_t | layer, | ||
xml_msg_hdr_t * | msghdr | ||
) |
Consume an XML node from libxml2.
Consume node but do not advance the node pointer
scb | session control block containing XmlTextReader | |
[in,out] | node | pointer to an initialized xml_node_t struct to be filled in
|
layer | protocol layer of caller (only used if errQ != NULL) | |
[in,out] | msghdr | msg hdr w/ Q to get any rpc-errors as found
|
status_t agt_xml_consume_node_noeof | ( | ses_cb_t * | scb, |
xml_node_t * | node, | ||
ncx_layer_t | layer, | ||
xml_msg_hdr_t * | msghdr | ||
) |
Consume an XML node from libxml2.
consume node but do not generate an EOF error if seen.
scb | session control block containing XmlTextReader | |
[in,out] | node | pointer to an initialized xml_node_t struct to be filled in
|
layer | protocol layer of caller (only used if errQ != NULL) | |
[in,out] | msghdr | msg hdr w/ Q to get any rpc-errors as found NULL if not used
|
status_t agt_xml_consume_node_nons | ( | ses_cb_t * | scb, |
xml_node_t * | node, | ||
ncx_layer_t | layer, | ||
xml_msg_hdr_t * | msghdr | ||
) |
Consume an XML node from libxml2.
Consume node but do not generate namespace errors if seen. Needed to process subtree filters properly
scb | session control block containing XmlTextReader | |
[in,out] | node | pointer to an initialized xml_node_t struct to be filled in
|
layer | protocol layer of caller (only used if errQ != NULL) | |
[in,out] | msghdr | msg hdr w/ Q to get any rpc-errors as found
|