yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
db_api.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2024, 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
13#define _H_db_api
14
15/* FILE: db_api.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_db_api_types
42#include "db_api_types.h"
43#endif
44
45#ifndef _H_rpc
46#include "rpc.h"
47#endif
48
49#ifndef _H_val
50#include "val.h"
51#endif
52
53#ifndef _H_yang_patch
54#include "yang_patch.h"
55#endif
56
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62
83/********************************************************************
84* *
85* C O N S T A N T S *
86* *
87*********************************************************************/
88
90#define DB_API (const xmlChar *)"db-api"
91
93#define DB_API_MOD (const xmlChar *)"yumaworks-db-api"
94
96#define DB_API_OBJ (const xmlChar *)"db-api"
97
99#define DB_API_REQ_OK(ST) (ST >= DB_API_ST_READY)
100
101
102/********************************************************************
103* *
104* T Y P E S *
105* *
106*********************************************************************/
107
108
109/********************************************************************
110* *
111* F U N C T I O N S *
112* *
113*********************************************************************/
114
115
123extern status_t
125
126
136extern status_t
137 db_api_register_service_ex (boolean with_db_lock);
138
139
146extern boolean
148
149
194extern status_t
195 db_api_send_edit (const xmlChar *edit_target,
196 const xmlChar *edit_operation,
197 const xmlChar *edit_xml_value);
198
199
230extern status_t
231 db_api_send_edit_ex (const xmlChar *edit_target,
232 const xmlChar *edit_operation,
233 const xmlChar *edit_xml_value,
234 const xmlChar *patch_id_str,
235 boolean system_edit);
236
237
304extern status_t
305 db_api_send_edit_full (const xmlChar *edit_target,
306 const xmlChar *edit_operation,
307 const xmlChar *edit_xml_value,
308 const xmlChar *patch_id_str,
309 boolean system_edit,
310 const xmlChar *insert_point,
311 const xmlChar *insert_where);
312
313
381extern status_t
382 db_api_send_edit_full2 (const xmlChar *edit_target,
383 const xmlChar *edit_operation,
384 const xmlChar *edit_xml_value,
385 const xmlChar *patch_id_str,
386 boolean system_edit,
387 const xmlChar *insert_point,
388 const xmlChar *insert_where,
389 boolean skip_sil);
390
391
404extern status_t
405 db_api_check_edit (void);
406
407
425extern status_t
426 db_api_check_edit_ex (const xmlChar **errstr);
427
428
429
439extern status_t
440 db_api_send_getconfig (const xmlChar *filespec,
441 boolean withdef);
442
443
457extern status_t
458 db_api_send_getfilter (const xmlChar *filespec,
459 boolean withdef,
460 boolean get_config,
461 const xmlChar *xpath_filter);
462
463
482extern status_t
484 void *cookie,
485 boolean withdef,
486 boolean get_config,
487 const xmlChar *xpath_filter);
488
489
512extern status_t
513 db_api_start_patch (const xmlChar *patch_id_str,
514 boolean system_edit,
515 yang_patch_cb_t **retcb);
516
517
518
546extern status_t
547 db_api_start_patch2 (const xmlChar *patch_id_str,
548 boolean system_edit,
549 boolean skip_sil,
550 const xmlChar *comment,
551 yang_patch_cb_t **retcb);
552
553
574extern status_t
576 const xmlChar *edit_id_str,
577 const xmlChar *edit_target,
578 const xmlChar *edit_operation,
579 const xmlChar *edit_xml_value,
580 const xmlChar *insert_point,
581 const xmlChar *insert_where);
582
583
592extern status_t
594
595
601extern void
603
604
612extern status_t
614
615
624extern status_t
625 db_api_send_enter_maintmode_ex (boolean read_ok,
626 boolean operation_ok);
627
628
634extern status_t
636
637
644extern status_t
645 db_api_send_set_loglevel (const char *dlevel);
646
647
653extern status_t
655
656
662extern status_t
664
665
680extern status_t
681 db_api_send_subrpc_request (const xmlChar *user_id,
682 const xmlChar *rpc_modname,
683 const xmlChar *rpc_name,
684 const xmlChar *in_filespec,
685 const xmlChar *out_filespec);
686
687
688
689
690
698extern status_t
700
701
702
712extern status_t
713 db_api_send_protocol_control (const xmlChar *action,
714 const xmlChar *protocol);
715
716
717
723extern uint32
725
726
727
731#ifdef __cplusplus
732} /* end extern 'C' */
733#endif
734
735#endif /* _H_db_api */
Data structures for DB-API service layer.
status_t db_api_send_edit(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2434
status_t db_api_send_ypha_request(val_value_t *msgval)
Create a <yp-ha-mode> request and send it to the main server.
Definition: db_api.c:3785
status_t db_api_send_edit_ex(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2493
uint32 db_api_get_last_msg_id(void)
API to get the last message ID sent by the db-api system.
Definition: db_api.c:3867
status_t db_api_send_exit_maintmode(void)
Create a <exit-maintmode> request and send it to the main server.
Definition: db_api.c:3569
status_t db_api_send_set_loglevel(const char *dlevel)
Create a <set-log-level> request and send it to the main server.
Definition: db_api.c:3588
status_t db_api_send_edit_full2(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit, const xmlChar *insert_point, const xmlChar *insert_where, boolean skip_sil)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2651
status_t db_api_start_patch(const xmlChar *patch_id_str, boolean system_edit, yang_patch_cb_t **retcb)
Start a YANG Patch request that can have multiple edits.
Definition: db_api.c:2895
void db_api_free_patch(yang_patch_cb_t *pcb)
Free a patch control block.
Definition: db_api.c:3508
status_t db_api_start_patch2(const xmlChar *patch_id_str, boolean system_edit, boolean skip_sil, const xmlChar *comment, yang_patch_cb_t **retcb)
Start a YANG Patch request that can have multiple edits with complete parameters (YPW-1826)
Definition: db_api.c:2931
status_t db_api_send_protocol_control(const xmlChar *action, const xmlChar *protocol)
Create a <protocol-control> request and send it to the main server.
Definition: db_api.c:3824
status_t db_api_check_edit_ex(const xmlChar **errstr)
Check on the status of an edit in progress.
Definition: db_api.c:3144
status_t db_api_send_subrpc_request(const xmlChar *user_id, const xmlChar *rpc_modname, const xmlChar *rpc_name, const xmlChar *in_filespec, const xmlChar *out_filespec)
Create a <subrpc-request> request and send it to the main server.
Definition: db_api.c:3724
status_t db_api_send_enter_maintmode(void)
Create a <enter-maintmode> request and send it to the main server.
Definition: db_api.c:3527
status_t db_api_request_local_db_lock(void)
API to request that the local system has the Db-Edit-Lock.
Definition: db_api.c:3608
status_t db_api_release_local_db_lock(void)
API to release the local system Db-Edit-Lock.
Definition: db_api.c:3661
status_t db_api_send_getconfig(const xmlChar *filespec, boolean withdef)
Create a <getconfig> request and send it to the main server.
Definition: db_api.c:3196
status_t db_api_send_getfilter(const xmlChar *filespec, boolean withdef, boolean get_config, const xmlChar *xpath_filter)
Retrieve data from the server with complete parameters.
Definition: db_api.c:3222
status_t db_api_send_getfilter_cb(db_api_dataresp_cbfn_t cbfn, void *cookie, boolean withdef, boolean get_config, const xmlChar *xpath_filter)
Retrieve data from the server with user callback.
Definition: db_api.c:3283
status_t db_api_send_enter_maintmode_ex(boolean read_ok, boolean operation_ok)
Create a <enter-maintmode> request and send it to the main server.
Definition: db_api.c:3549
status_t db_api_send_patch(yang_patch_cb_t *pcb)
Send a previously created patch request.
Definition: db_api.c:3337
status_t db_api_register_service(void)
Register the DB-API service with the YControl layer.
Definition: db_api.c:2327
status_t db_api_send_edit_full(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit, const xmlChar *insert_point, const xmlChar *insert_where)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2569
status_t db_api_check_edit(void)
Check on the status of an edit in progress.
Definition: db_api.c:3114
status_t db_api_register_service_ex(boolean with_db_lock)
Register the DB-API service with the YControl layer.
Definition: db_api.c:2341
boolean db_api_service_ready(void)
Check if the DB-API service is done initializing, and is now ready to send requests to the server.
Definition: db_api.c:2390
status_t db_api_add_edit(yang_patch_cb_t *pcb, const xmlChar *edit_id_str, const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *insert_point, const xmlChar *insert_where)
Create an edit request and add to YANG Patch in progress.
Definition: db_api.c:3037
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:171
status_t
global error return code
Definition: status_enum.h:210
NETCONF protocol remote procedure call common definitions.
one value to match one type
Definition: val.h:912
One YANG Patch Request.
Definition: yang_patch.h:155
Value Node Basic Support.
YANG Patch Media Type.