|
void | nc_callback_print (void(*func)(NC_VERB_LEVEL level, const char *msg)) |
| Set a callback function for printing libnetconf's messages.If the func parameter is NULL, the callback is set back to the default (no) function. More...
|
|
int | nc_close (void) |
| Release libnetconf resources. Init flag is used to determine if close should be applied as system-wide (NC_INIT_MULTILAYER) or not (NC_INIT_SINGLELAYER). System-wide nc_close() closes all the shared structures if no other libnetconf participant is currently running. Local release of the calling instance from the shared structures is done in both cases. More...
|
|
time_t | nc_datetime2time (const char *datetime) |
| Transform given string in RFC 3339 compliant format to the time_t (seconds since the epoch) accepted by most Linux functions. More...
|
|
struct nc_err * | nc_err_dup (const struct nc_err *error) |
| Duplicate an error description structure. More...
|
|
void | nc_err_free (struct nc_err *err) |
| Free NETCONF error structure. More...
|
|
const char * | nc_err_get (const struct nc_err *err, NC_ERR_PARAM param) |
| Get value of the specified parameter of the NETCONF error structure. More...
|
|
struct nc_err * | nc_err_new (NC_ERR error) |
| Create a new error description structure. More...
|
|
int | nc_err_set (struct nc_err *err, NC_ERR_PARAM param, const char *value) |
| Set selected parameter of the NETCONF error structure to the specified value. More...
|
|
void | nc_hello_timeout (int timeout) |
| Set <hello> timeout - how long libnetconf will wait for the <hello> message from the other side. Default value is -1 (infinite timeout). More...
|
|
int | nc_init (int flags) |
| Initialize libnetconf for system-wide usage. This initialization is shared across all the processes. More...
|
|
int | nc_msgid_compare (const nc_msgid id1, const nc_msgid id2) |
| Compare two message IDs if they are the same. More...
|
|
char * | nc_time2datetime (time_t time, const char *tz) |
| Transform given time_t (seconds since the epoch) into the RFC 3339 format accepted by NETCONF functions. More...
|
|
void | nc_verb_error (const char *format,...) |
| Function for logging error messages. More...
|
|
void | nc_verb_verbose (const char *format,...) |
| Function for logging verbose messages. More...
|
|
void | nc_verb_warning (const char *format,...) |
| Function for logging warning messages. More...
|
|
void | nc_verbosity (NC_VERB_LEVEL level) |
| Set libnetconf's verbosity level. More...
|
|
libnetconf's miscellaneous functions.
Initialize libnetconf for system-wide usage. This initialization is shared across all the processes.
- Parameters
-
[in] | flags | ORed flags for libnetconf initialization. Must include NC_INIT_CLIENT, NC_INIT_MULTILAYER, or NC_INIT_SINGLELAYER with other accepted values including:
- NC_INIT_LIBSSH_PTHREAD The application uses libssh and pthread threads
- NC_INIT_ALL Enable all available subsystems
- NC_INIT_MONITORING Enable ietf-netconf-monitoring module
- NC_INIT_WD Enable With-default capability
- NC_INIT_NOTIF Enable Notification subsystem
- NC_INIT_NACM Enable NETCONF Access Control subsystem
|
Clients call init just for libssh initialization, if it is used. The difference between the multi-layer and single-layer flag is strictly in the behaviour when cleaning shared library resources, either during nc_close() or if the calling process crashed before (equals did not call nc_close()). On multi-layer crash/close, if it was/is the only running libnetconf application, full cleanup is performed, unlike single-layer crash, when this situation is reflected just in the return flag or single-layer close, when only the local resources are released.
- Returns
- -1 on fatal error
0 on success with some possible flags:
NC_INITRET_NOTFIRST when someone else already called nc_init() since last system-wide nc_close() or system reboot.
NC_INITRET_RECOVERY when after last init and before this init this application crashed (based on same commands - executable binary names).