yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
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
34date init comment
35----------------------------------------------------------------------
3618-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
67extern "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
95typedef enum db_api_state_t_ {
98
101
104
107
110
113
116
119
122
125
127
128
130typedef enum lock_state_t_ {
133
136
139
142
145
149
150
151
168typedef void (*db_api_dataresp_cbfn_t) (status_t res,
169 val_value_t *val,
170 void *cookie);
171
172
173
175typedef struct db_api_cb_t_ {
178
181
184
187
189 uint32 msgid;
190
193
196
199
202
204 xmlChar *last_msg;
205
207 xmlChar *filespec;
208
211
213 void *cookie;
214
216 const char *cmdname;
217
220
223
225 xmlChar *lock_id;
227
228
233#ifdef __cplusplus
234} /* end extern 'C' */
235#endif
236
237#endif /* _H_db_api_types */
dlq provides general double-linked list and queue support:
void(* db_api_dataresp_cbfn_t)(status_t res, val_value_t *val, void *cookie)
user function callback template for processing the val_value_t tree for the server data response.
Definition: db_api_types.h:168
lock_state_t
db-lock state enumerations
Definition: db_api_types.h:130
db_api_state_t
DB-API service state machine enumerations.
Definition: db_api_types.h:95
@ LOCK_ST_WAIT_INIT
waiting for server response to init request
Definition: db_api_types.h:135
@ LOCK_ST_NONE
not set
Definition: db_api_types.h:132
@ LOCK_ST_ERROR
db-lock error state
Definition: db_api_types.h:147
@ LOCK_ST_IDLE
ready for use
Definition: db_api_types.h:138
@ LOCK_ST_LOCAL_LOCKED
currently locked by a local system user
Definition: db_api_types.h:141
@ LOCK_ST_SERVER_LOCKED
currently locked by the main server
Definition: db_api_types.h:144
@ DB_API_ST_WAIT_SUBRPC
DB-API is waiting for a server response to a subrpc request.
Definition: db_api_types.h:124
@ DB_API_ST_NONE
not set
Definition: db_api_types.h:97
@ DB_API_ST_WAIT_EDIT
DB-API is waiting for a server response to an edit request.
Definition: db_api_types.h:115
@ DB_API_ST_ERROR
DB-API in error state.
Definition: db_api_types.h:106
@ DB_API_ST_WAIT_GETCONFIG
DB-API is waiting for a server response to a get request.
Definition: db_api_types.h:118
@ DB_API_ST_STOPPED
DB-API is stopped.
Definition: db_api_types.h:103
@ DB_API_ST_WAIT_REGISTER
DB-API waiting for reply to register.
Definition: db_api_types.h:109
@ DB_API_ST_READY
DB-API is ready for using request APIs.
Definition: db_api_types.h:112
@ DB_API_ST_START
DB-API is starting up.
Definition: db_api_types.h:100
@ 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:121
status_t
global error return code
Definition: status_enum.h:210
YANG module data structures Many internal representations of YANG module constructs.
Data Object Support.
NETCONF protocol remote procedure call common definitions.
global error status code enumerations
internal control block for the DB-API module
Definition: db_api_types.h:175
const char * cmdname
back-ptr to command name
Definition: db_api_types.h:216
obj_template_t * obj
<db-api> object within the /ycontrol/payload object
Definition: db_api_types.h:180
boolean db_lock_enabled
db-lock is enabled
Definition: db_api_types.h:219
xmlChar * last_msg
saved last message (malloced string)
Definition: db_api_types.h:204
void * cookie
cookie parameter for the get response callback function
Definition: db_api_types.h:213
xmlChar * lock_id
current lock-id if locked (malloced string)
Definition: db_api_types.h:225
uint32 msgid
request msgid that is expected in the response
Definition: db_api_types.h:189
status_t last_status
last message status
Definition: db_api_types.h:201
ncx_module_t * mod
yumaworks-db-api YANG module
Definition: db_api_types.h:177
lock_state_t db_lock_state
current db-lock state if enabled
Definition: db_api_types.h:222
db_api_state_t state
DB-API module state.
Definition: db_api_types.h:186
db_api_dataresp_cbfn_t cbfn
getconfig callback function, instead of filespec
Definition: db_api_types.h:210
uint32 last_msgid
edit or getconfig in progress state
Definition: db_api_types.h:198
xmlChar * filespec
getconfig in progress state, last filespec (malloced string)
Definition: db_api_types.h:207
val_value_t * payload
cached <payload> element for use in request messages
Definition: db_api_types.h:183
val_value_t * edit_request
cached <edit-request> message body
Definition: db_api_types.h:192
rpc_msg_t * rpc_msg
dummy msg used for DB-API callback functions
Definition: db_api_types.h:195
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1134
One YANG data-def-stmt.
Definition: obj.h:1209
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
one value to match one type
Definition: val.h:911
Value Node Basic Support.