![]() |
yumapro
25.10-1
YumaPro SDK
|
Support for <rpc-error> messages. More...

Data Structures | |
| struct | rpc_err_info_t |
| one error-info sub-element More... | |
| struct | rpc_err_rec_t |
| One RPC error record built by the server before an <rpc-error> element is generated. More... | |
Enumerations | |
| enum | rpc_err_t { RPC_ERR_NONE , RPC_ERR_IN_USE , RPC_ERR_INVALID_VALUE , RPC_ERR_TOO_BIG , RPC_ERR_MISSING_ATTRIBUTE , RPC_ERR_BAD_ATTRIBUTE , RPC_ERR_UNKNOWN_ATTRIBUTE , RPC_ERR_MISSING_ELEMENT , RPC_ERR_BAD_ELEMENT , RPC_ERR_UNKNOWN_ELEMENT , RPC_ERR_UNKNOWN_NAMESPACE , RPC_ERR_ACCESS_DENIED , RPC_ERR_LOCK_DENIED , RPC_ERR_RESOURCE_DENIED , RPC_ERR_ROLLBACK_FAILED , RPC_ERR_DATA_EXISTS , RPC_ERR_DATA_MISSING , RPC_ERR_OPERATION_NOT_SUPPORTED , RPC_ERR_OPERATION_FAILED , RPC_ERR_PARTIAL_OPERATION , RPC_ERR_MALFORMED_MESSAGE } |
| enumerations for NETCONF standard errors More... | |
| enum | rpc_err_sev_t { RPC_ERR_SEV_NONE , RPC_ERR_SEV_WARNING , RPC_ERR_SEV_ERROR } |
| enumerations for NETCONF standard error severities More... | |
Functions | |
| const xmlChar * | rpc_err_get_errtag (rpc_err_t errid) |
| Get the RPC error-tag for an rpc_err_t enumeration. More... | |
| rpc_err_t | rpc_err_get_errtag_enum (const xmlChar *errtag) |
| Get the RPC error-tag enum for an error-tag string. More... | |
| rpc_err_rec_t * | rpc_err_new_record (void) |
| Malloc and init an rpc_err_rec_t struct. More... | |
| void | rpc_err_init_record (rpc_err_rec_t *err) |
| Init an rpc_err_rec_t struct. More... | |
| void | rpc_err_free_record (rpc_err_rec_t *err) |
| Clean and free an rpc_err_rec_t struct. More... | |
| void | rpc_err_clean_record (rpc_err_rec_t *err) |
| Clean an rpc_err_rec_t struct. More... | |
| rpc_err_info_t * | rpc_err_new_info (void) |
| Malloc and init an rpc_err_info_t struct. More... | |
| void | rpc_err_free_info (rpc_err_info_t *errinfo) |
| Clean and free an rpc_err_info_t struct. More... | |
| void | rpc_err_dump_errors (const rpc_msg_t *msg, log_debug_t lvl) |
| Dump the error messages in the RPC message error Q. More... | |
| void | rpc_err_dump_errors_audit (const rpc_msg_t *msg) |
| Dump the error messages in the RPC message error Q to AUDIT LOG. More... | |
| const xmlChar * | rpc_err_get_severity (rpc_err_sev_t sev) |
| Translate an rpc_err_sev_t to a string. More... | |
| void | rpc_err_clean_errQ (dlq_hdr_t *errQ) |
| Clean all the entries from a Q of rpc_err_rec_t. More... | |
| boolean | rpc_err_any_errors (const rpc_msg_t *msg) |
| Check if there are any errors in the RPC message error Q. More... | |
Support for <rpc-error> messages.
NETCONF and RESTCONF each use their own format to report errors but the fields within rpc-error are the same.
From draft-ietf-netconf-prot-12.txt:
(Yes, this code is that old :-)
Tag: in-use
Error-type: protocol, application
Severity: error
Error-info: none
Description: The request requires a resource that already in use.
Tag: invalid-value
Error-type: protocol, application
Severity: error
Error-info: none
Description: The request specifies an unacceptable value for one
or more parameters.
Tag: too-big
Error-type: transport, rpc, protocol, application
Severity: error
Error-info: none
Description: The request or response (that would be generated) is too
large for the implementation to handle.
Tag: missing-attribute
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-attribute> : name of the missing attribute
<bad-element> : name of the element that should
contain the missing attribute
Description: An expected attribute is missing
Tag: bad-attribute
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-attribute> : name of the attribute w/ bad value
<bad-element> : name of the element that contains
the attribute with the bad value
Description: An attribute value is not correct; e.g., wrong type,
out of range, pattern mismatch
Tag: unknown-attribute
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-attribute> : name of the unexpected attribute
<bad-element> : name of the element that contains
the unexpected attribute
Description: An unexpected attribute is present
Tag: missing-element
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-element> : name of the missing element
Description: An expected element is missing
Tag: bad-element
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-element> : name of the element w/ bad value
Description: An element value is not correct; e.g., wrong type,
out of range, pattern mismatch
Tag: unknown-element
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-element> : name of the unexpected element
Description: An unexpected element is present
Tag: unknown-namespace
Error-type: rpc, protocol, application
Severity: error
Error-info: <bad-element> : name of the element that contains
the unexpected namespace
<bad-namespace> : name of the unexpected namespace
Description: An unexpected namespace is present
Tag: access-denied
Error-type: rpc, protocol, application
Severity: error
Error-info: none
Description: Access to the requested RPC, protocol operation,
or data model is denied because authorization failed
Tag: lock-denied
Error-type: protocol
Severity: error
Error-info: <session-id> : session ID of session holding the
requested lock, or zero to indicate a non-NETCONF
entity holds the lock
Description: Access to the requested lock is denied because the
lock is currently held by another entity
Tag: resource-denied
Error-type: transport, rpc, protocol, application
Severity: error
Error-info: none
Description: Request could not be completed because of insufficient
resources
Tag: rollback-failed
Error-type: protocol, application
Severity: error
Error-info: none
Description: Request to rollback some configuration change (via
rollback-on-error or discard-changes operations) was
not completed for some reason.
Tag: data-exists
Error-type: application
Severity: error
Error-info: none
Description: Request could not be completed because the relevant
data model content already exists. For example,
a 'create' operation was attempted on data which
already exists.
Tag: data-missing
Error-type: application
Severity: error
Error-info: none
Description: Request could not be completed because the relevant
data model content does not exist. For example,
a 'replace' or 'delete' operation was attempted on
data which does not exist.
Tag: operation-not-supported
Error-type: rpc, protocol, application
Severity: error
Error-info: none
Description: Request could not be completed because the requested
operation is not supported by this implementation.
Tag: operation-failed
Error-type: rpc, protocol, application
Severity: error
Error-info: none
Description: Request could not be completed because the requested
operation failed for some reason not covered by
any other error condition.
Tag: partial-operation
Error-type: application
Severity: error
Error-info: <ok-element> : identifies an element in the data model
for which the requested operation has been completed
for that node and all its child nodes. This element
can appear zero or more times in the <error-info>
container.
<err-element> : identifies an element in the data model
for which the requested operation has failed for that
node and all its child nodes. This element
can appear zero or more times in the <error-info>
container.
<noop-element> : identifies an element in the data model
for which the requested operation was not attempted for
that node and all its child nodes. This element
can appear zero or more times in the <error-info>
container.
Description: Some part of the requested operation failed or was
not attempted for some reason. Full cleanup has
not been performed (e.g., rollback not supported)
by the server. The error-info container is used
to identify which portions of the application
data model content for which the requested operation
has succeeded (<ok-element>), failed (<bad-element>),
or not attempted (<noop-element>).
[New in NETCONF base:1.1; do not send to NETCONF:base:1.0 sessions]
error-tag: malformed-message
error-type: rpc
error-severity: error
error-info: none
Description: A message could not be handled because it failed to
be parsed correctly. For example, the message is not
well-formed XML or it uses an invalid character set.
This error-tag is new in :base:1.1 and MUST NOT be
sent to old clients.
| enum rpc_err_sev_t |
| enum rpc_err_t |
enumerations for NETCONF standard errors
| boolean rpc_err_any_errors | ( | const rpc_msg_t * | msg | ) |
Check if there are any errors in the RPC message error Q.
| msg | rpc_msg_t struct to check for errors |

