yumapro  20.10-12
YumaPro SDK
getcb.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_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 
33 date init comment
34 ----------------------------------------------------------------------
35 16-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
68 extern "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 
144 /* return data macros */
145 #define GETCB_GET2_MORE_DATA(G) (G)->more_data
146 #define GETCB_GET2_ACTIVE_CASE_MODNAME(G) (G)->active_case_modname
147 #define GETCB_GET2_ACTIVE_CASE(G) (G)->active_case
148 #define GETCB_GET2_PARENT_VAL(G) (G)->parent_val
149 #define GETCB_GET2_PARENT_CB(G) (G)->parent_cb
150 #define GETCB_GET2_REMOVE_KEY(G,C) dlq_remove(C)
151 #define GETCB_GET2_REMOVE_MATCH(G,C) dlq_remove(C)
152 #define GETCB_GET2_REMOVE_VAL(G,C) dlq_remove(C)
153 
154 
155 #define GETCB_GET2_FIRST_KEY(G) \
156  (val_value_t *)dlq_firstEntry(&(G)->keyQ)
157 
158 #define GETCB_GET2_NEXT_KEY(G,C) \
159  (val_value_t *)dlq_nextEntry(C)
160 
161 #define GETCB_GET2_FIRST_MATCH(G) \
162  (val_value_t *)dlq_firstEntry(&(G)->matchQ)
163 
164 #define GETCB_GET2_NEXT_MATCH(G,C) \
165  (val_value_t *)dlq_nextEntry(C)
166 
167 #define GETCB_GET2_FIRST_SELECT(G) \
168  (getcb_get2_select_t *)dlq_firstEntry(&(G)->selectQ)
169 
170 #define GETCB_GET2_NEXT_SELECT(G,C) \
171  (getcb_get2_select_t *)dlq_nextEntry(C)
172 
173 #define GETCB_GET2_MATCH_TEST_DONE(G) (G)->match_test_done
174 
175 #define GETCB_GET2_RETURN_VAL(G) &(G)->return_val
176 
177 #define GETCB_GET2_RETURN_VAL_SET(G) \
178  ((G)->return_val.btyp != NCX_BT_NONE)
179 
180 #define GETCB_GET2_FIRST_RETURN_KEY(G) \
181  (val_value_t *)dlq_firstEntry(&(G)->return_keyQ)
182 
183 #define GETCB_GET2_NEXT_RETURN_KEY(G,C) \
184  (val_value_t *)dlq_nextEntry(C)
185 
186 #define GETCB_GET2_FIRST_RETURN_VAL(G) \
187  (val_value_t *)dlq_firstEntry(&(G)->return_valQ)
188 
189 #define GETCB_GET2_NEXT_RETURN_VAL(G,C) \
190  (val_value_t *)dlq_nextEntry(C)
191 
192 #define GETCB_GET2_RESPONSEQ(G) &(G)->responseQ
193 
194 #define GETCB_GET2_FIRST_RESPONSE(G) \
195  (getcb_get2_t *)dlq_firstEntry(&(G)->responseQ)
196 
197 #define GETCB_GET2_NEXT_RESPONSE(G,C) \
198  (getcb_get2_t *)dlq_nextEntry(C)
199 
200 #define GETCB_GET2_REMOVE_RESPONSE(G,C) dlq_remove(C)
201 
202 
203 #define GETCB_GET2_FIRST_GETBULK(G) \
204  (getcb_get2_getbulk_t *)dlq_firstEntry(&(G)->getbulkQ)
205 
206 #define GETCB_GET2_NEXT_GETBULK(G,C) \
207  (getcb_get2_getbulk_t *)dlq_nextEntry(C)
208 
209 #define GETCB_GET2_DATASTORE(G) (G)->nmda_ds
210 
211 #define GETCB_GET2_ORIGIN(G) (G)->nmda_origin
212 
213 
214 /* All in One Queue Macros */
215 #define GETCB_GET2_RETURN_AIOQ(G) &(G)->return_aioQ
216 #define GETCB_AIO_ENCODING(G) (G)->aio_encoding
217 #define GETCB_AIO_BUFFER(G) (G)->aio_return_buff
218 
219 #define GETCB_GET2_FIRST_RETURN_AIO_VAL(G) \
220  (val_value_t *)dlq_firstEntry(&(G)->return_aioQ)
221 
222 #define GETCB_GET2_NEXT_RETURN_AIO_VAL(C) \
223  (val_value_t *)dlq_nextEntry(C)
224 
225 #define GETCB_FLAG_KEYS (const xmlChar *)"keys"
226 #define GETCB_FLAG_CONFIG (const xmlChar *)"config"
227 #define GETCB_FLAG_OPER (const xmlChar *)"oper"
228 #define GETCB_FLAG_GETNEXT (const xmlChar *)"getnext"
229 #define GETCB_FLAG_WITHDEF (const xmlChar *)"withdef"
230 #define GETCB_FLAG_SELECT (const xmlChar *)"select"
231 #define GETCB_FLAG_WITH_ORIGIN (const xmlChar *)"with-origin"
232 
233 
234 /********************************************************************
235 * *
236 * T Y P E S *
237 * *
238 *********************************************************************/
239 
241 typedef enum getcb_mode_t_ {
242  GETCB_NONE,
245 } getcb_mode_t;
246 
247 
248 /* get2 walker callback modes for the 'normal' API mode */
249 typedef enum getcb_api_mode_t_ {
250  GETCB_API_MODE_NONE,
251  GETCB_API_MODE_NORMAL,
252  GETCB_API_MODE_1SHOT,
253  GETCB_API_MODE_CHOICE,
254  GETCB_API_MODE_CONFIG_NODE, // config=true node
255  GETCB_API_MODE_ALL_IN_ONE, // All in One retrieval
256  GETCB_API_MODE_ALL_IN_ONE_1SHOT
257 } getcb_api_mode_t;
258 
259 
261 typedef enum getcb_walker_mode_t_ {
262  GETCB_WALK_MODE_NONE,
263 
264  /* get2 walker callback modes for the 'normal' API mode */
265  GETCB_WALK_MODE_START,
266  GETCB_WALK_MODE_TERM,
267  GETCB_WALK_MODE_END,
268 
269  /* get2 walker callback mode for the '1shot' API mode */
270  GETCB_WALK_MODE_1SHOT,
271 
272  /* get2 walker callback mode for pre-get choices API mode */
273  GETCB_WALK_MODE_CHOICE
274 } getcb_walker_mode_t;
275 
276 
279  GETCB_WALK_STAT_NONE,
280  GETCB_WALK_STAT_CONTINUE,
281  GETCB_WALK_STAT_STOP_INSTANCE,
282  GETCB_WALK_STAT_STOP_OBJECT,
283  GETCB_WALK_STAT_STOP_WALK
284 } getcb_walker_status_t;
285 
286 
291 typedef struct getcb_keyval_t_ {
292  dlq_hdr_t qhdr;
293  xmlChar *value;
294  val_value_t *valnode;
295  obj_template_t *objnode;
296  boolean fixed_value;
297 } getcb_keyval_t;
298 
299 
301 typedef struct getcb_get2_lookup_t_ {
302  dlq_hdr_t qhdr;
303  obj_template_t *obj;
304  dlq_hdr_t keyvalQ;
305  boolean full_lookup;
306 } getcb_get2_lookup_t;
307 
308 
310 typedef struct getcb_get2_select_t_ {
311  dlq_hdr_t qhdr;
312  const xmlChar *modname;
313  const xmlChar *objname;
314 } getcb_get2_select_t;
315 
316 
327 typedef struct getcb_get2_getbulk_t_ {
328  dlq_hdr_t qhdr;
331  dlq_hdr_t return_keyQ;
332 
334  dlq_hdr_t return_valQ;
335 } getcb_get2_getbulk_t;
336 
337 
339 typedef struct getcb_get2_t_ {
340  dlq_hdr_t qhdr;
342  /********** I N P U T P A R A M E T E R S *******/
343 
345  xmlChar *txid_str;
346 
348  obj_template_t *obj;
349 
352 
359  dlq_hdr_t keyQ;
360 
365  dlq_hdr_t matchQ;
366 
380  dlq_hdr_t selectQ;
383  getcb_mode_t cbmode;
384 
388  uint32 max_entries;
389 
393  uint32 max_levels;
394 
396  boolean oper_data;
397 
402  boolean config_data;
403 
407  boolean expand_varexpr;
408 
412  boolean keys_only;
413 
417  boolean select_only;
418 
424  boolean with_defaults;
425 
442  getcb_api_mode_t api_mode;
443 
445  boolean with_origin;
446 
447  /********** I N T E R N A L S T A T E D A T A *******/
448 
453  val_value_t *start_add_key;
454 
456  boolean acmtest_result;
457 
459  boolean last_sibling;
460 
462  boolean isfirst_nokey;
463  boolean first_llsibling;
464  boolean last_llsibling;
465 
467  boolean islast;
468  boolean isfirst;
469  boolean aio_done;
472  boolean first_child;
473  boolean first_sibling;
476  boolean force_array_obj;
477 
478  /********** C A L L B A C K R E T U R N D A T A *******/
479 
484  boolean more_data;
485 
490  dlq_hdr_t getbulkQ;
497  xmlChar *active_case;
498 
500  dlq_hdr_t return_keyQ;
501 
503  dlq_hdr_t return_valQ;
504 
513  val_value_t return_val;
514 
518  dlq_hdr_t responseQ; // Q of getcb_get2_t structs
519 
527 
533 
535  val_value_t *parent_val;
536 
538 
546  dlq_hdr_t return_aioQ;
547 
549  ncx_nmda_ds_t nmda_ds;
550 
552  ncx_nmda_origin_t nmda_origin;
553 
557  ncx_msg_encoding_t aio_encoding;
558 
562  xmlChar *aio_return_buff;
563 
564 } getcb_get2_t;
565 
566 
579 typedef status_t
580  (*getcb_fn_t) (ses_cb_t *scb,
581  getcb_mode_t cbmode,
582  const val_value_t *virval,
583  val_value_t *dstval);
584 
585 
586 
606 typedef status_t
607  (*getcb_fn2_t) (ses_cb_t *scb,
608  xml_msg_hdr_t *msg,
609  getcb_get2_t *get2cb);
610 
611 
648 typedef getcb_walker_status_t
649  (*getcb_get2_walker_fn_t) (getcb_walker_mode_t walker_mode,
650  getcb_get2_t *get2cb,
651  obj_template_t *obj,
652  val_value_t *val,
653  void *cookie);
654 
655 
663 extern void
664  getcb_init_get2cb (getcb_get2_t *get2cb);
665 
666 
673 extern getcb_get2_t *
674  getcb_new_get2cb (void);
675 
676 
682 extern void
683  getcb_free_get2cb (getcb_get2_t *get2cb);
684 
685 
692 extern void
693  getcb_clean_get2cb (getcb_get2_t *get2cb,
694  boolean reuse);
695 
696 
706 extern void
707  getcb_add_return_val (getcb_get2_t *get2cb,
708  val_value_t *val);
709 
710 
717 extern val_value_t *
718  getcb_find_return_val (getcb_get2_t *get2cb,
719  obj_template_t *obj);
720 
721 
731 extern val_value_t *
732  getcb_find_return_val2 (getcb_get2_t *get2cb,
733  xmlns_id_t obj_nsid,
734  const xmlChar *obj_name);
735 
736 
749 extern val_value_t *
750  getcb_find_return_val_str (getcb_get2_t *get2cb,
751  xmlns_id_t obj_nsid,
752  const xmlChar *obj_name,
753  const xmlChar *valstr);
754 
755 
763 extern val_value_t *
764  getcb_find_next_return_val (getcb_get2_t *get2cb,
765  val_value_t *curval);
766 
767 
777 extern val_value_t *
778  getcb_find_key (getcb_get2_t *get2cb,
779  obj_template_t *obj);
780 
781 
792 extern val_value_t *
793  getcb_find_key_str (getcb_get2_t *get2cb,
794  const xmlChar *modname,
795  const xmlChar *objname);
796 
797 
810 extern val_value_t *
811  getcb_find_key_num (getcb_get2_t *get2cb,
812  const xmlChar *modname,
813  const xmlChar *objname,
814  uint32 keynum);
815 
816 
828 extern val_value_t *
829  getcb_find_key_lvl (getcb_get2_t *get2cb,
830  const xmlChar *modname,
831  const xmlChar *objname,
832  uint32 objlvl);
833 
834 
842 extern val_value_t *
843  getcb_find_match (getcb_get2_t *get2cb,
844  obj_template_t *obj);
845 
846 
856 extern void
857  getcb_add_key (getcb_get2_t *get2cb,
858  val_value_t *val);
859 
860 
869 extern void
870  getcb_add_match (getcb_get2_t *get2cb,
871  val_value_t *val);
872 
873 
884 extern status_t
885  getcb_add_select (getcb_get2_t *get2cb,
886  const xmlChar *modname,
887  const xmlChar *objname);
888 
889 
900 extern void
901  getcb_add_return_key (getcb_get2_t *get2cb,
902  val_value_t *val);
903 
904 
912 extern val_value_t *
913  getcb_find_return_key (getcb_get2_t *get2cb,
914  obj_template_t *obj);
915 
916 
926 extern val_value_t *
927  getcb_find_return_key2 (getcb_get2_t *get2cb,
928  xmlns_id_t obj_nsid,
929  const xmlChar *obj_name);
930 
931 
938 extern void
939  getcb_move_return_keys (getcb_get2_t *get2cb);
940 
941 
947 extern void
948  getcb_undo_move_return_keys (getcb_get2_t *get2cb);
949 
950 
956 extern void
957  getcb_clean_return_data (getcb_get2_t *get2cb);
958 
959 
974 extern val_value_t *
975  getcb_get2cb_to_request_val (getcb_get2_t *get2cb,
976  obj_template_t *get_request_obj,
977  boolean preserve_data,
978  xml_msg_hdr_t *msg,
979  status_t *res);
980 
981 
994 extern getcb_get2_t *
995  getcb_request_val_to_get2cb (val_value_t *get_request_val,
996  boolean preserve_data,
997  status_t *res);
998 
999 
1013 extern val_value_t *
1014  getcb_get2cb_to_response_val (getcb_get2_t *get2cb,
1015  obj_template_t *response_obj,
1016  boolean preserve_data,
1017  status_t *res);
1018 
1019 
1032 extern getcb_get2_t *
1033  getcb_response_val_to_get2cb (val_value_t *response_val,
1034  boolean preserve_data,
1035  status_t *res);
1036 
1037 
1045 extern void
1046  getcb_add_return_get2cb (getcb_get2_t *get2cb,
1047  getcb_get2_t *return_get2cb);
1048 
1049 
1057 extern status_t
1058  getcb_move_response_get2cb (getcb_get2_t *response_get2cb,
1059  getcb_get2_t *get2cb);
1060 
1061 
1072 extern status_t
1073  getcb_replace_response_get2cb (getcb_get2_t *response_get2cb,
1074  getcb_get2_t *get2cb,
1075  boolean replace_mode);
1076 
1077 
1099 extern status_t
1100  getcb_get2_child_obj (ses_cb_t *scb,
1101  xml_msg_hdr_t *msg,
1102  val_value_t *parentval,
1103  getcb_get2_t *parent_get2cb,
1104  obj_template_t *obj,
1105  boolean with_defaults,
1106  getcb_get2_walker_fn_t walkerfn,
1107  void *cookie);
1108 
1109 
1138 extern status_t
1139  getcb_get2_child_obj_ex (ses_cb_t *scb,
1140  xml_msg_hdr_t *msg,
1141  val_value_t *parentval,
1142  getcb_get2_t *parent_get2cb,
1143  obj_template_t *obj,
1144  boolean with_defaults,
1145  getcb_get2_walker_fn_t walkerfn,
1146  void *cookie,
1147  getcb_get2_t *force_get2cb,
1148  getcb_api_mode_t api_mode);
1149 
1150 
1162 extern status_t
1163  getcb_handle_acmtest (ses_cb_t *scb,
1164  xml_msg_hdr_t *msg,
1166  getcb_get2_t *get2cb);
1167 
1168 
1175 extern getcb_keyval_t *
1176  getcb_new_keyval (const xmlChar *keyval);
1177 
1178 
1187 extern getcb_keyval_t *
1188  getcb_new_keyval2 (val_value_t *keynode,
1189  obj_template_t *keyobj,
1190  boolean fixed_value);
1191 
1192 
1201 extern getcb_keyval_t *
1202  getcb_new_keyval3 (const xmlChar *keyval,
1203  obj_template_t *keyobj,
1204  boolean fixed_value);
1205 
1206 
1207 
1213 extern void
1214  getcb_free_keyval (getcb_keyval_t *keyval);
1215 
1216 
1217 
1223 extern void
1224  getcb_clean_keyvalQ (dlq_hdr_t *que);
1225 
1226 
1234 extern getcb_get2_lookup_t *
1235  getcb_new_get2_lookup (obj_template_t *obj,
1236  dlq_hdr_t *keyvalQ);
1237 
1238 
1244 extern void
1245  getcb_free_get2_lookup (getcb_get2_lookup_t *lookup);
1246 
1247 
1253 extern void
1254  getcb_clean_get2_lookupQ (dlq_hdr_t *lookupQ);
1255 
1256 
1264 extern getcb_get2_lookup_t *
1265  getcb_find_get2_lookup (obj_template_t *obj,
1266  dlq_hdr_t *lookupQ);
1267 
1268 
1276 extern getcb_get2_select_t *
1277  getcb_new_get2_select (const xmlChar *modname,
1278  const xmlChar *objname);
1279 
1280 
1286 extern void
1287  getcb_free_get2_select (getcb_get2_select_t *select_node);
1288 
1289 
1298 extern boolean
1299  getcb_find_get2_select (getcb_get2_t *get2cb,
1300  const xmlChar *modname,
1301  const xmlChar *objname);
1302 
1303 
1309 extern void
1310  getcb_dump_get2cb (getcb_get2_t *get2cb);
1311 
1312 
1322 extern boolean
1323  getcb_need_get2 (obj_template_t *curobj,
1324  obj_template_t *reqobj);
1325 
1326 
1340 extern boolean
1341  getcb_need_get2_ex (obj_template_t *curobj,
1342  obj_template_t *reqobj,
1343  uint32 *choicecnt,
1344  obj_template_t **top_choice);
1345 
1346 
1368 extern obj_template_t *
1369  getcb_first_requested_child (getcb_get2_t *get2cb,
1370  obj_template_t *parent_obj);
1371 
1372 
1393 extern obj_template_t *
1394  getcb_next_requested_child (getcb_get2_t *get2cb,
1395  obj_template_t *curchild);
1396 
1397 
1406 extern status_t
1407  getcb_set_active_case (getcb_get2_t *get2cb,
1408  const xmlChar *active_case_modname,
1409  const xmlChar *active_case);
1410 
1411 
1417 extern getcb_get2_getbulk_t *
1418  getcb_new_get2_getbulk (void);
1419 
1420 
1426 extern void
1427  getcb_free_get2_getbulk (getcb_get2_getbulk_t *getbulk);
1428 
1429 
1440 extern status_t
1441  getcb_finish_getbulk_entry (getcb_get2_t *get2cb);
1442 
1443 
1473 extern status_t
1474  getcb_pre_get2_choices (xml_msg_hdr_t *msg,
1475  ses_cb_t *scb,
1476  getcb_get2_t *parent_get2cb,
1477  obj_template_t *targobj,
1478  val_value_t *curval,
1479  uint32 choice_cnt,
1480  obj_template_t *top_choice,
1481  boolean *force_remove,
1482  getcb_get2_t **ret_get2cb);
1483 
1484 
1485 
1494 extern void
1495  getcb_log_walker (const xmlChar *caller,
1496  getcb_walker_mode_t walker_mode,
1497  const xmlChar *objname,
1498  const xmlChar *valname);
1499 
1500 
1508 extern status_t
1509  getcb_clone_keyQ (dlq_hdr_t *srcQ,
1510  dlq_hdr_t *destQ);
1511 
1512 
1520 extern boolean
1521  getcb_is_get_exact (getcb_get2_t *get2cb);
1522 
1523 
1529 extern void
1530  getcb_clean_responseQ (getcb_get2_t *get2cb);
1531 
1532 
1539 extern void
1540  getcb_add_return_aioQ (getcb_get2_t *get2cb,
1541  val_value_t *val);
1542 
1543 
1549 extern void
1550  getcb_clean_return_aioQ (getcb_get2_t *get2cb);
1551 
1552 
1562 extern boolean
1563  getcb_get2_allowed (xml_msg_hdr_t *msg,
1564  obj_template_t *chobj);
1565 
1566 
1575 extern getcb_get2_t *
1576  getcb_new_parent_get2cb (obj_template_t *obj,
1577  dlq_hdr_t *keyQ);
1578 
1579 
1590 extern boolean
1591  getcb_match_keys_lookup (obj_template_t *useobj,
1592  val_value_t *useval,
1593  getcb_get2_lookup_t *lookup);
1594 
1595 
1606 extern boolean
1607  getcb_match_keys_getcb (obj_template_t *useobj,
1608  val_value_t *useval,
1609  getcb_get2_t *get2cb);
1610 
1611 
1622 extern boolean
1623  getcb_match_keys_keyQ (obj_template_t *useobj,
1624  val_value_t *useval,
1625  dlq_hdr_t *srcQ);
1626 
1627 
1635 extern status_t
1636  getcb_add_return_aio_buff (getcb_get2_t *get2cb,
1637  const xmlChar *buffer);
1638 
1639 
1645 extern void
1646  getcb_clean_return_aio_buff (getcb_get2_t *get2cb);
1647 
1648 
1659 extern val_value_t *
1660  getcb_get2cb_to_val (getcb_get2_t *get2cb,
1661  status_t *retres);
1662 
1663 
1667 #ifdef __cplusplus
1668 } /* end extern 'C' */
1669 #endif
1670 
1671 #endif /* _H_getcb */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
GETCB_GETNEXT_VALUE
@ GETCB_GETNEXT_VALUE
GETNEXT request.
Definition: getcb.h:248
getcb_get2_t_::config_data
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:402
obj_first_child
obj_template_t * obj_first_child(obj_template_t *obj)
Get the first child object if the specified object has any children.
Definition: obj.c:6687
getcb_find_key_str
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:6020
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
getcb_find_key_lvl
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:6098
ncx_get_getbulk_max
uint32 ncx_get_getbulk_max(void)
Get the max_entries parameter for GET2 callbacks.
Definition: ncx.c:12899
getcb_keyval_t_::value
xmlChar * value
malloced, if set by agt_yangapi
Definition: getcb.h:293
val_child_add_last
status_t val_child_add_last(val_value_t *child, val_value_t *parent)
Add a child value node as last node to a parent value node.
Definition: val_child.c:1583
cfg.h
val_add_test_valindex
status_t val_add_test_valindex(val_value_t *parentval, val_value_t *keyval)
Make a dummy val_index_t for the getcg acmtest.
Definition: val.c:13752
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
dlq_block_enque
void dlq_block_enque(dlq_hdrT *srcP, dlq_hdrT *dstP)
add all the queue entries in the srcP queue list to the end of the dstP queue list
Definition: dlq.c:731
val_move_children
void val_move_children(val_value_t *srcval, val_value_t *destval)
Move all the child nodes from src to dest Source and dest must both be containers!
Definition: val.c:12651
xml_msg_clean_hdr
void xml_msg_clean_hdr(xml_msg_hdr_t *msg)
Clean all the memory used by the specified xml_msg_hdr_t but do not free the struct itself.
Definition: xml_msg.c:438
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
ses_new_indent_count
int32 ses_new_indent_count(boolean indent_in, int32 indent, int32 indent_amount)
Get the new indent count from the current and indent_amount.
Definition: ses.c:4148
val_check_obj_when_ex
status_t val_check_obj_when_ex(val_value_t *val, val_value_t *valroot, val_value_t *objval, obj_template_t *obj, xml_msg_hdr_t *mhdr, boolean configonly, boolean get_when, ses_cb_t *pcb_session, struct xpath_get2_cb_t_ *parent_cb, boolean *condresult, uint32 *whencount)
checks when-stmt only (extended)
xml_msg_get_lookupQ
dlq_hdr_t * xml_msg_get_lookupQ(xml_msg_hdr_t *msg)
Get the GET2 lookup Queue.
Definition: xml_msg.c:1606
getcb_free_keyval
void getcb_free_keyval(getcb_keyval_t *keyval)
Free a GET2 keyval.
Definition: getcb.c:7818
getcb_get2_t_::more_data
boolean more_data
set by the callback function if there are more instances that follow the specified instance; this is ...
Definition: getcb.h:484
tstamp.h
Timestamp utilities.
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
getcb_need_get2_ex
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:8266
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
getcb_mode_t_
getcb_mode_t_
get callback retrieval types; only get2 supports getnext
Definition: getcb.h:241
getcb_get2_t_::last_llsibling
boolean last_llsibling
leaf-list siblings
Definition: getcb.h:464
VAL_STRING
#define VAL_STRING(V)
Access the value as a string ONLY if typ_is_string(typdef) is true.
Definition: val.h:414
VAL_XPATHPCB
#define VAL_XPATHPCB(V)
Access the Xpath parser control block.
Definition: val.h:651
getcb_need_get2
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:8233
getcb_get2_t_::first_llsibling
boolean first_llsibling
leaf-list siblings
Definition: getcb.h:463
obj_is_terminal
boolean obj_is_terminal(const obj_template_t *obj)
Check if object is a proper leaf or leaflist or anyxml.
Definition: obj.c:13493
getcb_get2_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: getcb.h:340
obj_is_in_aio_get2
boolean obj_is_in_aio_get2(obj_template_t *obj)
Check if this object is a child of a node with sil-aio-get2 extension setup or if this object itself ...
Definition: obj.c:18305
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
getcb_replace_response_get2cb
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:7418
obj_has_aio_list
boolean obj_has_aio_list(obj_template_t *obj)
Check is AIO object is a list or if its parent is a list object.
Definition: obj.c:18458
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
NCX_MSG_ENCODING_XML
@ NCX_MSG_ENCODING_XML
XML message encoding.
Definition: ncxtypes.h:477
obj_is_leaf_list
boolean obj_is_leaf_list(const obj_template_t *obj)
Check if object is a proper leaf-list.
Definition: obj.c:13336
getcb_get2_getbulk_t_
GET2 getbulk struct This is only used for YANG list objects to produce N getnext entries at a time.
Definition: getcb.h:327
val.h
Value Node Basic Support.
ERR_NCX_MISSING_KEY
@ ERR_NCX_MISSING_KEY
383
Definition: status_enum.h:426
xml_util.h
XML Utilities.
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
getcb_free_get2_getbulk
void getcb_free_get2_getbulk(getcb_get2_getbulk_t *getbulk)
Free a getcb_get2_getbulk struct.
Definition: getcb.c:8513
getcb_clean_return_data
void getcb_clean_return_data(getcb_get2_t *get2cb)
Clean the return data in the return_val and return_valQ.
Definition: getcb.c:6381
getcb.h
GET1 and GET2 Callback Support.
val_next_child_same
val_value_t * val_next_child_same(val_value_t *curchild)
Get the next instance of the corresponding child node.
Definition: val.c:8456
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
getcb_get2_getbulk_t_::return_valQ
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:334
getcb_get2_t_::wrote_some_lists
boolean wrote_some_lists
If TRUE then Last list failed BUT some of the entries were written successfully.
Definition: getcb.h:532
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
status_enum.h
global error status code enumerations
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
getcb_pre_get2_choices
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:8611
val_child_find_nsid
val_value_t * val_child_find_nsid(const val_value_t *parent, xmlns_id_t child_nsid, const xmlChar *child_name)
Find the child node for the specified child name and namespace ID.
Definition: val_child.c:1775
getcb_get2_t_::active_case_modname
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:496
getcb_get2_t_::start_add_key
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:453
getcb_get2_t_::first_sibling
boolean first_sibling
first sibling done
Definition: getcb.h:473
getcb_new_keyval
getcb_keyval_t * getcb_new_keyval(const xmlChar *keyval)
Create a new GET2 keyval holder.
Definition: getcb.c:7728
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
getcb_free_get2_select
void getcb_free_get2_select(getcb_get2_select_t *select_node)
Free a getcb_get2_select struct.
Definition: getcb.c:8042
xml_wr.h
XML Write functions.
getcb_add_return_aioQ
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:8878
ncx_num.h
NCX Module Library Number Utility Functions.
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
ncx_nmda_get_origin_enum
ncx_nmda_origin_t ncx_nmda_get_origin_enum(const xmlChar *or_name)
Get the standard origin enum for the string.
Definition: ncx_nmda.c:420
getcb_get2_select_t_::objname
const xmlChar * objname
object name to select
Definition: getcb.h:313
xml_msg_inc_cur_depth
void xml_msg_inc_cur_depth(xml_msg_hdr_t *mhdr)
Increment the cur_depth parameter if needed.
Definition: xml_msg.c:1652
val_find_bit
boolean val_find_bit(val_value_t *val, const xmlChar *bitname)
Find the specified bit name in the NCX_BT_BITS value.
Definition: val.c:13690
getcb_get2_t_::api_mode
getcb_api_mode_t api_mode
api_mode: consumer API callback mode
Definition: getcb.h:442
getcb_add_return_val
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:5809
val_compare
int32 val_compare(const val_value_t *val1, const val_value_t *val2)
Compare 2 val_value_t struct value contents.
Definition: val.c:9456
getcb_get2_child_obj_ex
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:7602
val_get_value_ex
val_value_t * val_get_value_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, val_nodetest_fn_t testfn, boolean acmcheck, boolean *malloced, status_t *res, void *get2cb)
Get the value for a node after lots of internal processing (extended)
Definition: val_util.c:6161
obj_is_key
boolean obj_is_key(const obj_template_t *obj)
Check if object is being used as a key leaf within a list.
Definition: obj.c:14278
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
ERR_NCX_NO_INSTANCE
@ ERR_NCX_NO_INSTANCE
1009
Definition: status_enum.h:498
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
getcb_set_active_case
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:8454
getcb_get2_select_t_::qhdr
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:311
dlq_reverse_que
void dlq_reverse_que(dlq_hdr_t *que)
Reverse the order of all the entries in a Q.
Definition: dlq.c:1070
NCX_DC_CONFIG
@ NCX_DC_CONFIG
persistent config
Definition: ncxtypes.h:192
getcb_init_get2cb
void getcb_init_get2cb(getcb_get2_t *get2cb)
Init a GET2 control block.
Definition: getcb.c:5644
cfg_get_root
val_value_t * cfg_get_root(ncx_cfg_t cfgid)
Get the config root for the specified config.
Definition: cfg.c:3240
getcb_fn_t
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:580
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
getcb_new_get2_getbulk
getcb_get2_getbulk_t * getcb_new_get2_getbulk(void)
Create a new getcb_get2_getbulk struct.
Definition: getcb.c:8489
getcb_next_requested_child
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:8409
getcb_get2_t_::active_case
xmlChar * active_case
name of the active case
Definition: getcb.h:497
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
getcb_add_return_aio_buff
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:9220
dlq_swap
void dlq_swap(void *new_node, void *cur_node)
remove the cur_node queue entry from its queue list and replace it with the new_node
Definition: dlq.c:562
getcb_get2_t_::parent_val
val_value_t * parent_val
save parent backtrs for when-stmt processing of GET2 data
Definition: getcb.h:535
getcb_get2_t_::aio_done
boolean aio_done
AIO processing is completed.
Definition: getcb.h:469
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
getcb_clean_return_aioQ
void getcb_clean_return_aioQ(getcb_get2_t *get2cb)
Clean the return data return_aioQ.
Definition: getcb.c:8905
xpath1.h
XPath 1.0 expression support.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
getcb_free_get2_lookup
void getcb_free_get2_lookup(getcb_get2_lookup_t *lookup)
Free a getcb_get2_lookup struct.
Definition: getcb.c:7908
VAL_SET_FIXED_VALUE
#define VAL_SET_FIXED_VALUE(V)
flag the value as a fixed key value for GETNEXT processing
Definition: val.h:573
getcb_walker_status_t_
getcb_walker_status_t_
get2 walker callback return status values
Definition: getcb.h:278
getcb_keyval_t_::valnode
val_value_t * valnode
if set by agt_tree
Definition: getcb.h:294
getcb_get2_lookup_t_::obj
obj_template_t * obj
request_target_obj to get
Definition: getcb.h:303
val_nodetest_fn_t
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
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
obj_use_get_when_check
boolean obj_use_get_when_check(const obj_template_t *obj)
check an object needs to use a when-check for GET processing
Definition: obj.c:18243
getcb_find_return_key2
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:6279
getcb_get2_t_::keyQ
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:359
ses_clean_breadcrumbQ
void ses_clean_breadcrumbQ(ses_cb_t *scb)
Clean the breadcrumbQ.
Definition: ses.c:4841
getcb_add_return_key
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:5969
getcb_new_get2_select
getcb_get2_select_t * getcb_new_get2_select(const xmlChar *modname, const xmlChar *objname)
Create a new getcb_select_t struct.
Definition: getcb.c:8015
getcb_find_get2_select
boolean getcb_find_get2_select(getcb_get2_t *get2cb, const xmlChar *modname, const xmlChar *objname)
Find a getcb_get2_select struct.
Definition: getcb.c:8066
obj_get_real_level
uint32 obj_get_real_level(const obj_template_t *obj)
Get the nest level for the specified object Top-level is '1' Does not count groupings as a level Does...
Definition: obj.c:11871
getcb_get2_t_::return_aioQ
dlq_hdr_t return_aioQ
Q of malloced val_value_t.
Definition: getcb.h:546
xml_val.h
Utility functions for creating value structs.
XML_MSG_GETBULK
#define XML_MSG_GETBULK(M)
NETCONF <get-bulk> support.
Definition: xml_msg.h:267
getcb_get2_t_::parent_cb
struct getcb_get2_t_ * parent_cb
backptr to parent CB
Definition: getcb.h:537
getcb_new_get2_lookup
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:7865
getcb_get2_allowed
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:8931
val_dump_value
void val_dump_value(val_value_t *val, int32 startindent, log_debug_t lvl)
Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (...
Definition: val.c:5688
getcb_get2_t_::cbmode
getcb_mode_t cbmode
reason for the callback (get or getnext)
Definition: getcb.h:383
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
getcb_match_keys_getcb
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:9100
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
xml_msg_get_matchQ
dlq_hdr_t * xml_msg_get_matchQ(xml_msg_hdr_t *msg)
Get the GET2 match Queue.
Definition: xml_msg.c:1621
getcb_get2_t_::acmtest_result
boolean acmtest_result
acmtest result used for NACM check
Definition: getcb.h:456
getcb_get2_child_obj
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:7541
getcb_get2_t_::oper_data
boolean oper_data
TRUE to get operational data.
Definition: getcb.h:396
ses_message_indent_count
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:2822
getcb_get2_lookup_t_::keyvalQ
dlq_hdr_t keyvalQ
Q of getcb_keyval_t.
Definition: getcb.h:304
getcb_add_match
void getcb_add_match(getcb_get2_t *get2cb, val_value_t *val)
Add a match node to a get2cb matchQ.
Definition: getcb.c:6192
getcb_get2_t_::return_val
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:513
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
val_gen_index_chain
status_t val_gen_index_chain(const obj_template_t *obj, val_value_t *val)
Create an index chain for the just-parsed table or container struct.
Definition: val_util.c:2632
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
getcb_move_response_get2cb
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:7395
getcb_get2_t_::return_keyQ
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:500
getcb_clone_keyQ
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:8779
val_add_datapath_attr
status_t val_add_datapath_attr(val_value_t *val, obj_template_t *obj)
Add the ye:datapath attribute to a node that is tagged as an ywx:datapath node.
Definition: val_util.c:7041
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
getcb_get2_t_::aio_encoding
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:557
val_util.h
Value Node Utilities.
json_wr.h
JSON Write functions.
getcb_clean_get2_lookupQ
void getcb_clean_get2_lookupQ(dlq_hdr_t *lookupQ)
Clean a queue of getcb_get2_lookup_t.
Definition: getcb.c:7934
NCX_NMDA_ORIGIN_NONE
@ NCX_NMDA_ORIGIN_NONE
not set
Definition: ncxtypes.h:1349
getcb_clean_return_aio_buff
void getcb_clean_return_aio_buff(getcb_get2_t *get2cb)
Clean the return AIO buffer, XML or JSON buffer.
Definition: getcb.c:9262
NCX_MSG_ENCODING_JSON
@ NCX_MSG_ENCODING_JSON
JSON message encoding.
Definition: ncxtypes.h:480
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
getcb_get2_lookup_t_::full_lookup
boolean full_lookup
T: all keys present;.
Definition: getcb.h:305
getcb_get2_t_::matchQ
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:365
getcb_find_return_val_str
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:5904
obj_next_child
obj_template_t * obj_next_child(obj_template_t *obj)
Get the next child object if the specified object has any children.
Definition: obj.c:6860
getcb_find_return_val
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:5838
log_debug_append
void void void void void void void void log_debug_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG log entry.
getcb_get2cb_to_val
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:9296
getcb_add_return_get2cb
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:7373
rpc.h
NETCONF protocol remote procedure call common definitions.
getcb_find_match
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:6142
getcb_get2_t_::nmda_ds
ncx_nmda_ds_t nmda_ds
save NMDA datastore for GET operational
Definition: getcb.h:549
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_clone
val_value_t * val_clone(const val_value_t *val)
Clone a specified val_value_t struct and sub-trees.
Definition: val.c:7836
json_parse_buffer
status_t json_parse_buffer(xmlChar *buff, obj_template_t *obj, dlq_hdr_t *returnQ)
Parse buffer of JSON into val_value_t structs.
Definition: json_parse.c:2639
getcb_get2_t_::last_sibling
boolean last_sibling
flag to track JSON state
Definition: getcb.h:459
val_child.h
Value Node Child Access Support.
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
ncx_obj_is_generic
boolean ncx_obj_is_generic(const obj_template_t *obj)
Check if the object is 1 of the gen_foo object templates.
Definition: ncx.c:13013
getcb_free_get2cb
void getcb_free_get2cb(getcb_get2_t *get2cb)
Clean and free a malloced GET2 control block.
Definition: getcb.c:5694
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
getcb_get2_t_::match_test_done
boolean match_test_done
content-match done flag ignored unless the matchQ is non-empty If TRUE.
Definition: getcb.h:526
getcb_get2_t_::nmda_origin
ncx_nmda_origin_t nmda_origin
caller will set the return nmda_origin
Definition: getcb.h:552
getcb_find_key_num
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:6049
dlq_count
unsigned int dlq_count(const dlq_hdrT *listP)
get the number of queue entries in the listP queue list
Definition: dlq.c:994
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
obj_get_real_parent
obj_template_t * obj_get_real_parent(obj_template_t *obj)
Get the parent of the current object; skip OBJ_TYP_CHOICE and OBJ_TYP_CASE.
Definition: obj.c:12733
getcb_get2_t_::max_levels
uint32 max_levels
0 for all levels, 1 .
Definition: getcb.h:393
getcb_match_keys_lookup
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:9012
getcb_get2_t_::selectQ
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:380
obj_get_config_flag
boolean obj_get_config_flag(const obj_template_t *obj)
Get the config flag for an obj_template_t Return the explicit value or the inherited value Also retur...
Definition: obj.c:11174
ncx_is_with_snmp
boolean ncx_is_with_snmp(void)
Get the with_snmp value.
Definition: ncx.c:13958
obj_is_anydata
boolean obj_is_anydata(const obj_template_t *obj)
Check if object is an anydata.
Definition: obj.c:13284
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
xml_parse.h
XML Parser functions.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
getcb_get2_t_::expand_varexpr
boolean expand_varexpr
variable expressions: TRUE if a varexpr node should be expanded; FALSE if printed as an expression
Definition: getcb.h:407
xml_wr_full_check_val
void xml_wr_full_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean expand_varexpr)
Generate entire val_value_t *w/filter)
Definition: xml_wr.c:3517
getcb_new_parent_get2cb
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:8971
xpath1_get2_free_fake_nodes
void xpath1_get2_free_fake_nodes(dlq_hdr_t *resnodeQ)
Free the queue of dummy resnodes chain for XPath processing of a GET2 node as the context node.
Definition: xpath1_get2.c:2412
GETCB_GET_VALUE
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:247
XML_MSG_GET2CB_ALLINONE
#define XML_MSG_GET2CB_ALLINONE(M)
GET2 control block backptr to be used in AIO mode.
Definition: xml_msg.h:312
getcb_get2cb_to_request_val
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:6417
obj_gen_object_id_prefix
status_t obj_gen_object_id_prefix(const obj_template_t *obj, xmlChar **buff)
Malloc and Generate the object ID for an object node Use the prefix in every node.
Definition: obj.c:10034
getcb_get2_t_::force_array_obj
boolean force_array_obj
force JSON array output
Definition: getcb.h:476
val_make_sprintf_string
xmlChar * val_make_sprintf_string(const val_value_t *val)
Malloc a buffer and then sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:10323
getcb_walker_mode_t_
getcb_walker_mode_t_
get2 walker callback modes
Definition: getcb.h:261
obj_is_np_container
boolean obj_is_np_container(const obj_template_t *obj)
Check if the object is an Non-Presence-container.
Definition: obj.c:14487
ERR_NCX_NOT_FOUND
@ ERR_NCX_NOT_FOUND
225
Definition: status_enum.h:264
xpath1_eval_expr2
xpath_result_t * xpath1_eval_expr2(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, status_t *res)
Evaluate an XPath expression (alt)
Definition: xpath1.c:5347
obj_first_terminal_child
obj_template_t * obj_first_terminal_child(obj_template_t *obj)
Get the first child object if the specified object has any children; MUST BE A TERMINAL NODE!...
Definition: obj.c:6729
getbulk_check_get2
status_t getbulk_check_get2(getbulk_cb_t *bulk, obj_template_t *obj, uint32 *max_entries, val_value_t **last_entry)
Check the GET2 object against the getbulk request to see if it needs to be processed as get-bulk or n...
Definition: getbulk.c:151
getcb_get2_select_t_::modname
const xmlChar * modname
module name to select
Definition: getcb.h:312
val_init_value
void val_init_value(val_value_t *val)
Initialize the generic fields in a val_value_t so it is ready for use.
Definition: val.c:2725
NCX_DC_STATE
@ NCX_DC_STATE
state or statistics
Definition: ncxtypes.h:193
obj_is_anyxml
boolean obj_is_anyxml(const obj_template_t *obj)
Check if object is an anyxml.
Definition: obj.c:13271
getcb_keyval_t_
Key value holder, temp Q of ordered key leaf values used while parsing a path to store the keys until...
Definition: getcb.h:291
getcb_request_val_to_get2cb
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:6797
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
xml_msg_init_hdr
void xml_msg_init_hdr(xml_msg_hdr_t *msg)
Initialize a new xml_msg_hdr_t struct.
Definition: xml_msg.c:393
obj_is_container
boolean obj_is_container(const obj_template_t *obj)
Check if object is a YANG container.
Definition: obj.c:13405
ncx_nmda.h
NMDA Data Support.
ncx_sprintf_num
status_t ncx_sprintf_num(xmlChar *buff, const ncx_num_t *num, ncx_btype_t btyp, uint32 *len)
Sprintf a ncx_num_t contents.
Definition: ncx_num.c:2357
VAL_UINT
#define VAL_UINT(V)
Access the value as an uint32 ONLY if NCX_BT_UINT8, 16, 32.
Definition: val.h:482
log_debug4_append
void void void void void void void void void void void void void void log_debug4_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG4 log entry.
XML_MSG_NMDA_PARAMS
#define XML_MSG_NMDA_PARAMS(M)
NMDA params.
Definition: xml_msg.h:316
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
getcb_get2_t_::responseQ
dlq_hdr_t responseQ
if this is a request that causes multiple responses then the responseQ will have each response get2cb
Definition: getcb.h:518
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
getcb_new_keyval2
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:7757
getcb_new_get2cb
getcb_get2_t * getcb_new_get2cb(void)
Malloc and init a new get2 control block.
Definition: getcb.c:5672
getcb_add_select
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:6220
getcb_new_keyval3
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:7786
getcb_finish_getbulk_entry
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:8552
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
getcb_is_get_exact
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:8812
VAL_BOOL
#define VAL_BOOL(V)
Access the value as a boolean ONLY IF btyp == NCX_BT_BOOLEAN.
Definition: val.h:405
getcb_get2_t_::with_defaults
boolean with_defaults
with_defaults: TRUE if default nodes should be returned this is needed for operational data because t...
Definition: getcb.h:424
obj_has_when_stmts
boolean obj_has_when_stmts(obj_template_t *obj)
Check if any when-stmts apply to this object Does not check if they are true, just any when-stmts pre...
Definition: obj.c:14980
getcb_find_next_return_val
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:5932
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
NCX_NMDA_DS_OPERATIONAL
@ NCX_NMDA_DS_OPERATIONAL
operational datastore
Definition: ncxtypes.h:1343
getcb_handle_acmtest
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:7661
getcb_get2_t_::testfn
val_nodetest_fn_t testfn
value node test function (may be obsolete for get2)
Definition: getcb.h:351
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
ses_add_breadcrumb_obj
status_t ses_add_breadcrumb_obj(ses_cb_t *scb, struct obj_template_t_ *obj)
Add an object to the breadcrumbQ.
getbulk_create_last_keys_get2
status_t getbulk_create_last_keys_get2(getbulk_cb_t *bulk, dlq_hdr_t *keyQ)
Create the <last-keys> container and clone the keys from the lastval; For GET2 callback.
Definition: getbulk.c:280
getcb_move_return_keys
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:6306
ncx_nmda_get_origin_str
const xmlChar * ncx_nmda_get_origin_str(ncx_nmda_origin_t or_enum)
Get the standard origin string for the enum.
Definition: ncx_nmda.c:455
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
getcb_get2_t_::keys_only
boolean keys_only
keys-only: TRUE if only the key leafs are desired from list objects; FALSE if normal retrieval
Definition: getcb.h:412
getcb_add_key
void getcb_add_key(getcb_get2_t *get2cb, val_value_t *val)
Add a keyval to a get2cb keyQ.
Definition: getcb.c:6167
xpath_clone_pcb
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
xml_msg_get_start_depth
uint32 xml_msg_get_start_depth(xml_msg_hdr_t *msg)
Get the message start_depth value.
Definition: xml_msg.c:1377
getcb_keyval_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: getcb.h:292
getcb_match_keys_keyQ
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:9163
val_clean_value
void val_clean_value(val_value_t *val)
Clean a static val_value_t struct.
Definition: val.c:13667
obj_is_top_aio_get2
boolean obj_is_top_aio_get2(obj_template_t *obj)
Check if this object is a really top level holder of extension sil-aio-get2.
Definition: obj.c:18349
getcb_get2_t_::islast
boolean islast
Used only for AIO RESTCONF processing.
Definition: getcb.h:467
getcb_get2_t_::return_valQ
dlq_hdr_t return_valQ
Q of malloced val_value_t.
Definition: getcb.h:503
getcb_get2_t_::max_entries
uint32 max_entries
max instances to get 0 for all entries, 1 .
Definition: getcb.h:388
val_clean_valQ
void val_clean_valQ(dlq_hdr_t *valQ)
Clean a queue of val_value_t.
Definition: val.c:13911
NCX_BT_UINT32
@ NCX_BT_UINT32
uint32
Definition: ncxtypes.h:213
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
getcb_log_walker
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:8725
getcb_get2_t_::getbulkQ
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:490
typ_is_string
boolean typ_is_string(ncx_btype_t btyp)
Check if the base type is a simple string (not list)
Definition: typ.c:4097
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
val_has_children
boolean val_has_children(const val_value_t *val)
Determine if there are any child nodes for this val.
Definition: val.c:13719
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
XML_MSG_XGET_REQ
#define XML_MSG_XGET_REQ(M)
<get> for XPath filter
Definition: xml_msg.h:301
log_debug2_append
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
getcb_clean_keyvalQ
void getcb_clean_keyvalQ(dlq_hdr_t *que)
Free all the Get2 keyvals from a dlq_hdr.
Definition: getcb.c:7843
xml_msg_get_selectQ
dlq_hdr_t * xml_msg_get_selectQ(xml_msg_hdr_t *msg)
Get the GET2 select Queue.
Definition: xml_msg.c:1636
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
ses_get_out_encoding
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4126
getcb_get2_walker_fn_t
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:649
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
getcb_find_get2_lookup
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:7964
xml_parse_buffer
status_t xml_parse_buffer(xmlChar *buff, obj_template_t *obj, dlq_hdr_t *returnQ)
Parse buffer of XML into val_value_t structs.
Definition: xml_parse.c:4498
getcb_get2_getbulk_t_::return_keyQ
dlq_hdr_t return_keyQ
Q of malloced val_value_t.
Definition: getcb.h:331
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
getcb_get2_t_::txid_str
xmlChar * txid_str
transaction ID string
Definition: getcb.h:345
xpath1_get2_create_fake_nodes
status_t xpath1_get2_create_fake_nodes(getcb_get2_t *parent_get2cb, dlq_hdr_t *resnodeQ, xpath_get2_cb_t **retcb)
@brief Create a dummy resnode chain for XPath processing of a GET2 node as the context node
Definition: xpath1_get2.c:2295
getcb_dump_get2cb
void getcb_dump_get2cb(getcb_get2_t *get2cb)
Print the interesting fields in a get2cb.
Definition: getcb.c:8117
ncx.h
YANG module utility functions.
getcb_fn2_t
status_t(* getcb_fn2_t)(ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *get2cb)
GET2 PRODUCER FUNCTION.
Definition: getcb.h:607
obj_get_level
uint32 obj_get_level(const obj_template_t *obj)
Get the nest level for the specified object Top-level is '1' Does not count groupings as a level.
Definition: obj.c:11833
obj.h
Data Object Support.
getcb_get2_lookup_t_::qhdr
dlq_hdr_t qhdr
in case added to a queue
Definition: getcb.h:302
getcb_find_return_key
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:6253
json_parse.h
JSON input stream parser module.
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
obj_key_count
uint32 obj_key_count(const obj_template_t *obj)
Get the number of keys for this object.
Definition: obj.c:9637
getcb_clean_responseQ
void getcb_clean_responseQ(getcb_get2_t *get2cb)
Clean the response Q within a get2cb.
Definition: getcb.c:8852
getcb_first_requested_child
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:8353
obj_next_terminal_child
obj_template_t * obj_next_terminal_child(obj_template_t *obj)
Get the next child object if the specified object has any children; MUST BE TERMINAL NODE!...
Definition: obj.c:6895
xpath_find_schema_target_int
status_t xpath_find_schema_target_int(const xmlChar *target, obj_template_t **targobj)
@
Definition: xpath.c:2475
getcb_get2_t_::force_lastsibling
boolean force_lastsibling
force JSON state
Definition: getcb.h:474
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
getcb_clean_get2cb
void getcb_clean_get2cb(getcb_get2_t *get2cb, boolean reuse)
Clean a get2 control block.
Definition: getcb.c:5716
XML_MSG_GET2_TARGET
#define XML_MSG_GET2_TARGET(M)
GET2 request target terminal node.
Definition: xml_msg.h:270
getcb_get2_lookup_t_
GET2 lookup struct.
Definition: getcb.h:301
getcb_get2_t_::force_lastsib_value
boolean force_lastsib_value
force JSON state
Definition: getcb.h:475
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
json_wr_max_check_val
status_t json_wr_max_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn, boolean isfirst, boolean islast, boolean isfirstchild, boolean isfirstsibling, boolean force_lastsibling, boolean force_lastsib_value, boolean force_array_obj)
generate entire val_value_t *w/filter)
Definition: json_wr.c:1955
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
getcb_get2_t_::with_origin
boolean with_origin
get-request with-origin flag
Definition: getcb.h:445
ERR_NCX_SESSION_DROPPED
@ ERR_NCX_SESSION_DROPPED
400
Definition: status_enum.h:443
getcb_response_val_to_get2cb
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:7238
val_compare_to_string
int32 val_compare_to_string(const val_value_t *val1, const xmlChar *strval2, status_t *res)
Compare a val_value_t struct value contents to a string.
Definition: val.c:9493
getcb_get2_getbulk_t_::qhdr
dlq_hdr_t qhdr
will be added to a queue
Definition: getcb.h:328
getcb_undo_move_return_keys
void getcb_undo_move_return_keys(getcb_get2_t *get2cb)
Move back the return keys from the keyQ.
Definition: getcb.c:6353
val_has_complex_child
boolean val_has_complex_child(const val_value_t *val)
Check if the value has complex children nodes.
Definition: val.c:15120
getcb_keyval_t_::objnode
obj_template_t * objnode
if set by agt_tree
Definition: getcb.h:295
getcb_get2_t_::obj
obj_template_t * obj
object template containing this callback
Definition: getcb.h:348
NCX_DISPLAY_MODE_JSON
@ NCX_DISPLAY_MODE_JSON
JSON (RFC 7951 format)
Definition: ncxtypes.h:466
xmlns.h
XML namespace support.
getcb_find_key
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:5994
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
obj_is_root
boolean obj_is_root(const obj_template_t *obj)
Check if object is marked as a root object.
Definition: obj.c:14152
status.h
Global error messages for status code enumerations.
getcb_get2_t_::aio_return_buff
xmlChar * aio_return_buff
AIO XML or JSON malloced buffer from callback to use.
Definition: getcb.h:562
yangapi.h
YANG-API definitions (pre-RESTCONF)
getbulk_with_get2
boolean getbulk_with_get2(getbulk_cb_t *bulk, obj_template_t *obj)
Check the GET2 object against the getbulk request to see if it needs to be processed as get-bulk or n...
Definition: getbulk.c:188
getcb_get2_t_::isfirst_nokey
boolean isfirst_nokey
flag to track JSON state
Definition: getcb.h:462
NCX_DISPLAY_MODE_XML
@ NCX_DISPLAY_MODE_XML
XML display mode.
Definition: ncxtypes.h:460
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
obj_has_get2cb
boolean obj_has_get2cb(obj_template_t *obj)
Check if current object has GET2 callback registered.
Definition: obj.c:18099
getcb_get2cb_to_response_val
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:7012
GETCB_NONE
@ GETCB_NONE
not set
Definition: getcb.h:246
obj_find_child_choice_case
obj_template_t * obj_find_child_choice_case(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6201
getcb_get2_t_::isfirst
boolean isfirst
also used for JSON subtree proc
Definition: getcb.h:468
getcb_get2_t_::first_child
boolean first_child
Used for JSON subtree proccessing.
Definition: getcb.h:472
val_get_first_terminal_child
val_value_t * val_get_first_terminal_child(const val_value_t *parent)
Get the child node only if obj_is_terminal(val->obj) is true.
Definition: val.c:8515
val_gen_keyclones
status_t val_gen_keyclones(val_value_t *val, dlq_hdr_t *keyQ)
Get all the keys for the specified data node object.
Definition: val_util.c:6987
getcb_find_return_val2
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:5869
getcb_get2_t_
GET2 control block.
Definition: getcb.h:339
ses_dropped_ex
boolean ses_dropped_ex(ses_cb_t *scb)
Check if the session has been dropped by the client.
Definition: ses.c:5005
typ_has_children
boolean typ_has_children(ncx_btype_t btyp)
Check if this is a data type that uses the val.v.childQ.
Definition: typ.c:3056
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
getbulk.h
yumaworks-getbulk.yang data structure support
getcb_keyval_t_::fixed_value
boolean fixed_value
if partial keys
Definition: getcb.h:296
getcb_get2_t_::select_only
boolean select_only
select: TRUE if only the selectQ child nodes are desired from the parent for this callback; FALSE if ...
Definition: getcb.h:417
getcb_get2_select_t_
GET2 select struct.
Definition: getcb.h:310