yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
RPC Error Support

Support for <rpc-error> messages. More...

Collaboration diagram for RPC Error Support:

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_trpc_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_trpc_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...
 

Detailed Description

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.

Enumeration Type Documentation

◆ rpc_err_sev_t

enumerations for NETCONF standard error severities

The protocol does not actually use RPC warnings and these are not supported or used in the server

Enumerator
RPC_ERR_SEV_NONE 

not set

RPC_ERR_SEV_WARNING 

warning

RPC_ERR_SEV_ERROR 

error (only used value)

◆ rpc_err_t

enum rpc_err_t

enumerations for NETCONF standard errors

Enumerator
RPC_ERR_NONE 

not set

RPC_ERR_IN_USE 

in-use

RPC_ERR_INVALID_VALUE 

invalid-value

RPC_ERR_TOO_BIG 

too-big

RPC_ERR_MISSING_ATTRIBUTE 

missing-attribute

RPC_ERR_BAD_ATTRIBUTE 

bad-attribute

RPC_ERR_UNKNOWN_ATTRIBUTE 

unknown-attribute

RPC_ERR_MISSING_ELEMENT 

missing-element

RPC_ERR_BAD_ELEMENT 

bad-element

RPC_ERR_UNKNOWN_ELEMENT 

unknown-element

RPC_ERR_UNKNOWN_NAMESPACE 

unknown-namespace

RPC_ERR_ACCESS_DENIED 

access-denied

RPC_ERR_LOCK_DENIED 

lock-denied

RPC_ERR_RESOURCE_DENIED 

resource-denied

RPC_ERR_ROLLBACK_FAILED 

rollback-failed

RPC_ERR_DATA_EXISTS 

data-exists

RPC_ERR_DATA_MISSING 

data-missing

RPC_ERR_OPERATION_NOT_SUPPORTED 

operation-not-supported

RPC_ERR_OPERATION_FAILED 

operation-failed

RPC_ERR_PARTIAL_OPERATION 

partial-operation, deprecated; not used

RPC_ERR_MALFORMED_MESSAGE 

malformed-message

Function Documentation

◆ rpc_err_any_errors()

boolean rpc_err_any_errors ( const rpc_msg_t msg)

Check if there are any errors in the RPC message error Q.

Parameters
msgrpc_msg_t struct to check for errors
Returns
TRUE if any errors recorded; FALSE if none
Here is the caller graph for this function:

◆ rpc_err_clean_errQ()

void rpc_err_clean_errQ ( dlq_hdr_t *  errQ)

Clean all the entries from a Q of rpc_err_rec_t.

Parameters
errQQ of rpc_err_rec_t to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_err_clean_record()

void rpc_err_clean_record ( rpc_err_rec_t err)

Clean an rpc_err_rec_t struct.

Parameters
errrpc_err_rec_t struct to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_err_dump_errors()

void rpc_err_dump_errors ( const rpc_msg_t msg,
log_debug_t  lvl 
)

Dump the error messages in the RPC message error Q.

Parameters
msgrpc_msg_t struct to check for errors
lvldebug level needed for dump to occur
Here is the caller graph for this function:

◆ rpc_err_dump_errors_audit()

void rpc_err_dump_errors_audit ( const rpc_msg_t msg)

Dump the error messages in the RPC message error Q to AUDIT LOG.

Parameters
msgrpc_msg_t struct to check for errors and dump to audit log
Here is the caller graph for this function:

◆ rpc_err_free_info()

void rpc_err_free_info ( rpc_err_info_t errinfo)

Clean and free an rpc_err_info_t struct.

Parameters
errinforpc_err_info_t struct to clean and free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_err_free_record()

void rpc_err_free_record ( rpc_err_rec_t err)

Clean and free an rpc_err_rec_t struct.

Parameters
errrpc_err_rec_t struct to clean and free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_err_get_errtag()

const xmlChar * rpc_err_get_errtag ( rpc_err_t  errid)

Get the RPC error-tag for an rpc_err_t enumeration.

Parameters
erridrpc error enum to convert to a string
Returns
string for the specified error-tag enum
Here is the caller graph for this function:

◆ rpc_err_get_errtag_enum()

rpc_err_t rpc_err_get_errtag_enum ( const xmlChar *  errtag)

Get the RPC error-tag enum for an error-tag string.

Parameters
errtagerror-tag string to check
Returns
enum for this error-tag
Here is the call graph for this function:

◆ rpc_err_get_severity()

const xmlChar * rpc_err_get_severity ( rpc_err_sev_t  sev)

Translate an rpc_err_sev_t to a string.

Parameters
sevrpc_err_sev_t enum to translate
Returns
const pointer to the enum string
Here is the caller graph for this function:

◆ rpc_err_init_record()

void rpc_err_init_record ( rpc_err_rec_t err)

Init an rpc_err_rec_t struct.

Parameters
errrpc_err_rec_t struct to init
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rpc_err_new_info()

rpc_err_info_t * rpc_err_new_info ( void  )

Malloc and init an rpc_err_info_t struct.

Returns
malloced error-info record, or NULL if memory error
Here is the caller graph for this function:

◆ rpc_err_new_record()

rpc_err_rec_t * rpc_err_new_record ( void  )

Malloc and init an rpc_err_rec_t struct.

Returns
malloced error record or NULL if memory error
Here is the call graph for this function:
Here is the caller graph for this function: