yumapro  25.10-1
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 - 2025, 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#ifndef _H_yang_patch
66#include "yang_patch.h"
67#endif
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73/********************************************************************
74* *
75* C O N S T A N T S *
76* *
77*********************************************************************/
78
79
91/********************************************************************
92* *
93* T Y P E S *
94* *
95*********************************************************************/
96
98typedef enum db_api_state_t_ {
101
104
107
110
113
116
119
122
125
128
131
133
134
136typedef enum lock_state_t_ {
139
142
145
148
151
155
156
157
174typedef void (*db_api_dataresp_cbfn_t) (status_t res,
175 val_value_t *val,
176 void *cookie);
177
178
179
181typedef struct db_api_cb_t_ {
184
187
190
193
195 uint32 msgid;
196
199
202
205
208
210 xmlChar *last_msg;
211
213 xmlChar *filespec;
214
217
219 void *cookie;
220
222 const char *cmdname;
223
226
229
231 xmlChar *lock_id;
233
234
235
237typedef struct db_api_edit_cb_t_ {
238
240 const xmlChar *edit_target;
241
243 const xmlChar *edit_operation;
244
247
251 const xmlChar *insert_point;
252
259 const xmlChar *insert_where;
260
263
265 const xmlChar *patch_id_str;
266
268 const xmlChar *comment_str;
269
273 const xmlChar *edit_value;
274
276 const xmlChar *datastore_str;
277
279 const xmlChar *edit_id_str;
280
283
286
291 boolean skip_sil;
292
298 boolean system_edit;
299
301 boolean oper_edit;
302
304
305
310#ifdef __cplusplus
311} /* end extern 'C' */
312#endif
313
314#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:174
lock_state_t
db-lock state enumerations
Definition: db_api_types.h:136
db_api_state_t
DB-API service state machine enumerations.
Definition: db_api_types.h:98
@ LOCK_ST_WAIT_INIT
waiting for server response to init request
Definition: db_api_types.h:141
@ LOCK_ST_NONE
not set
Definition: db_api_types.h:138
@ LOCK_ST_ERROR
db-lock error state
Definition: db_api_types.h:153
@ LOCK_ST_IDLE
ready for use
Definition: db_api_types.h:144
@ LOCK_ST_LOCAL_LOCKED
currently locked by a local system user
Definition: db_api_types.h:147
@ LOCK_ST_SERVER_LOCKED
currently locked by the main server
Definition: db_api_types.h:150
@ DB_API_ST_WAIT_SUBRPC
DB-API is waiting for a server response to a subrpc request.
Definition: db_api_types.h:127
@ DB_API_ST_WAIT_PROTOCTL
DB-API is waiting for a server response to a protocol-control request.
Definition: db_api_types.h:130
@ DB_API_ST_NONE
not set
Definition: db_api_types.h:100
@ DB_API_ST_WAIT_EDIT
DB-API is waiting for a server response to an edit request.
Definition: db_api_types.h:118
@ DB_API_ST_ERROR
DB-API in error state.
Definition: db_api_types.h:109
@ DB_API_ST_WAIT_GETCONFIG
DB-API is waiting for a server response to a get request.
Definition: db_api_types.h:121
@ DB_API_ST_STOPPED
DB-API is stopped.
Definition: db_api_types.h:106
@ DB_API_ST_WAIT_REGISTER
DB-API waiting for reply to register.
Definition: db_api_types.h:112
@ DB_API_ST_READY
DB-API is ready for using request APIs.
Definition: db_api_types.h:115
@ DB_API_ST_START
DB-API is starting up.
Definition: db_api_types.h:103
@ 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:124
yang_patch_where_t
YANG Patch insert location.
Definition: yang_patch.h:108
yang_patch_op_t
YANG Patch operation type.
Definition: yang_patch.h:87
status_t
global error return code
Definition: status_enum.h:219
ncx_msg_encoding_t
enumeration for message encoding formats
Definition: ncxtypes.h:648
ncx_instfmt_t
instance identifier string format types
Definition: ncxtypes.h:562
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:181
const char * cmdname
back-ptr to command name
Definition: db_api_types.h:222
obj_template_t * obj
<db-api> object within the /ycontrol/payload object
Definition: db_api_types.h:186
boolean db_lock_enabled
db-lock is enabled
Definition: db_api_types.h:225
xmlChar * last_msg
saved last message (malloced string)
Definition: db_api_types.h:210
void * cookie
cookie parameter for the get response callback function
Definition: db_api_types.h:219
xmlChar * lock_id
current lock-id if locked (malloced string)
Definition: db_api_types.h:231
uint32 msgid
request msgid that is expected in the response
Definition: db_api_types.h:195
status_t last_status
last message status
Definition: db_api_types.h:207
ncx_module_t * mod
yumaworks-db-api YANG module
Definition: db_api_types.h:183
lock_state_t db_lock_state
current db-lock state if enabled
Definition: db_api_types.h:228
db_api_state_t state
DB-API module state.
Definition: db_api_types.h:192
db_api_dataresp_cbfn_t cbfn
getconfig callback function, instead of filespec
Definition: db_api_types.h:216
uint32 last_msgid
edit or getconfig in progress state
Definition: db_api_types.h:204
xmlChar * filespec
getconfig in progress state, last filespec (malloced string)
Definition: db_api_types.h:213
val_value_t * payload
cached <payload> element for use in request messages
Definition: db_api_types.h:189
val_value_t * edit_request
cached <edit-request> message body
Definition: db_api_types.h:198
rpc_msg_t * rpc_msg
dummy msg used for DB-API callback functions
Definition: db_api_types.h:201
internal control block for the DB-API EDIT processing
Definition: db_api_types.h:237
yang_patch_where_t where_enum
Enum value of the where parameter in YANG-PATCH format.
Definition: db_api_types.h:262
boolean skip_sil
indicates whether to skip callback or not.
Definition: db_api_types.h:291
boolean system_edit
indicates whether to skip callback or not.
Definition: db_api_types.h:298
const xmlChar * insert_where
insert_where parameter: "before" "after" "first" "last"
Definition: db_api_types.h:259
yang_patch_op_t patch_op
edit operation from request in YANG-PATCH format
Definition: db_api_types.h:246
const xmlChar * edit_target
target resource (YANG-API path expression)
Definition: db_api_types.h:240
const xmlChar * comment_str
comment string to be used in YANG-PATCH comment section
Definition: db_api_types.h:268
const xmlChar * patch_id_str
edit operation (create merge replace delete remove)
Definition: db_api_types.h:265
const xmlChar * datastore_str
Identifies the datastore value as a string.
Definition: db_api_types.h:276
const xmlChar * edit_operation
edit operation (create merge replace delete remove)
Definition: db_api_types.h:243
boolean oper_edit
indicates whether the edit is on operational datastore or not
Definition: db_api_types.h:301
const xmlChar * edit_id_str
index value for the edit
Definition: db_api_types.h:279
const xmlChar * edit_value
payload in string form, whitespace allowed (XML | JSON | CBOR?) MAY BE NULL if no value required (del...
Definition: db_api_types.h:273
ncx_instfmt_t edit_id_format
Identifies the instance identifier string format types.
Definition: db_api_types.h:285
const xmlChar * insert_point
is a string like the target except a different instance of the same list of leaf-list; only for befor...
Definition: db_api_types.h:251
ncx_msg_encoding_t edit_encoding
encoding that represents corresponding encoding type
Definition: db_api_types.h:282
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1118
One YANG data-def-stmt.
Definition: obj.h:1284
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:185
one value to match one type
Definition: val.h:939
Value Node Basic Support.
YANG Patch Media Type.