yumapro  20.10-12
YumaPro SDK
db_api_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_db_api_types
13 #define _H_db_api_types
14 
15 /* FILE: db_api_types.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 18-nov-14 abb Begun
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_dlq
42 #include "dlq.h"
43 #endif
44 
45 #ifndef _H_ncxtypes
46 #include "ncxtypes.h"
47 #endif
48 
49 #ifndef _H_obj
50 #include "obj.h"
51 #endif
52 
53 #ifndef _H_rpc
54 #include "rpc.h"
55 #endif
56 
57 #ifndef _H_status_enum
58 #include "status_enum.h"
59 #endif
60 
61 #ifndef _H_val
62 #include "val.h"
63 #endif
64 
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
70 /********************************************************************
71 * *
72 * C O N S T A N T S *
73 * *
74 *********************************************************************/
75 
76 
88 /********************************************************************
89 * *
90 * T Y P E S *
91 * *
92 *********************************************************************/
93 
95 typedef enum db_api_state_t_ {
98 
101 
104 
107 
110 
113 
116 
119 
122 
125 } db_api_state_t;
126 
127 
129 typedef enum lock_state_t_ {
132 
135 
138 
141 
144 
147 } lock_state_t;
148 
149 
151 typedef struct db_api_cb_t_ {
153  ncx_module_t *mod;
154 
156  obj_template_t *obj;
157 
159  val_value_t *payload;
160 
162  db_api_state_t state;
163 
165  uint32 msgid;
166 
168  val_value_t *edit_request;
169 
171  rpc_msg_t *rpc_msg;
172 
174  uint32 last_msgid;
175 
177  status_t last_status;
178 
180  xmlChar *last_msg;
181 
183  xmlChar *filespec;
184 
186  const char *cmdname;
187 
190 
192  lock_state_t db_lock_state;
193 
195  xmlChar *lock_id;
196 } db_api_cb_t;
197 
198 
203 #ifdef __cplusplus
204 } /* end extern 'C' */
205 #endif
206 
207 #endif /* _H_db_api_types */
db_api_cb_t_::last_msgid
uint32 last_msgid
edit or getconfig in progress state
Definition: db_api_types.h:174
db_api_cb_t_::mod
ncx_module_t * mod
yumaworks-db-api YANG module
Definition: db_api_types.h:153
db_api_cb_t_::db_lock_enabled
boolean db_lock_enabled
db-lock is enabled
Definition: db_api_types.h:189
db_api_cb_t_::rpc_msg
rpc_msg_t * rpc_msg
dummy msg used for DB-API callback functions
Definition: db_api_types.h:171
val.h
Value Node Basic Support.
LOCK_ST_IDLE
@ LOCK_ST_IDLE
ready for use
Definition: db_api_types.h:137
db_api_cb_t_::last_msg
xmlChar * last_msg
saved last message (malloced string)
Definition: db_api_types.h:180
status_enum.h
global error status code enumerations
DB_API_ST_WAIT_EDIT
@ DB_API_ST_WAIT_EDIT
DB-API is waiting for a server response to an edit request.
Definition: db_api_types.h:119
db_api_cb_t_::edit_request
val_value_t * edit_request
cached <edit-request> message body
Definition: db_api_types.h:168
db_api_state_t_
db_api_state_t_
DB-API service state machine enumerations.
Definition: db_api_types.h:95
DB_API_ST_WAIT_DB_LOCK_INIT
@ DB_API_ST_WAIT_DB_LOCK_INIT
DB-API is waiting for a server response to a db-lock init request.
Definition: db_api_types.h:125
DB_API_ST_NONE
@ DB_API_ST_NONE
not set
Definition: db_api_types.h:101
DB_API_ST_WAIT_REGISTER
@ DB_API_ST_WAIT_REGISTER
DB-API waiting for reply to register.
Definition: db_api_types.h:113
db_api_cb_t_::cmdname
const char * cmdname
back-ptr to command name
Definition: db_api_types.h:186
DB_API_ST_READY
@ DB_API_ST_READY
DB-API is ready for using request APIs.
Definition: db_api_types.h:116
LOCK_ST_WAIT_INIT
@ LOCK_ST_WAIT_INIT
waiting for server response to init request
Definition: db_api_types.h:134
DB_API_ST_START
@ DB_API_ST_START
DB-API is starting up.
Definition: db_api_types.h:104
LOCK_ST_ERROR
@ LOCK_ST_ERROR
db-lock error state
Definition: db_api_types.h:146
db_api_cb_t_::last_status
status_t last_status
last message status
Definition: db_api_types.h:177
rpc.h
NETCONF protocol remote procedure call common definitions.
DB_API_ST_ERROR
@ DB_API_ST_ERROR
DB-API in error state.
Definition: db_api_types.h:110
db_api_cb_t_
internal control block for the DB-API module
Definition: db_api_types.h:151
db_api_cb_t_::filespec
xmlChar * filespec
getconfig in progress state, last filespec (malloced string)
Definition: db_api_types.h:183
db_api_cb_t_::lock_id
xmlChar * lock_id
current lock-id if locked (malloced string)
Definition: db_api_types.h:195
DB_API_ST_STOPPED
@ DB_API_ST_STOPPED
DB-API is stopped.
Definition: db_api_types.h:107
db_api_cb_t_::state
db_api_state_t state
DB-API module state.
Definition: db_api_types.h:162
db_api_cb_t_::obj
obj_template_t * obj
<db-api> object within the /ycontrol/payload object
Definition: db_api_types.h:156
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
db_api_cb_t_::db_lock_state
lock_state_t db_lock_state
current db-lock state if enabled
Definition: db_api_types.h:192
LOCK_ST_LOCAL_LOCKED
@ LOCK_ST_LOCAL_LOCKED
currently locked by a local system user
Definition: db_api_types.h:140
DB_API_ST_WAIT_GETCONFIG
@ DB_API_ST_WAIT_GETCONFIG
DB-API is waiting for a server response to a get request.
Definition: db_api_types.h:122
LOCK_ST_SERVER_LOCKED
@ LOCK_ST_SERVER_LOCKED
currently locked by the main server
Definition: db_api_types.h:143
db_api_cb_t_::msgid
uint32 msgid
request msgid that is expected in the response
Definition: db_api_types.h:165
obj.h
Data Object Support.
lock_state_t_
lock_state_t_
db-lock state enumerations
Definition: db_api_types.h:129
DB_API_ST_WAIT_SUBRPC
@ DB_API_ST_WAIT_SUBRPC
DB-API is waiting for a server response to a subrpc request.
Definition: db_api_types.h:128
db_api_cb_t_::payload
val_value_t * payload
cached <payload> element for use in request messages
Definition: db_api_types.h:159
LOCK_ST_NONE
@ LOCK_ST_NONE
not set
Definition: db_api_types.h:131
dlq.h
dlq provides general double-linked list and queue support: