libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netconf.h
Go to the documentation of this file.
1 
40 #ifndef NC_NETCONF_H_
41 #define NC_NETCONF_H_
42 
43 #include <stdint.h>
44 #include <sys/types.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 struct nc_msg;
51 
56 typedef struct nc_msg nc_rpc;
57 
62 typedef struct nc_msg nc_reply;
63 
68 typedef struct nc_msg nc_ntf;
69 
74 struct nc_cpblts;
75 
91 #define nc_msgid char*
92 
97 struct nc_session;
98 
103 struct nc_filter;
104 
109 typedef enum NC_SESSION_STATUS {
117 
131 
136 typedef enum NC_MSG_TYPE {
144 } NC_MSG_TYPE;
145 
150 typedef enum NC_REPLY_TYPE {
156 } NC_REPLY_TYPE;
157 
162 typedef enum NC_RPC_TYPE {
168 } NC_RPC_TYPE;
169 
170 typedef enum NC_NOTIF_TYPE {
173 } NC_NOTIF_TYPE;
174 
179 typedef enum NC_OP {
195 } NC_OP;
196 
197 typedef enum NC_ERR_PARAM {
254 } NC_ERR_PARAM;
255 
260 typedef enum NC_DATASTORE_TYPE {
267 } NC_DATASTORE;
268 
273 typedef enum NC_FILTER_TYPE {
277 
282 typedef enum NC_EDIT_OP_TYPE {
291 
296 typedef enum NC_EDIT_DEFOP_TYPE {
303 
308 typedef enum NC_EDIT_ERROPT_TYPE {
315 
322 typedef enum NC_EDIT_TESTOPT_TYPE {
329 
336 typedef enum NCWD_MODE {
343 } NCWD_MODE;
344 
353 typedef enum NC_CAP_ATTR {
355 } NC_CAP_ATTR;
356 
361 typedef enum NC_VERB_LEVEL {
366 } NC_VERB_LEVEL;
367 
373 void nc_verbosity(NC_VERB_LEVEL level);
374 
381 void nc_verb_error(const char * format, ...);
382 
389 void nc_verb_warning(const char * format, ...);
390 
397 void nc_verb_verbose(const char * format, ...);
398 
410 typedef enum NC_TRANSPORT {
414 } NC_TRANSPORT;
415 
443 int nc_init(int flags);
444 
445 /*
446  * The difference between single and multi-layer server affects only
447  * nc_init() and nc_close() calls. Generally, single-layer application
448  * can be executed and finish several times, even during a single
449  * NETCONF session. A multi-layer application is expected to call
450  * nc_close() only after it actually finished all its work and no
451  * client is connected.
452  */
453 #define NC_INIT_MULTILAYER 0x00001000
454 #define NC_INIT_SINGLELAYER 0x00002000
455 #define NC_INIT_CLIENT 0x00004000
457 #define NC_INIT_ALL 0xffff8fff
458 #define NC_INIT_NOTIF 0x00000002
459 #define NC_INIT_NACM 0x00000004
460 #define NC_INIT_MONITORING 0x00000008
461 #define NC_INIT_WD 0x00000010
462 #define NC_INIT_VALIDATE 0x00000020
463 #define NC_INIT_URL 0x00000040
464 #define NC_INIT_KEEPALIVECHECK 0x00000080
472 #define NC_INIT_DATASTORES 0x00000100
473 #define NC_INIT_LIBSSH_PTHREAD 0x00000200
475 #define NC_INITRET_NOTFIRST 0x00000001
476 #define NC_INITRET_RECOVERY 0x00000002
490 int nc_close(void);
491 
505 char* nc_time2datetime(time_t time, const char* tz);
506 
517 time_t nc_datetime2time(const char* datetime);
518 
526 void nc_hello_timeout(int timeout);
527 
528 #ifdef __cplusplus
529 }
530 #endif
531 
532 #endif /* NC_NETCONF_H_ */
Definition: netconf.h:187
Definition: netconf.h:143
Definition: netconf.h:154
void nc_verbosity(NC_VERB_LEVEL level)
Set libnetconf's verbosity level.
NC_TRANSPORT
Supported NETCONF transport protocols enumeration. To change currently used transport protocol...
Definition: netconf.h:410
NC_EDIT_ERROPT_TYPE
Enumeration of edit-config's <error-option> element values.
Definition: netconf.h:308
Definition: netconf.h:171
Definition: netconf.h:286
Definition: netconf.h:191
NC_EDIT_DEFOP_TYPE
Enumeration of edit-config's <default-operation> element values.
Definition: netconf.h:296
Definition: netconf.h:300
Definition: netconf.h:194
int nc_init(int flags)
Initialize libnetconf for system-wide usage. This initialization is shared across all the processes...
Definition: netconf.h:287
NC_DATASTORE
Enumeration of the supported types of datastores defined by NETCONF.
Definition: netconf.h:260
Definition: netconf.h:114
Definition: netconf.h:363
Definition: netconf.h:180
void nc_verb_warning(const char *format,...)
Function for logging warning messages.
Definition: netconf.h:324
Definition: netconf.h:365
Definition: netconf.h:413
NC_SESSION_STATUS
Enumeration of the possible states of a NETCONF session.
Definition: netconf.h:109
struct nc_msg nc_reply
reply message.
Definition: netconf.h:62
time_t nc_datetime2time(const char *datetime)
Transform given string in RFC 3339 compliant format to the time_t (seconds since the epoch) accepted ...
Definition: netconf.h:166
Definition: netconf.h:129
NC_SESSION_TERM_REASON
Enumeration of reasons of the NETCONF session termination as defined in RFC 6470. ...
Definition: netconf.h:123
NC_VERB_LEVEL
Verbosity levels.
Definition: netconf.h:361
Definition: netconf.h:124
Definition: netconf.h:172
Definition: netconf.h:182
Definition: netconf.h:313
Definition: netconf.h:140
struct nc_msg nc_ntf
Event notification message.
Definition: netconf.h:68
Definition: netconf.h:141
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 functio...
Definition: netconf.h:362
Definition: netconf.h:266
Definition: netconf.h:184
Definition: netconf.h:310
Definition: netconf.h:152
Definition: netconf.h:298
Definition: netconf.h:192
Definition: netconf.h:115
Definition: netconf.h:221
Definition: netconf.h:301
Definition: netconf.h:311
Definition: netconf.h:289
Definition: netconf.h:138
Definition: netconf.h:153
Definition: netconf.h:288
Definition: netconf.h:125
void nc_hello_timeout(int timeout)
Set <hello> timeout - how long libnetconf will wait for the <hello> message from the other side...
struct nc_msg nc_rpc
rpc message.
Definition: netconf.h:56
NC_OP
Enumeration of supported <rpc> operations.
Definition: netconf.h:179
Definition: netconf.h:186
Definition: netconf.h:155
NCWD_MODE
Enumeration of <with-defaults> element values.
Definition: netconf.h:336
Definition: netconf.h:110
Definition: netconf.h:284
NC_MSG_TYPE
Enumeration of NETCONF message types.
Definition: netconf.h:136
Definition: netconf.h:337
Definition: netconf.h:263
Definition: netconf.h:137
Definition: netconf.h:262
Definition: netconf.h:128
Definition: netconf.h:340
Definition: netconf.h:265
Definition: netconf.h:181
Definition: netconf.h:264
Definition: netconf.h:126
Definition: netconf.h:412
Definition: netconf.h:364
Definition: netconf.h:274
Definition: netconf.h:275
Definition: netconf.h:309
Definition: netconf.h:189
Definition: netconf.h:339
Definition: netconf.h:253
Definition: netconf.h:411
Definition: netconf.h:299
Definition: netconf.h:111
Definition: netconf.h:342
Definition: netconf.h:112
Definition: netconf.h:142
Definition: netconf.h:341
Definition: netconf.h:325
Definition: netconf.h:188
Definition: netconf.h:243
Definition: netconf.h:139
Definition: netconf.h:354
Definition: netconf.h:183
Definition: netconf.h:248
Definition: netconf.h:163
NC_EDIT_TESTOPT_TYPE
Enumeration of edit-config's <test-option> element values.
Definition: netconf.h:322
Definition: netconf.h:127
Definition: netconf.h:312
Definition: netconf.h:167
Definition: netconf.h:283
Definition: netconf.h:193
Definition: netconf.h:338
Definition: netconf.h:165
NC_NOTIF_TYPE
Definition: netconf.h:170
NC_REPLY_TYPE
Enumeration of <rpc-reply> types.
Definition: netconf.h:150
Definition: netconf.h:285
Definition: netconf.h:185
NC_RPC_TYPE
Enumeration of <rpc> operation types.
Definition: netconf.h:162
Definition: netconf.h:326
Definition: netconf.h:323
Definition: netconf.h:327
Definition: netconf.h:211
Definition: netconf.h:190
Definition: netconf.h:231
NC_ERR_PARAM
Definition: netconf.h:197
NC_FILTER_TYPE
Enumeration of supported NETCONF filter types.
Definition: netconf.h:273
Definition: netconf.h:206
NC_CAP_ATTR
RPC attributes list.
Definition: netconf.h:353
Definition: netconf.h:261
Definition: netconf.h:164
void nc_verb_verbose(const char *format,...)
Function for logging verbose messages.
Definition: netconf.h:202
NC_EDIT_OP_TYPE
Enumeration of edit-config's operation attribute values.
Definition: netconf.h:282
Definition: netconf.h:113
Definition: netconf.h:297
Definition: netconf.h:227
Definition: netconf.h:151
void nc_verb_error(const char *format,...)
Function for logging error messages.
Definition: netconf.h:236