libnetconf
0.10.0-146_trunk
NETCONF Library
|
Various YANG data models uses YANG date-and-time type for representation of dates and times. The type is defined in ietf-yang-types module that comes from RFC 6021. The date-and-time type is, for example, used in all NETCONF event notifications.
The date-and-time format examples:
libnetconf provides two functions to handle timestamps:
NETCONF protocol specifications (RFC 6241) defines list of errors that can be returned by the server. libnetconf provides a set of functions that server to create, manipulate and process NETCONF errors.
NETCONF error is represented by struct nc_err
. Specifying one of the basic errors, a new error structure can be created by calling the nc_err_new() function. If the caller want to change a specific attribute, the nc_err_set() function can be used. To get the value of the specific error attribute, there is nc_err_get() function. If the caller want to create a copy of some existing error structure, nc_err_dup() can be used. And finally to free all allocated resources, the nc_err_free() is available.
To create <rpc-error> reply, the application is supposed to use nc_reply_error() and nc_reply_error_add() to add another error structure to the reply.
On the client side, <rpc-error> replies can be handled manually as any other <rpc-reply> recognizing its type using nc_reply_get_type() and then by getting the error message via nc_reply_get_errormsg() and parsing its content manually. The other, recomended, way how to handle incoming <rpc-error> replies is to specify the callback function via nc_callback_error_reply(). The callback is automatically invoked to process (e.g. print) <rpc-error> message. In this case, all NETCONF error attributes are parsed and passed to the callback function.
libnetconf provides information about the data processing on several verbose levels. However, by default there is no printing routine, so no message from libnetconf appears until the printing callback is specified using nc_callback_print() function. Application is able to set (and change) the current verbose levels via the nc_verbosity() function.
Mainly for transAPI modules, there is a set of functions to access message printing callback outside the library: