yumapro  24.10-3
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_PRE_PROCESS(G) (G)->pre_process
125#define GETCB_GET2_EXPAND_VAREXPR(G) (G)->expand_varexpr
126#define GETCB_GET2_KEYS_ONLY(G) (G)->keys_only
127#define GETCB_GET2_WITH_DEFAULTS(G) (G)->with_defaults
128#define GETCB_GET2_SELECT(G) (G)->select_only
129#define GETCB_GET2_API_MODE(G) (G)->api_mode
130#define GETCB_GET2_WITH_ORIGIN(G) (G)->with_origin
131
132/* internal state data macros */
133#define GETCB_GET2_START_ADD_KEY(G) (G)->start_add_key
134#define GETCB_GET2_ACMTEST_RESULT(G) (G)->acmtest_result
135#define GETCB_GET2_FIRST_SIBLING(G) (G)->first_sibling
136#define GETCB_GET2_FIRST_LL_SIBLING(G) (G)->first_llsibling
137#define GETCB_GET2_LAST_LL_SIBLING(G) (G)->last_llsibling
138#define GETCB_GET2_LAST_SIBLING(G) (G)->last_sibling
139#define GETCB_GET2_FIRST_CHILD(G) (G)->first_child
140#define GETCB_GET2_FIRST_NOKEY_CHILD(G) (G)->isfirst_nokey
141#define GETCB_GET2_FIRST(G) (G)->isfirst
142#define GETCB_GET2_LAST(G) (G)->islast
143#define GETCB_GET2_WROTE_LIST(G) (G)->wrote_some_lists
144#define GETCB_GET2_FINISH_LIST(G) (G)->finish_list
145
146/* return data macros */
147#define GETCB_GET2_MORE_DATA(G) (G)->more_data
148#define GETCB_GET2_ACTIVE_CASE_MODNAME(G) (G)->active_case_modname
149#define GETCB_GET2_ACTIVE_CASE(G) (G)->active_case
150#define GETCB_GET2_PARENT_VAL(G) (G)->parent_val
151#define GETCB_GET2_PARENT_CB(G) (G)->parent_cb
152#define GETCB_GET2_REMOVE_KEY(G,C) dlq_remove(C)
153#define GETCB_GET2_REMOVE_MATCH(G,C) dlq_remove(C)
154#define GETCB_GET2_REMOVE_VAL(G,C) dlq_remove(C)
155
156
157#define GETCB_GET2_FIRST_KEY(G) \
158 (val_value_t *)dlq_firstEntry(&(G)->keyQ)
159
160#define GETCB_GET2_NEXT_KEY(G,C) \
161 (val_value_t *)dlq_nextEntry(C)
162
163#define GETCB_GET2_FIRST_MATCH(G) \
164 (val_value_t *)dlq_firstEntry(&(G)->matchQ)
165
166#define GETCB_GET2_NEXT_MATCH(G,C) \
167 (val_value_t *)dlq_nextEntry(C)
168
169#define GETCB_GET2_FIRST_SELECT(G) \
170 (getcb_get2_select_t *)dlq_firstEntry(&(G)->selectQ)
171
172#define GETCB_GET2_NEXT_SELECT(G,C) \
173 (getcb_get2_select_t *)dlq_nextEntry(C)
174
175#define GETCB_GET2_MATCH_TEST_DONE(G) (G)->match_test_done
176
177#define GETCB_GET2_RETURN_VAL(G) &(G)->return_val
178
179#define GETCB_GET2_RETURN_VAL_SET(G) \
180 ((G)->return_val.btyp != NCX_BT_NONE)
181
182#define GETCB_GET2_FIRST_RETURN_KEY(G) \
183 (val_value_t *)dlq_firstEntry(&(G)->return_keyQ)
184
185#define GETCB_GET2_NEXT_RETURN_KEY(G,C) \
186 (val_value_t *)dlq_nextEntry(C)
187
188#define GETCB_GET2_FIRST_RETURN_VAL(G) \
189 (val_value_t *)dlq_firstEntry(&(G)->return_valQ)
190
191#define GETCB_GET2_NEXT_RETURN_VAL(G,C) \
192 (val_value_t *)dlq_nextEntry(C)
193
194#define GETCB_GET2_RESPONSEQ(G) &(G)->responseQ
195
196#define GETCB_GET2_FIRST_RESPONSE(G) \
197 (getcb_get2_t *)dlq_firstEntry(&(G)->responseQ)
198
199#define GETCB_GET2_NEXT_RESPONSE(G,C) \
200 (getcb_get2_t *)dlq_nextEntry(C)
201
202#define GETCB_GET2_REMOVE_RESPONSE(G,C) dlq_remove(C)
203
204
205#define GETCB_GET2_FIRST_GETBULK(G) \
206 (getcb_get2_getbulk_t *)dlq_firstEntry(&(G)->getbulkQ)
207
208#define GETCB_GET2_NEXT_GETBULK(G,C) \
209 (getcb_get2_getbulk_t *)dlq_nextEntry(C)
210
211#define GETCB_GET2_DATASTORE(G) (G)->nmda_ds
212
213#define GETCB_GET2_ORIGIN(G) (G)->nmda_origin
214
215
216/* All in One Queue Macros */
217#define GETCB_GET2_RETURN_AIOQ(G) &(G)->return_aioQ
218#define GETCB_AIO_ENCODING(G) (G)->aio_encoding
219#define GETCB_AIO_BUFFER(G) (G)->aio_return_buff
220
221#define GETCB_GET2_FIRST_RETURN_AIO_VAL(G) \
222 (val_value_t *)dlq_firstEntry(&(G)->return_aioQ)
223
224#define GETCB_GET2_NEXT_RETURN_AIO_VAL(C) \
225 (val_value_t *)dlq_nextEntry(C)
226
227#define GETCB_GET2_USER_DATA_REF(G) (G)->user_data_ref
228
229#define GETCB_GET2_USER_DATA_INDEX(G) (G)->user_data_index
230
231/* Schema mount MPID field
232 * The parameter G is a getcb_get2_t *
233 */
234#define GETCB_GET2_SM_MPID(G) (G)->sm_mpid
235
240#define GETCB_GET2_SM_MPID_MALLOCED(G) (G)->sm_mpid_malloced
241
242#define GETCB_FLAG_KEYS (const xmlChar *)"keys"
243#define GETCB_FLAG_CONFIG (const xmlChar *)"config"
244#define GETCB_FLAG_OPER (const xmlChar *)"oper"
245#define GETCB_FLAG_GETNEXT (const xmlChar *)"getnext"
246#define GETCB_FLAG_WITHDEF (const xmlChar *)"withdef"
247#define GETCB_FLAG_SELECT (const xmlChar *)"select"
248#define GETCB_FLAG_WITH_ORIGIN (const xmlChar *)"with-origin"
249#define GETCB_FLAG_PRE_PROCESS (const xmlChar *)"pre-process"
250
251
252/********************************************************************
253* *
254* T Y P E S *
255* *
256*********************************************************************/
257
259typedef enum getcb_mode_t_ {
264
265
266/* get2 walker callback modes for the 'normal' API mode */
267typedef enum getcb_api_mode_t_ {
268 GETCB_API_MODE_NONE,
269 GETCB_API_MODE_NORMAL,
270 GETCB_API_MODE_1SHOT,
271 GETCB_API_MODE_CHOICE,
272 GETCB_API_MODE_CONFIG_NODE, // config=true node
273 GETCB_API_MODE_ALL_IN_ONE, // All in One retrieval
274 GETCB_API_MODE_ALL_IN_ONE_1SHOT
275} getcb_api_mode_t;
276
277
279typedef enum getcb_walker_mode_t_ {
280 GETCB_WALK_MODE_NONE,
281
282 /* get2 walker callback modes for the 'normal' API mode */
283 GETCB_WALK_MODE_START,
284 GETCB_WALK_MODE_TERM,
285 GETCB_WALK_MODE_END,
286
287 /* get2 walker callback mode for the '1shot' API mode */
288 GETCB_WALK_MODE_1SHOT,
289
290 /* get2 walker callback mode for pre-get choices API mode */
291 GETCB_WALK_MODE_CHOICE
293
294
296typedef enum getcb_walker_status_t_ {
297 GETCB_WALK_STAT_NONE,
298 GETCB_WALK_STAT_CONTINUE,
299 GETCB_WALK_STAT_STOP_INSTANCE,
300 GETCB_WALK_STAT_STOP_OBJECT,
301 GETCB_WALK_STAT_STOP_WALK
303
304
309typedef struct getcb_keyval_t_ {
310 dlq_hdr_t qhdr;
311 xmlChar *value;
314 boolean fixed_value;
316
317
319typedef struct getcb_get2_lookup_t_ {
320 dlq_hdr_t qhdr;
322 dlq_hdr_t keyvalQ;
323 boolean full_lookup;
325
326
328typedef struct getcb_get2_select_t_ {
329 dlq_hdr_t qhdr;
330 const xmlChar *modname;
331 const xmlChar *objname;
333
334
345typedef struct getcb_get2_getbulk_t_ {
346 dlq_hdr_t qhdr;
349 dlq_hdr_t return_keyQ;
350
352 dlq_hdr_t return_valQ;
354
355
357typedef struct getcb_get2_t_ {
358 dlq_hdr_t qhdr;
360 /********** I N P U T P A R A M E T E R S *******/
361
363 xmlChar *txid_str;
364
367
370
377 dlq_hdr_t keyQ;
378
383 dlq_hdr_t matchQ;
384
398 dlq_hdr_t selectQ;
402
407
412
414 boolean oper_data;
415
420 boolean config_data;
421
426
430 boolean keys_only;
431
435 boolean select_only;
436
443
460 getcb_api_mode_t api_mode;
461
463 boolean with_origin;
464
465 /********** I N T E R N A L S T A T E D A T A *******/
466
472
475
478
483
485 boolean islast;
486 boolean isfirst;
487 boolean aio_done;
490 boolean first_child;
495
499 boolean finish_list;
500
501 /********** C A L L B A C K R E T U R N D A T A *******/
502
507 boolean more_data;
508
513 dlq_hdr_t getbulkQ;
520 xmlChar *active_case;
521
523 dlq_hdr_t return_keyQ;
524
526 dlq_hdr_t return_valQ;
527
537
541 dlq_hdr_t responseQ; // Q of getcb_get2_t structs
542
550
556
559
560 struct getcb_get2_t_ *parent_cb;
561
569 dlq_hdr_t return_aioQ;
570
573
576
581
586
587
593
598
599
600 /******** C A L L B A C K S T A T E D A T A *******/
601
615
627
633 boolean pre_process;
635
636
649typedef status_t
650 (*getcb_fn_t) (ses_cb_t *scb,
651 getcb_mode_t cbmode,
652 const val_value_t *virval,
653 val_value_t *dstval);
654
655
656
675typedef status_t
676 (*getcb_fn2_t) (ses_cb_t *scb,
677 xml_msg_hdr_t *msg,
678 getcb_get2_t *get2cb);
679
680
719 getcb_get2_t *get2cb,
720 obj_template_t *obj,
721 val_value_t *val,
722 void *cookie);
723
724
732extern void
734
735
742extern getcb_get2_t *
743 getcb_new_get2cb (void);
744
745
751extern void
753
754
761extern void
763 boolean reuse);
764
765
775extern void
777 val_value_t *val);
778
779
786extern val_value_t *
788 obj_template_t *obj);
789
790
800extern val_value_t *
802 xmlns_id_t obj_nsid,
803 const xmlChar *obj_name);
804
805
818extern val_value_t *
820 xmlns_id_t obj_nsid,
821 const xmlChar *obj_name,
822 const xmlChar *valstr);
823
824
832extern val_value_t *
834 val_value_t *curval);
835
836
846extern val_value_t *
848 obj_template_t *obj);
849
850
861extern val_value_t *
863 const xmlChar *modname,
864 const xmlChar *objname);
865
866
879extern val_value_t *
881 const xmlChar *modname,
882 const xmlChar *objname,
883 uint32 keynum);
884
885
897extern val_value_t *
899 const xmlChar *modname,
900 const xmlChar *objname,
901 uint32 objlvl);
902
903
911extern val_value_t *
913 obj_template_t *obj);
914
915
925extern void
927 val_value_t *val);
928
929
938extern void
940 val_value_t *val);
941
942
953extern status_t
955 const xmlChar *modname,
956 const xmlChar *objname);
957
958
969extern void
971 val_value_t *val);
972
973
981extern val_value_t *
983 obj_template_t *obj);
984
985
995extern val_value_t *
997 xmlns_id_t obj_nsid,
998 const xmlChar *obj_name);
999
1000
1007extern void
1009
1010
1016extern void
1018
1019
1025extern void
1027
1028
1042extern val_value_t *
1044 obj_template_t *get_request_obj,
1045 boolean preserve_data,
1046 xml_msg_hdr_t *msg,
1047 status_t *res);
1048
1049
1061extern getcb_get2_t *
1062 getcb_request_val_to_get2cb (val_value_t *get_request_val,
1063 boolean preserve_data,
1064 status_t *res);
1065
1066
1079extern val_value_t *
1081 obj_template_t *response_obj,
1082 boolean preserve_data,
1083 status_t *res);
1084
1085
1097extern getcb_get2_t *
1099 boolean preserve_data,
1100 status_t *res);
1101
1102
1110extern void
1112 getcb_get2_t *return_get2cb);
1113
1114
1122extern status_t
1123 getcb_move_response_get2cb (getcb_get2_t *response_get2cb,
1124 getcb_get2_t *get2cb);
1125
1126
1137extern status_t
1139 getcb_get2_t *get2cb,
1140 boolean replace_mode);
1141
1142
1164extern status_t
1166 xml_msg_hdr_t *msg,
1167 val_value_t *parentval,
1168 getcb_get2_t *parent_get2cb,
1169 obj_template_t *obj,
1170 boolean with_defaults,
1171 getcb_get2_walker_fn_t walkerfn,
1172 void *cookie);
1173
1174
1203extern status_t
1205 xml_msg_hdr_t *msg,
1206 val_value_t *parentval,
1207 getcb_get2_t *parent_get2cb,
1208 obj_template_t *obj,
1209 boolean with_defaults,
1210 getcb_get2_walker_fn_t walkerfn,
1211 void *cookie,
1212 getcb_get2_t *force_get2cb,
1213 getcb_api_mode_t api_mode);
1214
1215
1227extern status_t
1229 xml_msg_hdr_t *msg,
1230 val_nodetest_fn_t testfn,
1231 getcb_get2_t *get2cb);
1232
1233
1240extern getcb_keyval_t *
1241 getcb_new_keyval (const xmlChar *keyval);
1242
1243
1252extern getcb_keyval_t *
1254 obj_template_t *keyobj,
1255 boolean fixed_value);
1256
1257
1266extern getcb_keyval_t *
1267 getcb_new_keyval3 (const xmlChar *keyval,
1268 obj_template_t *keyobj,
1269 boolean fixed_value);
1270
1271
1272
1278extern void
1280
1281
1282
1288extern void
1289 getcb_clean_keyvalQ (dlq_hdr_t *que);
1290
1291
1299extern getcb_get2_lookup_t *
1301 dlq_hdr_t *keyvalQ);
1302
1303
1309extern void
1311
1312
1318extern void
1319 getcb_clean_get2_lookupQ (dlq_hdr_t *lookupQ);
1320
1321
1329extern getcb_get2_lookup_t *
1331 dlq_hdr_t *lookupQ);
1332
1333
1341extern getcb_get2_select_t *
1342 getcb_new_get2_select (const xmlChar *modname,
1343 const xmlChar *objname);
1344
1345
1351extern void
1353
1354
1363extern boolean
1365 const xmlChar *modname,
1366 const xmlChar *objname);
1367
1368
1374extern void
1376
1377
1387extern boolean
1389 obj_template_t *reqobj);
1390
1391
1405extern boolean
1407 obj_template_t *reqobj,
1408 uint32 *choicecnt,
1409 obj_template_t **top_choice);
1410
1411
1433extern obj_template_t *
1435 obj_template_t *parent_obj);
1436
1437
1458extern obj_template_t *
1460 obj_template_t *curchild);
1461
1462
1471extern status_t
1473 const xmlChar *active_case_modname,
1474 const xmlChar *active_case);
1475
1476
1482extern getcb_get2_getbulk_t *
1484
1485
1491extern void
1493
1494
1505extern status_t
1507
1508
1538extern status_t
1540 ses_cb_t *scb,
1541 getcb_get2_t *parent_get2cb,
1542 obj_template_t *targobj,
1543 val_value_t *curval,
1544 uint32 choice_cnt,
1545 obj_template_t *top_choice,
1546 boolean *force_remove,
1547 getcb_get2_t **ret_get2cb);
1548
1549
1550
1559extern void
1560 getcb_log_walker (const xmlChar *caller,
1561 getcb_walker_mode_t walker_mode,
1562 const xmlChar *objname,
1563 const xmlChar *valname);
1564
1565
1573extern status_t
1574 getcb_clone_keyQ (dlq_hdr_t *srcQ,
1575 dlq_hdr_t *destQ);
1576
1577
1585extern boolean
1587
1588
1594extern void
1596
1597
1604extern void
1606 val_value_t *val);
1607
1608
1614extern void
1616
1617
1627extern boolean
1629 obj_template_t *chobj);
1630
1631
1640extern getcb_get2_t *
1642 dlq_hdr_t *keyQ);
1643
1644
1655extern boolean
1657 val_value_t *useval,
1658 getcb_get2_lookup_t *lookup);
1659
1660
1671extern boolean
1673 val_value_t *useval,
1674 getcb_get2_t *get2cb);
1675
1676
1687extern boolean
1689 val_value_t *useval,
1690 dlq_hdr_t *srcQ);
1691
1692
1700extern status_t
1702 const xmlChar *buffer);
1703
1704
1710extern void
1712
1713
1723extern val_value_t *
1725 status_t *retres);
1726
1730#ifdef __cplusplus
1731} /* end extern 'C' */
1732#endif
1733
1734#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:9189
void getcb_clean_return_data(getcb_get2_t *get2cb)
Clean the return data in the return_val and return_valQ.
Definition: getcb.c:6862
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:6464
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:7776
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:6439
getcb_get2_getbulk_t * getcb_new_get2_getbulk(void)
Create a new getcb_get2_getbulk struct.
Definition: getcb.c:9065
void getcb_free_get2_getbulk(getcb_get2_getbulk_t *getbulk)
Free a getcb_get2_getbulk struct.
Definition: getcb.c:9089
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:6898
void getcb_free_get2cb(getcb_get2_t *get2cb)
Clean and free a malloced GET2 control block.
Definition: getcb.c:6155
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:6339
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:718
getcb_get2_select_t * getcb_new_get2_select(const xmlChar *modname, const xmlChar *objname)
Create a new getcb_select_t struct.
Definition: getcb.c:8565
status_t(* getcb_fn2_t)(ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *get2cb)
GET2 PRODUCER FUNCTION.
Definition: getcb.h:676
void getcb_add_key(getcb_get2_t *get2cb, val_value_t *val)
Add a keyval to a get2cb keyQ.
Definition: getcb.c:6637
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:6402
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:8408
void getcb_free_get2_select(getcb_get2_select_t *select_node)
Free a getcb_get2_select struct.
Definition: getcb.c:8595
getcb_keyval_t * getcb_new_keyval(const xmlChar *keyval)
Create a new GET2 keyval holder.
Definition: getcb.c:8271
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:7313
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:6690
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:8799
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:6568
void getcb_clean_get2cb(getcb_get2_t *get2cb, boolean reuse)
Clean a get2 control block.
Definition: getcb.c:6177
getcb_walker_mode_t
get2 walker callback modes
Definition: getcb.h:279
void getcb_clean_return_aioQ(getcb_get2_t *get2cb)
Clean the return data return_aioQ.
Definition: getcb.c:9488
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:9748
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:9303
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:9597
void getcb_clean_get2_lookupQ(dlq_hdr_t *lookupQ)
Clean a queue of getcb_get2_lookup_t.
Definition: getcb.c:8479
void getcb_clean_keyvalQ(dlq_hdr_t *que)
Free all the Get2 keyvals from a dlq_hdr.
Definition: getcb.c:8386
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:7937
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:9556
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:7913
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:8329
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:8145
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:6777
getcb_get2_t * getcb_new_get2cb(void)
Malloc and init a new get2 control block.
Definition: getcb.c:6133
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:9128
void getcb_init_get2cb(getcb_get2_t *get2cb)
Init a GET2 control block.
Definition: getcb.c:6105
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:9685
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:9029
void getcb_clean_return_aio_buff(getcb_get2_t *get2cb)
Clean the return AIO buffer, XML or JSON buffer.
Definition: getcb.c:9847
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:9805
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:8084
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:9391
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:9881
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:6750
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:9514
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:7960
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:6519
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:6279
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:6612
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:7549
getcb_mode_t
get callback retrieval types; only get2 supports getnext
Definition: getcb.h:259
void getcb_add_match(getcb_get2_t *get2cb, val_value_t *val)
Add a match node to a get2cb matchQ.
Definition: getcb.c:6662
void getcb_dump_get2cb(getcb_get2_t *get2cb)
Print the interesting fields in a get2cb.
Definition: getcb.c:8672
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:8832
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:8982
getcb_walker_status_t
get2 walker callback return status values
Definition: getcb.h:296
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:650
void getcb_clean_responseQ(getcb_get2_t *get2cb)
Clean the response Q within a get2cb.
Definition: getcb.c:9435
void getcb_undo_move_return_keys(getcb_get2_t *get2cb)
Move back the return keys from the keyQ.
Definition: getcb.c:6834
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:8204
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:6374
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:6308
void getcb_free_keyval(getcb_keyval_t *keyval)
Free a GET2 keyval.
Definition: getcb.c:8361
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:6490
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:8919
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:9357
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:8300
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:6724
void getcb_free_get2_lookup(getcb_get2_lookup_t *lookup)
Free a getcb_get2_lookup struct.
Definition: getcb.c:8453
boolean getcb_find_get2_select(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
Find a getcb_get2_select struct.
Definition: getcb.c:8619
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:9461
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:8513
@ GETCB_NONE
not set
Definition: getcb.h:260
@ GETCB_GETNEXT_VALUE
GETNEXT request.
Definition: getcb.h:262
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:261
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:1631
ncx_nmda_origin_t
internal enumerations for standard NMDA origins
Definition: ncxtypes.h:1642
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:345
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:349
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:352
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:346
GET2 lookup struct.
Definition: getcb.h:319
obj_template_t * obj
request_target_obj to get
Definition: getcb.h:321
boolean full_lookup
T: all keys present;.
Definition: getcb.h:323
dlq_hdr_t qhdr
in case added to a queue
Definition: getcb.h:320
dlq_hdr_t keyvalQ
Q of getcb_keyval_t.
Definition: getcb.h:322
GET2 select struct.
Definition: getcb.h:328
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:329
const xmlChar * objname
object name to select
Definition: getcb.h:331
const xmlChar * modname
module name to select
Definition: getcb.h:330
GET2 control block.
Definition: getcb.h:357
xmlChar * txid_str
transaction ID string
Definition: getcb.h:363
boolean keys_only
keys-only: TRUE if only the key leafs are desired from list objects; FALSE if normal retrieval
Definition: getcb.h:430
obj_template_t * obj
object template containing this callback
Definition: getcb.h:366
getcb_mode_t cbmode
reason for the callback (get or getnext)
Definition: getcb.h:401
dlq_hdr_t responseQ
if this is a request that causes multiple responses then the responseQ will have each response get2cb
Definition: getcb.h:541
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:523
boolean oper_data
TRUE to get operational data.
Definition: getcb.h:414
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:519
boolean wrote_some_lists
If TRUE then Last list failed BUT some of the entries were written successfully.
Definition: getcb.h:555
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:526
ncx_nmda_ds_t nmda_ds
save NMDA datastore for GET operational
Definition: getcb.h:572
boolean force_array_obj
force JSON array output
Definition: getcb.h:494
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:614
boolean isfirst_nokey
flag to track JSON state
Definition: getcb.h:480
boolean pre_process
YPW-2273: pre_process_mode is TRUE if Subtree filter is doing Pre process Selection nodes to see if t...
Definition: getcb.h:633
boolean with_defaults
with_defaults: TRUE if default nodes should be returned this is needed for operational data because t...
Definition: getcb.h:442
boolean last_sibling
flag to track JSON state
Definition: getcb.h:477
boolean first_llsibling
leaf-list siblings
Definition: getcb.h:481
boolean isfirst
also used for JSON subtree proc
Definition: getcb.h:486
xmlChar * aio_return_buff
AIO XML or JSON malloced buffer from callback to use.
Definition: getcb.h:585
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:597
uint32 max_entries
max instances to get 0 for all entries, 1 .
Definition: getcb.h:406
val_nodetest_fn_t testfn
value node test function (may be obsolete for get2)
Definition: getcb.h:369
dlq_hdr_t qhdr
queue header
Definition: getcb.h:358
val_value_t * parent_val
save parent backtrs for when-stmt processing of GET2 data
Definition: getcb.h:558
struct getcb_get2_t_ * parent_cb
backptr to parent CB
Definition: getcb.h:560
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:580
boolean aio_done
AIO processing is completed.
Definition: getcb.h:487
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:626
boolean match_test_done
content-match done flag ignored unless the matchQ is non-empty If TRUE.
Definition: getcb.h:549
xmlChar * active_case
name of the active case
Definition: getcb.h:520
uint32 max_levels
0 for all levels, 1 .
Definition: getcb.h:411
boolean islast
Used only for AIO RESTCONF processing.
Definition: getcb.h:485
dlq_hdr_t return_aioQ
Q of malloced val_value_t.
Definition: getcb.h:569
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:398
boolean expand_varexpr
variable expressions: TRUE if a varexpr node should be expanded; FALSE if printed as an expression
Definition: getcb.h:425
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:383
boolean more_data
set by the callback function if there are more instances that follow the specified instance; this is ...
Definition: getcb.h:507
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:377
boolean force_lastsib_value
force JSON state
Definition: getcb.h:493
boolean select_only
select: TRUE if only the selectQ child nodes are desired from the parent for this callback; FALSE if ...
Definition: getcb.h:435
boolean finish_list
Used for CBOR processing to know if the special finish-list callback mode is needed.
Definition: getcb.h:499
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:592
boolean last_llsibling
leaf-list siblings
Definition: getcb.h:482
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:536
boolean first_sibling
first sibling done
Definition: getcb.h:491
getcb_api_mode_t api_mode
api_mode: consumer API callback mode
Definition: getcb.h:460
boolean acmtest_result
acmtest result used for NACM check
Definition: getcb.h:474
boolean force_lastsibling
force JSON state
Definition: getcb.h:492
boolean with_origin
get-request with-origin flag
Definition: getcb.h:463
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:471
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:513
ncx_nmda_origin_t nmda_origin
caller will set the return nmda_origin
Definition: getcb.h:575
boolean first_child
Used for JSON subtree proccessing.
Definition: getcb.h:490
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:420
Key value holder, temp Q of ordered key leaf values used while parsing a path to store the keys until...
Definition: getcb.h:309
xmlChar * value
malloced, if set by agt_yangapi
Definition: getcb.h:311
obj_template_t * objnode
if set by agt_tree
Definition: getcb.h:313
val_value_t * valnode
if set by agt_tree
Definition: getcb.h:312
dlq_hdr_t qhdr
queue header
Definition: getcb.h:310
boolean fixed_value
if partial keys
Definition: getcb.h:314
Moint Point Instance This struct lives in a val_value_t.val_extra struct.
Definition: ncxtypes.h:1815
One YANG data-def-stmt.
Definition: obj.h:1229
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:404
Value Node Basic Support.
Value Node Utilities.