| void rpc_err_clean_errQ | ( | dlq_hdr_t * | errQ | ) |
Clean all the entries from a Q of rpc_err_rec_t.
| errQ | Q of rpc_err_rec_t to clean |


| void rpc_err_clean_record | ( | rpc_err_rec_t * | err | ) |
Clean an rpc_err_rec_t struct.
| err | rpc_err_rec_t struct to clean |


| void rpc_err_dump_errors | ( | const rpc_msg_t * | msg, |
| log_debug_t | lvl | ||
| ) |
Dump the error messages in the RPC message error Q.
| msg | rpc_msg_t struct to check for errors |
| lvl | debug level needed for dump to occur |

| void rpc_err_dump_errors_audit | ( | const rpc_msg_t * | msg | ) |
Dump the error messages in the RPC message error Q to AUDIT LOG.
| msg | rpc_msg_t struct to check for errors and dump to audit log |

| void rpc_err_free_info | ( | rpc_err_info_t * | errinfo | ) |
Clean and free an rpc_err_info_t struct.
| errinfo | rpc_err_info_t struct to clean and free |


| void rpc_err_free_record | ( | rpc_err_rec_t * | err | ) |
Clean and free an rpc_err_rec_t struct.
| err | rpc_err_rec_t struct to clean and free |


| const xmlChar * rpc_err_get_errtag | ( | rpc_err_t | errid | ) |
Get the RPC error-tag for an rpc_err_t enumeration.
| errid | rpc error enum to convert to a string |

| rpc_err_t rpc_err_get_errtag_enum | ( | const xmlChar * | errtag | ) |
Get the RPC error-tag enum for an error-tag string.
| errtag | error-tag string to check |

| const xmlChar * rpc_err_get_severity | ( | rpc_err_sev_t | sev | ) |
Translate an rpc_err_sev_t to a string.
| sev | rpc_err_sev_t enum to translate |

| void rpc_err_init_record | ( | rpc_err_rec_t * | err | ) |
Init an rpc_err_rec_t struct.
| err | rpc_err_rec_t struct to init |


| rpc_err_info_t * rpc_err_new_info | ( | void | ) |
Malloc and init an rpc_err_info_t struct.

| rpc_err_rec_t * rpc_err_new_record | ( | void | ) |
Malloc and init an rpc_err_rec_t struct.

