libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
transapi.h
Go to the documentation of this file.
1 
42 #ifndef NC_TRANSAPI_H
43 #define NC_TRANSAPI_H
44 
45 #include <sys/inotify.h>
46 #include <libxml/tree.h>
47 #include "netconf.h"
48 #include "error.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /* Current transAPI version */
55 #define TRANSAPI_VERSION 6
56 
57 /* maximal number of input arguments every defined RPC can have */
58 #ifndef MAX_RPC_INPUT_ARGS
59 # define MAX_RPC_INPUT_ARGS 64
60 #endif
61 
66 typedef enum
67 {
68  XMLDIFF_ERR = -1 ,
76 } XMLDIFF_OP;
77 
83 
84 typedef enum
85 {
95 
96 
97 struct ns_pair {
98  const char* prefix;
99  const char* href;
100 };
101 
107 struct transapi {
111  int version;
115  int (*init)(xmlDocPtr *);
119  void (*close)(void);
123  xmlDocPtr (*get_state)(const xmlDocPtr, const xmlDocPtr, struct nc_err**);
152 };
153 
158 struct clbk {
159  char* path;
160  int (*func)(void**, XMLDIFF_OP, xmlNodePtr, xmlNodePtr, struct nc_err**);
161 };
162 
169  void* data;
170  struct clbk callbacks[];
171 };
172 
179  struct {
180  char* name;
181  nc_reply* (*func)(xmlNodePtr);
182  } callbacks[];
183 };
184 
197  struct {
198  const char* path;
199  int (*func)(const char*, xmlDocPtr*, int*);
200  } callbacks[];
201 };
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* NC_TRANSAPI_H */
struct clbk callbacks[]
Definition: transapi.h:170
Definition: transapi.h:93
void * data
Definition: transapi.h:169
NC_EDIT_ERROPT_TYPE
Enumeration of edit-config's <error-option> element values.
Definition: netconf.h:308
struct transapi_data_callbacks * data_clbks
Transapi callback mapping structure.
Definition: transapi.h:131
Definition: transapi.h:73
const char * prefix
Definition: transapi.h:98
Definition: transapi.h:92
Same as transapi_rpc_callbacks. Using libxml2 structures for callbacks parameters.
Definition: transapi.h:177
struct transapi_file_callbacks::@1 callbacks[]
Definition: transapi.h:72
struct nc_msg nc_reply
reply message.
Definition: netconf.h:62
Definition: transapi.h:86
struct transapi_rpc_callbacks::@0 callbacks[]
Definition: transapi.h:87
Definition: transapi.h:69
Definition: transapi.h:81
Definition: transapi.h:68
Definition: transapi.h:75
Definition: transapi.h:88
Functions to call if the specified file is modified.
Definition: transapi.h:195
Definition: transapi.h:91
NETCONF error handling functions.
Definition: transapi.h:74
Definition: transapi.h:97
Definition: transapi.h:80
const char * href
Definition: transapi.h:99
XMLDIFF_OP
Enum specifying states of node in document.
Definition: transapi.h:66
char * path
Definition: transapi.h:159
Definition: transapi.h:89
NC_EDIT_ERROPT_TYPE * erropt
edit-config's error-option for the current transaction
Definition: transapi.h:147
Definition: transapi.h:79
int(* func)(const char *, xmlDocPtr *, int *)
Definition: transapi.h:199
const char * path
Definition: transapi.h:198
Definition: transapi.h:71
TRANSAPI_CLBCKS_ORDER_TYPE clbks_order
Callbacks order settings.
Definition: transapi.h:127
struct transapi_file_callbacks * file_clbks
Transapi file monitoring structure.
Definition: transapi.h:151
int callbacks_count
Definition: transapi.h:196
void(* close)(void)
Free module resources and prepare for closing.
Definition: transapi.h:119
xmlDocPtr(* get_state)(const xmlDocPtr, const xmlDocPtr, struct nc_err **)
Function returning status information.
Definition: transapi.h:123
char * name
Definition: transapi.h:180
int callbacks_count
Definition: transapi.h:168
int * config_modified
Flag if configuration data passed to callbacks were modified.
Definition: transapi.h:143
Same as transapi_data_callbacks. Using libxml2 structures for callbacks parameters.
Definition: transapi.h:167
CLBCKS_APPLIED
Definition: transapi.h:84
struct transapi_rpc_callbacks * rpc_clbks
Transapi rpc callbacks mapping structure.
Definition: transapi.h:135
int callbacks_count
Definition: transapi.h:178
int(* func)(void **, XMLDIFF_OP, xmlNodePtr, xmlNodePtr, struct nc_err **)
Definition: transapi.h:160
Definition: transapi.h:90
struct ns_pair * ns_mapping
Mapping prefixes with URIs.
Definition: transapi.h:139
int version
transapi version of the module
Definition: transapi.h:111
libnetconf's general public functions and structures definitions.
TRANSAPI_CLBCKS_ORDER_TYPE
Definition: transapi.h:78
Structure describing callback - path + function.
Definition: transapi.h:158
Structure to describe transAPI module and connect it statically with libnetconf using ncds_new_transa...
Definition: transapi.h:107
int(* init)(xmlDocPtr *)
Module initialization.
Definition: transapi.h:115
Definition: transapi.h:70