yumapro  23.10T-9
YumaPro SDK
Loading...
Searching...
No Matches
getcb.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2023, 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_getcb
13#define _H_getcb
14
15/* FILE: getcb.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
27/*********************************************************************
28* *
29* C H A N G E H I S T O R Y *
30* *
31*********************************************************************
32
33date init comment
34----------------------------------------------------------------------
3516-apr-07 abb Begun; split out from agt_ps.h
36
37*/
38
39#ifndef _H_ncxconst
40#include "ncxconst.h"
41#endif
42
43#ifndef _H_obj
44#include "obj.h"
45#endif
46
47#ifndef _H_rpc
48#include "rpc.h"
49#endif
50
51#ifndef _H_ses
52#include "ses.h"
53#endif
54
55#ifndef _H_status_enum
56#include "status_enum.h"
57#endif
58
59#ifndef _H_val
60#include "val.h"
61#endif
62
63#ifndef _H_val_util
64#include "val_util.h"
65#endif
66
67#ifdef __cplusplus
68extern "C" {
69#endif
70
71
103/********************************************************************
104* *
105* C O N S T A N T S *
106* *
107*********************************************************************/
108
109/* input parameter macros */
110#define GETCB_GET2_TXID_STR(G) (G)->txid_str
111#define GETCB_GET2_OBJ(G) (G)->obj
112#define GETCB_GET2_TESTFN(G) (G)->testfn
113#define GETCB_GET2_KEYQ(G) &(G)->keyQ
114#define GETCB_GET2_MATCHQ(G) &(G)->matchQ
115#define GETCB_GET2_SELECTQ(G) &(G)->selectQ
116#define GETCB_GET2_RETURN_KEYQ(G) &(G)->return_keyQ
117#define GETCB_GET2_RETURN_VALQ(G) &(G)->return_valQ
118#define GETCB_GET2_GETBULKQ(G) &(G)->getbulkQ
119#define GETCB_GET2_CBMODE(G) (G)->cbmode
120#define GETCB_GET2_MAX_ENTRIES(G) (G)->max_entries
121#define GETCB_GET2_MAX_LEVELS(G) (G)->max_levels
122#define GETCB_GET2_OPER_DATA(G) (G)->oper_data
123#define GETCB_GET2_CONFIG_DATA(G) (G)->config_data
124#define GETCB_GET2_EXPAND_VAREXPR(G) (G)->expand_varexpr
125#define GETCB_GET2_KEYS_ONLY(G) (G)->keys_only
126#define GETCB_GET2_WITH_DEFAULTS(G) (G)->with_defaults
127#define GETCB_GET2_SELECT(G) (G)->select_only
128#define GETCB_GET2_API_MODE(G) (G)->api_mode
129#define GETCB_GET2_WITH_ORIGIN(G) (G)->with_origin
130
131/* internal state data macros */
132#define GETCB_GET2_START_ADD_KEY(G) (G)->start_add_key
133#define GETCB_GET2_ACMTEST_RESULT(G) (G)->acmtest_result
134#define GETCB_GET2_FIRST_SIBLING(G) (G)->first_sibling
135#define GETCB_GET2_FIRST_LL_SIBLING(G) (G)->first_llsibling
136#define GETCB_GET2_LAST_LL_SIBLING(G) (G)->last_llsibling
137#define GETCB_GET2_LAST_SIBLING(G) (G)->last_sibling
138#define GETCB_GET2_FIRST_CHILD(G) (G)->first_child
139#define GETCB_GET2_FIRST_NOKEY_CHILD(G) (G)->isfirst_nokey
140#define GETCB_GET2_FIRST(G) (G)->isfirst
141#define GETCB_GET2_LAST(G) (G)->islast
142#define GETCB_GET2_WROTE_LIST(G) (G)->wrote_some_lists
143#define GETCB_GET2_FINISH_LIST(G) (G)->finish_list
144
145/* return data macros */
146#define GETCB_GET2_MORE_DATA(G) (G)->more_data
147#define GETCB_GET2_ACTIVE_CASE_MODNAME(G) (G)->active_case_modname
148#define GETCB_GET2_ACTIVE_CASE(G) (G)->active_case
149#define GETCB_GET2_PARENT_VAL(G) (G)->parent_val
150#define GETCB_GET2_PARENT_CB(G) (G)->parent_cb
151#define GETCB_GET2_REMOVE_KEY(G,C) dlq_remove(C)
152#define GETCB_GET2_REMOVE_MATCH(G,C) dlq_remove(C)
153#define GETCB_GET2_REMOVE_VAL(G,C) dlq_remove(C)
154
155
156#define GETCB_GET2_FIRST_KEY(G) \
157 (val_value_t *)dlq_firstEntry(&(G)->keyQ)
158
159#define GETCB_GET2_NEXT_KEY(G,C) \
160 (val_value_t *)dlq_nextEntry(C)
161
162#define GETCB_GET2_FIRST_MATCH(G) \
163 (val_value_t *)dlq_firstEntry(&(G)->matchQ)
164
165#define GETCB_GET2_NEXT_MATCH(G,C) \
166 (val_value_t *)dlq_nextEntry(C)
167
168#define GETCB_GET2_FIRST_SELECT(G) \
169 (getcb_get2_select_t *)dlq_firstEntry(&(G)->selectQ)
170
171#define GETCB_GET2_NEXT_SELECT(G,C) \
172 (getcb_get2_select_t *)dlq_nextEntry(C)
173
174#define GETCB_GET2_MATCH_TEST_DONE(G) (G)->match_test_done
175
176#define GETCB_GET2_RETURN_VAL(G) &(G)->return_val
177
178#define GETCB_GET2_RETURN_VAL_SET(G) \
179 ((G)->return_val.btyp != NCX_BT_NONE)
180
181#define GETCB_GET2_FIRST_RETURN_KEY(G) \
182 (val_value_t *)dlq_firstEntry(&(G)->return_keyQ)
183
184#define GETCB_GET2_NEXT_RETURN_KEY(G,C) \
185 (val_value_t *)dlq_nextEntry(C)
186
187#define GETCB_GET2_FIRST_RETURN_VAL(G) \
188 (val_value_t *)dlq_firstEntry(&(G)->return_valQ)
189
190#define GETCB_GET2_NEXT_RETURN_VAL(G,C) \
191 (val_value_t *)dlq_nextEntry(C)
192
193#define GETCB_GET2_RESPONSEQ(G) &(G)->responseQ
194
195#define GETCB_GET2_FIRST_RESPONSE(G) \
196 (getcb_get2_t *)dlq_firstEntry(&(G)->responseQ)
197
198#define GETCB_GET2_NEXT_RESPONSE(G,C) \
199 (getcb_get2_t *)dlq_nextEntry(C)
200
201#define GETCB_GET2_REMOVE_RESPONSE(G,C) dlq_remove(C)
202
203
204#define GETCB_GET2_FIRST_GETBULK(G) \
205 (getcb_get2_getbulk_t *)dlq_firstEntry(&(G)->getbulkQ)
206
207#define GETCB_GET2_NEXT_GETBULK(G,C) \
208 (getcb_get2_getbulk_t *)dlq_nextEntry(C)
209
210#define GETCB_GET2_DATASTORE(G) (G)->nmda_ds
211
212#define GETCB_GET2_ORIGIN(G) (G)->nmda_origin
213
214
215/* All in One Queue Macros */
216#define GETCB_GET2_RETURN_AIOQ(G) &(G)->return_aioQ
217#define GETCB_AIO_ENCODING(G) (G)->aio_encoding
218#define GETCB_AIO_BUFFER(G) (G)->aio_return_buff
219
220#define GETCB_GET2_FIRST_RETURN_AIO_VAL(G) \
221 (val_value_t *)dlq_firstEntry(&(G)->return_aioQ)
222
223#define GETCB_GET2_NEXT_RETURN_AIO_VAL(C) \
224 (val_value_t *)dlq_nextEntry(C)
225
226#define GETCB_GET2_USER_DATA_REF(G) (G)->user_data_ref
227
228#define GETCB_GET2_USER_DATA_INDEX(G) (G)->user_data_index
229
230/* Schema mount MPID field
231 * The parameter G is a getcb_get2_t *
232 */
233#define GETCB_GET2_SM_MPID(G) (G)->sm_mpid
234
239#define GETCB_GET2_SM_MPID_MALLOCED(G) (G)->sm_mpid_malloced
240
241#define GETCB_FLAG_KEYS (const xmlChar *)"keys"
242#define GETCB_FLAG_CONFIG (const xmlChar *)"config"
243#define GETCB_FLAG_OPER (const xmlChar *)"oper"
244#define GETCB_FLAG_GETNEXT (const xmlChar *)"getnext"
245#define GETCB_FLAG_WITHDEF (const xmlChar *)"withdef"
246#define GETCB_FLAG_SELECT (const xmlChar *)"select"
247#define GETCB_FLAG_WITH_ORIGIN (const xmlChar *)"with-origin"
248
249
250/********************************************************************
251* *
252* T Y P E S *
253* *
254*********************************************************************/
255
257typedef enum getcb_mode_t_ {
262
263
264/* get2 walker callback modes for the 'normal' API mode */
265typedef enum getcb_api_mode_t_ {
266 GETCB_API_MODE_NONE,
267 GETCB_API_MODE_NORMAL,
268 GETCB_API_MODE_1SHOT,
269 GETCB_API_MODE_CHOICE,
270 GETCB_API_MODE_CONFIG_NODE, // config=true node
271 GETCB_API_MODE_ALL_IN_ONE, // All in One retrieval
272 GETCB_API_MODE_ALL_IN_ONE_1SHOT
273} getcb_api_mode_t;
274
275
277typedef enum getcb_walker_mode_t_ {
278 GETCB_WALK_MODE_NONE,
279
280 /* get2 walker callback modes for the 'normal' API mode */
281 GETCB_WALK_MODE_START,
282 GETCB_WALK_MODE_TERM,
283 GETCB_WALK_MODE_END,
284
285 /* get2 walker callback mode for the '1shot' API mode */
286 GETCB_WALK_MODE_1SHOT,
287
288 /* get2 walker callback mode for pre-get choices API mode */
289 GETCB_WALK_MODE_CHOICE
291
292
294typedef enum getcb_walker_status_t_ {
295 GETCB_WALK_STAT_NONE,
296 GETCB_WALK_STAT_CONTINUE,
297 GETCB_WALK_STAT_STOP_INSTANCE,
298 GETCB_WALK_STAT_STOP_OBJECT,
299 GETCB_WALK_STAT_STOP_WALK
301
302
307typedef struct getcb_keyval_t_ {
308 dlq_hdr_t qhdr;
309 xmlChar *value;
312 boolean fixed_value;
314
315
317typedef struct getcb_get2_lookup_t_ {
318 dlq_hdr_t qhdr;
320 dlq_hdr_t keyvalQ;
321 boolean full_lookup;
323
324
326typedef struct getcb_get2_select_t_ {
327 dlq_hdr_t qhdr;
328 const xmlChar *modname;
329 const xmlChar *objname;
331
332
343typedef struct getcb_get2_getbulk_t_ {
344 dlq_hdr_t qhdr;
347 dlq_hdr_t return_keyQ;
348
350 dlq_hdr_t return_valQ;
352
353
355typedef struct getcb_get2_t_ {
356 dlq_hdr_t qhdr;
358 /********** I N P U T P A R A M E T E R S *******/
359
361 xmlChar *txid_str;
362
365
368
375 dlq_hdr_t keyQ;
376
381 dlq_hdr_t matchQ;
382
396 dlq_hdr_t selectQ;
400
405
410
412 boolean oper_data;
413
418 boolean config_data;
419
424
428 boolean keys_only;
429
433 boolean select_only;
434
441
458 getcb_api_mode_t api_mode;
459
461 boolean with_origin;
462
463 /********** I N T E R N A L S T A T E D A T A *******/
464
470
473
476
481
483 boolean islast;
484 boolean isfirst;
485 boolean aio_done;
488 boolean first_child;
493
497 boolean finish_list;
498
499 /********** C A L L B A C K R E T U R N D A T A *******/
500
505 boolean more_data;
506
511 dlq_hdr_t getbulkQ;
518 xmlChar *active_case;
519
521 dlq_hdr_t return_keyQ;
522
524 dlq_hdr_t return_valQ;
525
535
539 dlq_hdr_t responseQ; // Q of getcb_get2_t structs
540
548
554
557
558 struct getcb_get2_t_ *parent_cb;
559
567 dlq_hdr_t return_aioQ;
568
571
574
579
584
585
591
596
597
598 /******** C A L L B A C K S T A T E D A T A *******/
599
613
625
627
628
641typedef status_t
642 (*getcb_fn_t) (ses_cb_t *scb,
643 getcb_mode_t cbmode,
644 const val_value_t *virval,
645 val_value_t *dstval);
646
647
648
667typedef status_t
668 (*getcb_fn2_t) (ses_cb_t *scb,
669 xml_msg_hdr_t *msg,
670 getcb_get2_t *get2cb);
671
672
711 getcb_get2_t *get2cb,
712 obj_template_t *obj,
713 val_value_t *val,
714 void *cookie);
715
716
724extern void
726
727
734extern getcb_get2_t *
735 getcb_new_get2cb (void);
736
737
743extern void
745
746
753extern void
755 boolean reuse);
756
757
767extern void
769 val_value_t *val);
770
771
778extern val_value_t *
780 obj_template_t *obj);
781
782
792extern val_value_t *
794 xmlns_id_t obj_nsid,
795 const xmlChar *obj_name);
796
797
810extern val_value_t *
812 xmlns_id_t obj_nsid,
813 const xmlChar *obj_name,
814 const xmlChar *valstr);
815
816
824extern val_value_t *
826 val_value_t *curval);
827
828
838extern val_value_t *
840 obj_template_t *obj);
841
842
853extern val_value_t *
855 const xmlChar *modname,
856 const xmlChar *objname);
857
858
871extern val_value_t *
873 const xmlChar *modname,
874 const xmlChar *objname,
875 uint32 keynum);
876
877
889extern val_value_t *
891 const xmlChar *modname,
892 const xmlChar *objname,
893 uint32 objlvl);
894
895
903extern val_value_t *
905 obj_template_t *obj);
906
907
917extern void
919 val_value_t *val);
920
921
930extern void
932 val_value_t *val);
933
934
945extern status_t
947 const xmlChar *modname,
948 const xmlChar *objname);
949
950
961extern void
963 val_value_t *val);
964
965
973extern val_value_t *
975 obj_template_t *obj);
976
977
987extern val_value_t *
989 xmlns_id_t obj_nsid,
990 const xmlChar *obj_name);
991
992
999extern void
1001
1002
1008extern void
1010
1011
1017extern void
1019
1020
1034extern val_value_t *
1036 obj_template_t *get_request_obj,
1037 boolean preserve_data,
1038 xml_msg_hdr_t *msg,
1039 status_t *res);
1040
1041
1053extern getcb_get2_t *
1054 getcb_request_val_to_get2cb (val_value_t *get_request_val,
1055 boolean preserve_data,
1056 status_t *res);
1057
1058
1071extern val_value_t *
1073 obj_template_t *response_obj,
1074 boolean preserve_data,
1075 status_t *res);
1076
1077
1089extern getcb_get2_t *
1091 boolean preserve_data,
1092 status_t *res);
1093
1094
1102extern void
1104 getcb_get2_t *return_get2cb);
1105
1106
1114extern status_t
1115 getcb_move_response_get2cb (getcb_get2_t *response_get2cb,
1116 getcb_get2_t *get2cb);
1117
1118
1129extern status_t
1131 getcb_get2_t *get2cb,
1132 boolean replace_mode);
1133
1134
1156extern status_t
1158 xml_msg_hdr_t *msg,
1159 val_value_t *parentval,
1160 getcb_get2_t *parent_get2cb,
1161 obj_template_t *obj,
1162 boolean with_defaults,
1163 getcb_get2_walker_fn_t walkerfn,
1164 void *cookie);
1165
1166
1195extern status_t
1197 xml_msg_hdr_t *msg,
1198 val_value_t *parentval,
1199 getcb_get2_t *parent_get2cb,
1200 obj_template_t *obj,
1201 boolean with_defaults,
1202 getcb_get2_walker_fn_t walkerfn,
1203 void *cookie,
1204 getcb_get2_t *force_get2cb,
1205 getcb_api_mode_t api_mode);
1206
1207
1219extern status_t
1221 xml_msg_hdr_t *msg,
1222 val_nodetest_fn_t testfn,
1223 getcb_get2_t *get2cb);
1224
1225
1232extern getcb_keyval_t *
1233 getcb_new_keyval (const xmlChar *keyval);
1234
1235
1244extern getcb_keyval_t *
1246 obj_template_t *keyobj,
1247 boolean fixed_value);
1248
1249
1258extern getcb_keyval_t *
1259 getcb_new_keyval3 (const xmlChar *keyval,
1260 obj_template_t *keyobj,
1261 boolean fixed_value);
1262
1263
1264
1270extern void
1272
1273
1274
1280extern void
1281 getcb_clean_keyvalQ (dlq_hdr_t *que);
1282
1283
1291extern getcb_get2_lookup_t *
1293 dlq_hdr_t *keyvalQ);
1294
1295
1301extern void
1303
1304
1310extern void
1311 getcb_clean_get2_lookupQ (dlq_hdr_t *lookupQ);
1312
1313
1321extern getcb_get2_lookup_t *
1323 dlq_hdr_t *lookupQ);
1324
1325
1333extern getcb_get2_select_t *
1334 getcb_new_get2_select (const xmlChar *modname,
1335 const xmlChar *objname);
1336
1337
1343extern void
1345
1346
1355extern boolean
1357 const xmlChar *modname,
1358 const xmlChar *objname);
1359
1360
1366extern void
1368
1369
1379extern boolean
1381 obj_template_t *reqobj);
1382
1383
1397extern boolean
1399 obj_template_t *reqobj,
1400 uint32 *choicecnt,
1401 obj_template_t **top_choice);
1402
1403
1425extern obj_template_t *
1427 obj_template_t *parent_obj);
1428
1429
1450extern obj_template_t *
1452 obj_template_t *curchild);
1453
1454
1463extern status_t
1465 const xmlChar *active_case_modname,
1466 const xmlChar *active_case);
1467
1468
1474extern getcb_get2_getbulk_t *
1476
1477
1483extern void
1485
1486
1497extern status_t
1499
1500
1530extern status_t
1532 ses_cb_t *scb,
1533 getcb_get2_t *parent_get2cb,
1534 obj_template_t *targobj,
1535 val_value_t *curval,
1536 uint32 choice_cnt,
1537 obj_template_t *top_choice,
1538 boolean *force_remove,
1539 getcb_get2_t **ret_get2cb);
1540
1541
1542
1551extern void
1552 getcb_log_walker (const xmlChar *caller,
1553 getcb_walker_mode_t walker_mode,
1554 const xmlChar *objname,
1555 const xmlChar *valname);
1556
1557
1565extern status_t
1566 getcb_clone_keyQ (dlq_hdr_t *srcQ,
1567 dlq_hdr_t *destQ);
1568
1569
1577extern boolean
1579
1580
1586extern void
1588
1589
1596extern void
1598 val_value_t *val);
1599
1600
1606extern void
1608
1609
1619extern boolean
1621 obj_template_t *chobj);
1622
1623
1632extern getcb_get2_t *
1634 dlq_hdr_t *keyQ);
1635
1636
1647extern boolean
1649 val_value_t *useval,
1650 getcb_get2_lookup_t *lookup);
1651
1652
1663extern boolean
1665 val_value_t *useval,
1666 getcb_get2_t *get2cb);
1667
1668
1679extern boolean
1681 val_value_t *useval,
1682 dlq_hdr_t *srcQ);
1683
1684
1692extern status_t
1694 const xmlChar *buffer);
1695
1696
1702extern void
1704
1705
1715extern val_value_t *
1717 status_t *retres);
1718
1722#ifdef __cplusplus
1723} /* end extern 'C' */
1724#endif
1725
1726#endif /* _H_getcb */
status_t getcb_pre_get2_choices(xml_msg_hdr_t *msg, ses_cb_t *scb, getcb_get2_t *parent_get2cb, obj_template_t *targobj, val_value_t *curval, uint32 choice_cnt, obj_template_t *top_choice, boolean *force_remove, getcb_get2_t **ret_get2cb)
Invoke the get2 callbacks for each of the implied choice-stmt nodes in a subtree or REST resource req...
Definition: getcb.c:9141
void getcb_clean_return_data(getcb_get2_t *get2cb)
Clean the return data in the return_val and return_valQ.
Definition: getcb.c:6819
val_value_t * getcb_find_key(getcb_get2_t *get2cb, obj_template_t *obj)
Find an input keyval in the get2cb keyQ.
Definition: getcb.c:6421
getcb_get2_t * getcb_response_val_to_get2cb(val_value_t *response_val, boolean preserve_data, status_t *res)
Convert a <get-response> value to a get2cb struct.
Definition: getcb.c:7728
void getcb_add_return_key(getcb_get2_t *get2cb, val_value_t *val)
Add a return keyval to a get2cb return_keyQ.
Definition: getcb.c:6396
getcb_get2_getbulk_t * getcb_new_get2_getbulk(void)
Create a new getcb_get2_getbulk struct.
Definition: getcb.c:9017
void getcb_free_get2_getbulk(getcb_get2_getbulk_t *getbulk)
Free a getcb_get2_getbulk struct.
Definition: getcb.c:9041
val_value_t * getcb_get2cb_to_request_val(getcb_get2_t *get2cb, obj_template_t *get_request_obj, boolean preserve_data, xml_msg_hdr_t *msg, status_t *res)
Convert a get2cb struct to a <get-request> value tree.
Definition: getcb.c:6855
void getcb_free_get2cb(getcb_get2_t *get2cb)
Clean and free a malloced GET2 control block.
Definition: getcb.c:6112
val_value_t * getcb_find_return_val2(getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name)
Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer.
Definition: getcb.c:6296
getcb_walker_status_t(* getcb_get2_walker_fn_t)(getcb_walker_mode_t walker_mode, getcb_get2_t *get2cb, obj_template_t *obj, val_value_t *val, void *cookie)
GET2 CONSUMER FUNCTION.
Definition: getcb.h:710
getcb_get2_select_t * getcb_new_get2_select(const xmlChar *modname, const xmlChar *objname)
Create a new getcb_select_t struct.
Definition: getcb.c:8517
status_t(* getcb_fn2_t)(ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *get2cb)
GET2 PRODUCER FUNCTION.
Definition: getcb.h:668
void getcb_add_key(getcb_get2_t *get2cb, val_value_t *val)
Add a keyval to a get2cb keyQ.
Definition: getcb.c:6594
val_value_t * getcb_find_next_return_val(getcb_get2_t *get2cb, val_value_t *curval)
Find the next matching return val in the get2cb return_valQ.
Definition: getcb.c:6359
getcb_get2_lookup_t * getcb_new_get2_lookup(obj_template_t *obj, dlq_hdr_t *keyvalQ)
Create a new getcb_get2_lookup struct.
Definition: getcb.c:8360
void getcb_free_get2_select(getcb_get2_select_t *select_node)
Free a getcb_get2_select struct.
Definition: getcb.c:8547
getcb_keyval_t * getcb_new_keyval(const xmlChar *keyval)
Create a new GET2 keyval holder.
Definition: getcb.c:8223
getcb_get2_t * getcb_request_val_to_get2cb(val_value_t *get_request_val, boolean preserve_data, status_t *res)
Convert a <get-request> value tree into a get2cb struct.
Definition: getcb.c:7268
status_t getcb_add_select(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
Add a select node to a get2cb matchQ.
Definition: getcb.c:6647
boolean getcb_need_get2(obj_template_t *curobj, obj_template_t *reqobj)
check if the node has a get2 callback or in a choice/case subtree that has get2 callback
Definition: getcb.c:8751
val_value_t * getcb_find_key_lvl(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname, uint32 objlvl)
Find an input keyval in the get2cb keyQ.
Definition: getcb.c:6525
void getcb_clean_get2cb(getcb_get2_t *get2cb, boolean reuse)
Clean a get2 control block.
Definition: getcb.c:6134
getcb_walker_mode_t
get2 walker callback modes
Definition: getcb.h:277
void getcb_clean_return_aioQ(getcb_get2_t *get2cb)
Clean the return data return_aioQ.
Definition: getcb.c:9440
boolean getcb_match_keys_keyQ(obj_template_t *useobj, val_value_t *useval, dlq_hdr_t *srcQ)
Match the requested list entry.
Definition: getcb.c:9700
void getcb_log_walker(const xmlChar *caller, getcb_walker_mode_t walker_mode, const xmlChar *objname, const xmlChar *valname)
Print some logging info for a GET2 walker consumer callback.
Definition: getcb.c:9255
boolean getcb_match_keys_lookup(obj_template_t *useobj, val_value_t *useval, getcb_get2_lookup_t *lookup)
Match the requested list entry.
Definition: getcb.c:9549
void getcb_clean_get2_lookupQ(dlq_hdr_t *lookupQ)
Clean a queue of getcb_get2_lookup_t.
Definition: getcb.c:8431
void getcb_clean_keyvalQ(dlq_hdr_t *que)
Free all the Get2 keyvals from a dlq_hdr.
Definition: getcb.c:8338
status_t getcb_move_response_get2cb(getcb_get2_t *response_get2cb, getcb_get2_t *get2cb)
Move the return fields from the return get2cb to the target get2cb.
Definition: getcb.c:7889
getcb_get2_t * getcb_new_parent_get2cb(obj_template_t *obj, dlq_hdr_t *keyQ)
Create a new get2 control block for the parent Used for XGET operation to fill the list's parent get2...
Definition: getcb.c:9508
void getcb_add_return_get2cb(getcb_get2_t *get2cb, getcb_get2_t *return_get2cb)
Add a return get2cb to a get2cb responseQ Used for get-bulk support.
Definition: getcb.c:7865
getcb_keyval_t * getcb_new_keyval3(const xmlChar *keyval, obj_template_t *keyobj, boolean fixed_value)
Create a new Get2 keyval holder using value string.
Definition: getcb.c:8281
status_t getcb_get2_child_obj_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *parentval, getcb_get2_t *parent_get2cb, obj_template_t *obj, boolean with_defaults, getcb_get2_walker_fn_t walkerfn, void *cookie, getcb_get2_t *force_get2cb, getcb_api_mode_t api_mode)
Process the instances of an object for the object itself and 0 or more nest levels of descendant node...
Definition: getcb.c:8097
void getcb_move_return_keys(getcb_get2_t *get2cb)
Move the return keys to the keyQ replacing the nodes in the keyQ if already there.
Definition: getcb.c:6734
getcb_get2_t * getcb_new_get2cb(void)
Malloc and init a new get2 control block.
Definition: getcb.c:6090
status_t getcb_finish_getbulk_entry(getcb_get2_t *get2cb)
Gather the current response in a getbulk entry and save it in the getcb->getbulkQ; The getcb is ready...
Definition: getcb.c:9080
void getcb_init_get2cb(getcb_get2_t *get2cb)
Init a GET2 control block.
Definition: getcb.c:6062
boolean getcb_match_keys_getcb(obj_template_t *useobj, val_value_t *useval, getcb_get2_t *get2cb)
Match the requested list entry.
Definition: getcb.c:9637
status_t getcb_set_active_case(getcb_get2_t *get2cb, const xmlChar *active_case_modname, const xmlChar *active_case)
Set the active case to the specified object.
Definition: getcb.c:8981
void getcb_clean_return_aio_buff(getcb_get2_t *get2cb)
Clean the return AIO buffer, XML or JSON buffer.
Definition: getcb.c:9799
status_t getcb_add_return_aio_buff(getcb_get2_t *get2cb, const xmlChar *buffer)
Add a return buffer to a get2cb control block and set encoding type.
Definition: getcb.c:9757
status_t getcb_get2_child_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *parentval, getcb_get2_t *parent_get2cb, obj_template_t *obj, boolean with_defaults, getcb_get2_walker_fn_t walkerfn, void *cookie)
Process the instances of an object for the object itself and 0 or more nest levels of descendant node...
Definition: getcb.c:8036
boolean getcb_is_get_exact(getcb_get2_t *get2cb)
Check if the getcb represents a response that is for a get-exact or a getnext.
Definition: getcb.c:9343
val_value_t * getcb_get2cb_to_val(getcb_get2_t *get2cb, status_t *retres)
Convert a GET2 CB to the equivalent val_value_t tree only container and list are supported.
Definition: getcb.c:9833
val_value_t * getcb_find_return_key2(getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name)
Find a return keyval in the get2cb return_keyQ Use { NSID, NAME } instead of object pointer.
Definition: getcb.c:6707
boolean getcb_get2_allowed(xml_msg_hdr_t *msg, obj_template_t *chobj)
Check if the current node and operation are allowed to use the GET2 callback if there is one; Used to...
Definition: getcb.c:9466
status_t getcb_replace_response_get2cb(getcb_get2_t *response_get2cb, getcb_get2_t *get2cb, boolean replace_mode)
Move the return fields from the return get2cb to the target get2cb Can clean out old data first.
Definition: getcb.c:7912
val_value_t * getcb_find_key_num(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname, uint32 keynum)
Find an input keyval in the get2cb keyQ.
Definition: getcb.c:6476
void getcb_add_return_val(getcb_get2_t *get2cb, val_value_t *val)
Add a return val to a get2cb return_valQ.
Definition: getcb.c:6236
val_value_t * getcb_find_match(getcb_get2_t *get2cb, obj_template_t *obj)
Find an input keyval in the get2cb matchQ.
Definition: getcb.c:6569
val_value_t * getcb_get2cb_to_response_val(getcb_get2_t *get2cb, obj_template_t *response_obj, boolean preserve_data, status_t *res)
Convert a get2cb struct to a <get-response> value tree.
Definition: getcb.c:7501
getcb_mode_t
get callback retrieval types; only get2 supports getnext
Definition: getcb.h:257
void getcb_add_match(getcb_get2_t *get2cb, val_value_t *val)
Add a match node to a get2cb matchQ.
Definition: getcb.c:6619
void getcb_dump_get2cb(getcb_get2_t *get2cb)
Print the interesting fields in a get2cb.
Definition: getcb.c:8624
boolean getcb_need_get2_ex(obj_template_t *curobj, obj_template_t *reqobj, uint32 *choicecnt, obj_template_t **top_choice)
check if the node has a get2 callback or in a choice/case subtree that has get2 callback
Definition: getcb.c:8784
obj_template_t * getcb_next_requested_child(getcb_get2_t *get2cb, obj_template_t *curchild)
Check if the specified object has any more terminal nodes that need to be returned for a get2 request...
Definition: getcb.c:8934
getcb_walker_status_t
get2 walker callback return status values
Definition: getcb.h:294
status_t(* getcb_fn_t)(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
GET1 Callback function for agent node get handler.
Definition: getcb.h:642
void getcb_clean_responseQ(getcb_get2_t *get2cb)
Clean the response Q within a get2cb.
Definition: getcb.c:9387
void getcb_undo_move_return_keys(getcb_get2_t *get2cb)
Move back the return keys from the keyQ.
Definition: getcb.c:6791
status_t getcb_handle_acmtest(ses_cb_t *scb, xml_msg_hdr_t *msg, val_nodetest_fn_t testfn, getcb_get2_t *get2cb)
check the access control and testfn callback for a node that would have it skipped because the write_...
Definition: getcb.c:8156
val_value_t * getcb_find_return_val_str(getcb_get2_t *get2cb, xmlns_id_t obj_nsid, const xmlChar *obj_name, const xmlChar *valstr)
Find a return val in the get2cb return_valQ use { NSID, NAME } instead of object pointer.
Definition: getcb.c:6331
val_value_t * getcb_find_return_val(getcb_get2_t *get2cb, obj_template_t *obj)
Find a return val in the get2cb return_valQ.
Definition: getcb.c:6265
void getcb_free_keyval(getcb_keyval_t *keyval)
Free a GET2 keyval.
Definition: getcb.c:8313
val_value_t * getcb_find_key_str(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
Find an input keyval in the get2cb keyQ with a string.
Definition: getcb.c:6447
obj_template_t * getcb_first_requested_child(getcb_get2_t *get2cb, obj_template_t *parent_obj)
Check if the specified object has any terminal nodes that need to be returned for a get2 request.
Definition: getcb.c:8871
status_t getcb_clone_keyQ(dlq_hdr_t *srcQ, dlq_hdr_t *destQ)
Copy all the key val_value_t structs to the other queue.
Definition: getcb.c:9309
getcb_keyval_t * getcb_new_keyval2(val_value_t *keynode, obj_template_t *keyobj, boolean fixed_value)
Create a new Get2 keyval holder using val backptr.
Definition: getcb.c:8252
val_value_t * getcb_find_return_key(getcb_get2_t *get2cb, obj_template_t *obj)
Find a return keyval in the get2cb return_keyQ.
Definition: getcb.c:6681
void getcb_free_get2_lookup(getcb_get2_lookup_t *lookup)
Free a getcb_get2_lookup struct.
Definition: getcb.c:8405
boolean getcb_find_get2_select(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
Find a getcb_get2_select struct.
Definition: getcb.c:8571
void getcb_add_return_aioQ(getcb_get2_t *get2cb, val_value_t *val)
Add a return val to a get2cb return_aioQ.
Definition: getcb.c:9413
getcb_get2_lookup_t * getcb_find_get2_lookup(obj_template_t *obj, dlq_hdr_t *lookupQ)
Find a getcb_get2_lookup struct.
Definition: getcb.c:8465
@ GETCB_NONE
not set
Definition: getcb.h:258
@ GETCB_GETNEXT_VALUE
GETNEXT request.
Definition: getcb.h:260
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:259
boolean(* val_nodetest_fn_t)(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
user function callback template to test output of a specified node.
Definition: val_util.h:132
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_msg_encoding_t
enumeration for message encoding formats
Definition: ncxtypes.h:647
ncx_nmda_ds_t
internal enumerations for standard NMDA datastores
Definition: ncxtypes.h:1627
ncx_nmda_origin_t
internal enumerations for standard NMDA origins
Definition: ncxtypes.h:1638
Contains NCX constants.
Data Object Support.
NETCONF protocol remote procedure call common definitions.
NETCONF Session Common definitions module.
global error status code enumerations
GET2 getbulk struct This is only used for YANG list objects to produce N getnext entries at a time.
Definition: getcb.h:343
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:347
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:350
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:344
GET2 lookup struct.
Definition: getcb.h:317
obj_template_t * obj
request_target_obj to get
Definition: getcb.h:319
boolean full_lookup
T: all keys present;.
Definition: getcb.h:321
dlq_hdr_t qhdr
in case added to a queue
Definition: getcb.h:318
dlq_hdr_t keyvalQ
Q of getcb_keyval_t.
Definition: getcb.h:320
GET2 select struct.
Definition: getcb.h:326
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:327
const xmlChar * objname
object name to select
Definition: getcb.h:329
const xmlChar * modname
module name to select
Definition: getcb.h:328
GET2 control block.
Definition: getcb.h:355
xmlChar * txid_str
transaction ID string
Definition: getcb.h:361
boolean keys_only
keys-only: TRUE if only the key leafs are desired from list objects; FALSE if normal retrieval
Definition: getcb.h:428
obj_template_t * obj
object template containing this callback
Definition: getcb.h:364
getcb_mode_t cbmode
reason for the callback (get or getnext)
Definition: getcb.h:399
dlq_hdr_t responseQ
if this is a request that causes multiple responses then the responseQ will have each response get2cb
Definition: getcb.h:539
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:521
boolean oper_data
TRUE to get operational data.
Definition: getcb.h:412
xmlChar * active_case_modname
set by a choice test_mode callback to return the name of the active case; If the active_case_modname ...
Definition: getcb.h:517
boolean wrote_some_lists
If TRUE then Last list failed BUT some of the entries were written successfully.
Definition: getcb.h:553
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:524
ncx_nmda_ds_t nmda_ds
save NMDA datastore for GET operational
Definition: getcb.h:570
boolean force_array_obj
force JSON array output
Definition: getcb.h:492
void * user_data_ref
User Data Reference Can be used by GET2 callbacks to store and reference a pointer during the GET2 ca...
Definition: getcb.h:612
boolean isfirst_nokey
flag to track JSON state
Definition: getcb.h:478
boolean with_defaults
with_defaults: TRUE if default nodes should be returned this is needed for operational data because t...
Definition: getcb.h:440
boolean last_sibling
flag to track JSON state
Definition: getcb.h:475
boolean first_llsibling
leaf-list siblings
Definition: getcb.h:479
boolean isfirst
also used for JSON subtree proc
Definition: getcb.h:484
xmlChar * aio_return_buff
AIO XML or JSON malloced buffer from callback to use.
Definition: getcb.h:583
boolean sm_mpid_malloced
The MPID will be malloced on the SIL-SA side (TRUE) otherwise set to FALSE if the sm_mpid is a backpt...
Definition: getcb.h:595
uint32 max_entries
max instances to get 0 for all entries, 1 .
Definition: getcb.h:404
val_nodetest_fn_t testfn
value node test function (may be obsolete for get2)
Definition: getcb.h:367
dlq_hdr_t qhdr
queue header
Definition: getcb.h:356
val_value_t * parent_val
save parent backtrs for when-stmt processing of GET2 data
Definition: getcb.h:556
struct getcb_get2_t_ * parent_cb
backptr to parent CB
Definition: getcb.h:558
ncx_msg_encoding_t aio_encoding
In AIO GET2 callback is used with JSON/XML buffers the encoding will represent corresponding encoding...
Definition: getcb.h:578
boolean aio_done
AIO processing is completed.
Definition: getcb.h:485
uint32 user_data_index
User Data Index Can be used by GET2 callbacks to store and reference an index during the GET2 callbac...
Definition: getcb.h:624
boolean match_test_done
content-match done flag ignored unless the matchQ is non-empty If TRUE.
Definition: getcb.h:547
xmlChar * active_case
name of the active case
Definition: getcb.h:518
uint32 max_levels
0 for all levels, 1 .
Definition: getcb.h:409
boolean islast
Used only for AIO RESTCONF processing.
Definition: getcb.h:483
dlq_hdr_t return_aioQ
Q of malloced val_value_t.
Definition: getcb.h:567
dlq_hdr_t selectQ
Q of malloced getcb_get2_select_t; 1 entry for each child select node of the object in this get2cb th...
Definition: getcb.h:396
boolean expand_varexpr
variable expressions: TRUE if a varexpr node should be expanded; FALSE if printed as an expression
Definition: getcb.h:423
dlq_hdr_t matchQ
Q of malloced val_value_t; 1 entry for each content-match leaf in the subtree or XPath filter; these ...
Definition: getcb.h:381
boolean more_data
set by the callback function if there are more instances that follow the specified instance; this is ...
Definition: getcb.h:505
dlq_hdr_t keyQ
Q of malloced val_value_t; 1 entry for each key leaf includes the ancestor keys and keys for the curr...
Definition: getcb.h:375
boolean force_lastsib_value
force JSON state
Definition: getcb.h:491
boolean select_only
select: TRUE if only the selectQ child nodes are desired from the parent for this callback; FALSE if ...
Definition: getcb.h:433
boolean finish_list
Used for CBOR processing to know if the special finish-list callback mode is needed.
Definition: getcb.h:497
ncx_sm_mpid_t * sm_mpid
If schema-mount is in use then the MPID is set for GET2 callbacks that have a ancestor that is a root...
Definition: getcb.h:590
boolean last_llsibling
leaf-list siblings
Definition: getcb.h:480
val_value_t return_val
if just 1 instance is returned, then the return_val will be used; if the btyp is set to something oth...
Definition: getcb.h:534
boolean first_sibling
first sibling done
Definition: getcb.h:489
getcb_api_mode_t api_mode
api_mode: consumer API callback mode
Definition: getcb.h:458
boolean acmtest_result
acmtest result used for NACM check
Definition: getcb.h:472
boolean force_lastsibling
force JSON state
Definition: getcb.h:490
boolean with_origin
get-request with-origin flag
Definition: getcb.h:461
val_value_t * start_add_key
first key val node that was moved from the return_keyQ to the keyQ for nested nodes to process; needs...
Definition: getcb.h:469
dlq_hdr_t getbulkQ
set by the callback function if this is a list callback and multiple entries are returned; this is a ...
Definition: getcb.h:511
ncx_nmda_origin_t nmda_origin
caller will set the return nmda_origin
Definition: getcb.h:573
boolean first_child
Used for JSON subtree proccessing.
Definition: getcb.h:488
boolean config_data
TBD: TRUE to get configuration data not supported yet! All config must be in the cfg->root val_value_...
Definition: getcb.h:418
Key value holder, temp Q of ordered key leaf values used while parsing a path to store the keys until...
Definition: getcb.h:307
xmlChar * value
malloced, if set by agt_yangapi
Definition: getcb.h:309
obj_template_t * objnode
if set by agt_tree
Definition: getcb.h:311
val_value_t * valnode
if set by agt_tree
Definition: getcb.h:310
dlq_hdr_t qhdr
queue header
Definition: getcb.h:308
boolean fixed_value
if partial keys
Definition: getcb.h:312
Moint Point Instance This struct lives in a val_value_t.val_extra struct.
Definition: ncxtypes.h:1811
One YANG data-def-stmt.
Definition: obj.h:1220
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:397
Value Node Basic Support.
Value Node Utilities.