yumapro  21.10T-10
YumaPro SDK
xml_msg.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_xml_msg
13 #define _H_xml_msg
14 /* FILE: xml_msg.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
29 /*********************************************************************
30 * *
31 * C H A N G E H I S T O R Y *
32 * *
33 *********************************************************************
34 
35 date init comment
36 ----------------------------------------------------------------------
37 14-jan-07 abb Begun; split from agt_rpc.h
38 28-feb-13 abb Add JSON, <get2>, and YANG-API support
39 */
40 
41 #ifndef _H_ncxtypes
42 #include "ncxtypes.h"
43 #endif
44 
45 #ifndef _H_status
46 #include "status.h"
47 #endif
48 
49 #ifndef _H_val
50 #include "val.h"
51 #endif
52 
53 #ifndef _H_xmlns
54 #include "xmlns.h"
55 #endif
56 
57 #ifndef _H_xml_util
58 #include "xml_util.h"
59 #endif
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /********************************************************************
66 * *
67 * C O N S T A N T S *
68 * *
69 *********************************************************************/
70 
101 #define XML_MSG_FL_PREFIX bit0
102 
104 #define XML_MSG_FL_ETAGS bit1
105 
107 #define XML_MSG_FL_ETAGS_TEST bit2
108 
112 #define XML_MSG_FL_TSTAMPS bit3
113 
115 #define XML_MSG_FL_TSTAMPS_TEST bit4
116 
118 #define XML_MSG_FL_KEYS bit5
119 
121 #define XML_MSG_FL_PASSED bit6
122 
130 #define XML_MSG_FL_DELTA bit7
131 
135 #define XML_MSG_FL_OWNERS bit8
136 
140 #define XML_MSG_FL_GET2 bit9
141 
143 #define XML_MSG_FL_MODTAGS bit10
144 
146 #define XML_MSG_FL_MODTAGS_EMPTY bit11
147 
149 #define XML_MSG_FL_ANYXML_TRACK bit12
150 
151 
153 #define XML_MSG_USE_PREFIX(M) ((M)->flags & XML_MSG_FL_PREFIX)
154 
156 #define XML_MSG_NO_PREFIX(M) ((M)->flags &= ~XML_MSG_FL_PREFIX)
157 
158 
159 /* ETAGS */
160 
162 #define XML_MSG_WITH_ETAGS(M) ((M)->flags & XML_MSG_FL_ETAGS)
163 
165 #define XML_MSG_WITH_ETAGS_TEST(M) ((M)->flags & XML_MSG_FL_ETAGS_TEST)
166 
168 #define XML_MSG_SET_WITH_ETAGS(M) (M)->flags |= XML_MSG_FL_ETAGS
169 
171 #define XML_MSG_SET_WITH_ETAGS_TEST(M) (M)->flags |= XML_MSG_FL_ETAGS_TEST
172 
174 #define XML_MSG_CLR_WITH_ETAGS_TEST(M) (M)->flags &= ~XML_MSG_FL_ETAGS_TEST
175 
176 
177 /* TIMESTAMPS */
178 
180 #define XML_MSG_WITH_TSTAMPS(M) ((M)->flags & XML_MSG_FL_TSTAMPS)
181 
183 #define XML_MSG_WITH_TSTAMPS_TEST(M) ((M)->flags & XML_MSG_FL_TSTAMPS_TEST)
184 
186 #define XML_MSG_SET_WITH_TSTAMPS(M) (M)->flags |= XML_MSG_FL_TSTAMPS
187 
189 #define XML_MSG_SET_WITH_TSTAMPS_TEST(M) (M)->flags |= XML_MSG_FL_TSTAMPS_TEST
190 
192 #define XML_MSG_CLR_WITH_TSTAMPS_TEST(M) (M)->flags &= ~XML_MSG_FL_TSTAMPS_TEST
193 
195 #define XML_MSG_TSTAMPS_PASSED(M) ((M)->flags & XML_MSG_FL_PASSED)
196 
198 #define XML_MSG_SET_TSTAMPS_PASSED(M) (M)->flags |= XML_MSG_FL_PASSED
199 
201 #define XML_MSG_DELTA(M) ((M)->flags & XML_MSG_FL_DELTA)
202 
204 #define XML_MSG_SET_DELTA(M) (M)->flags |= XML_MSG_FL_DELTA
205 
206 
208 #define XML_MSG_KEYS_ONLY(M) ((M)->flags & XML_MSG_FL_KEYS)
209 
211 #define XML_MSG_SET_KEYS_ONLY(M) (M)->flags |= XML_MSG_FL_KEYS
212 
213 /* WITH-OWNERS */
214 
216 #define XML_MSG_WITH_OWNERS(M) ((M)->flags & XML_MSG_FL_OWNERS)
217 
219 #define XML_MSG_SET_WITH_OWNERS(M) (M)->flags |= XML_MSG_FL_OWNERS
220 
222 #define XML_MSG_CLR_WITH_OWNERS(M) (M)->flags &= ~XML_MSG_FL_OWNERS
223 
224 
225 /* GET2 */
226 
228 #define XML_MSG_WITH_GET2(M) ((M)->flags & XML_MSG_FL_GET2) ? TRUE : FALSE
229 
231 #define XML_MSG_SET_WITH_GET2(M) (M)->flags |= XML_MSG_FL_GET2
232 
234 #define XML_MSG_CLR_WITH_GET2(M) (M)->flags &= ~XML_MSG_FL_GET2
235 
237 #define XML_MSG_SET_LOOKUPQ(M,Q) (M)->lookupQ = Q
238 
240 #define XML_MSG_SET_MATCHQ(M,Q) (M)->matchQ = Q
241 
243 #define XML_MSG_SET_SELECTQ(M,Q) (M)->selectQ = Q
244 
245 
246 /* ANYXML-TRACKING */
247 
249 #define XML_MSG_ANYXML_TRACK(M) ((M)->flags & XML_MSG_FL_ANYXML_TRACK)
250 
252 #define XML_MSG_SET_ANYXML_TRACK(M) (M)->flags |= XML_MSG_FL_ANYXML_TRACK
253 
255 #define XML_MSG_CLR_ANYXML_TRACK(M) (M)->flags &= ~XML_MSG_FL_ANYXML_TRACK
256 
258 #define XML_MSG_ANYXML_OBJ(M) (M)->anyxml_obj
259 
261 #define XML_MSG_GET_ERROR_DATAQ(M) &(M)->error_dataQ
262 
264 #define XML_MSG_ACTIONVAL(M) (M)->actionval
265 
267 #define XML_MSG_GETBULK(M) (M)->getbulk_cb
268 
270 #define XML_MSG_GET2_TARGET(M) (M)->get2_target
271 
273 #define XML_MSG_GET2CB(M) (M)->get2cb
274 
275 /* MODTAGS */
276 
278 #define XML_MSG_WITH_MODTAGS(M) ((M)->flags & XML_MSG_FL_MODTAGS)
279 
281 #define XML_MSG_SET_WITH_MODTAGS(M) (M)->flags |= XML_MSG_FL_MODTAGS
282 
284 #define XML_MSG_WITH_MODTAGS_EMPTY(M) \
285  ((M)->flags & XML_MSG_FL_MODTAGS_EMPTY)
286 
288 #define XML_MSG_SET_WITH_MODTAGS_EMPTY(M) \
289  (M)->flags |= XML_MSG_FL_MODTAGS_EMPTY
290 
292 #define XML_MSG_YPGNMI_GETCB(M) (M)->gnmi_getcb
293 
295 #define XML_MSG_YPGNMI_EDITCB(M) (M)->gnmi_editcb
296 
298 #define XML_MSG_PRUNE_BAD_DATA(M) (M)->prune_bad_data
299 
301 #define XML_MSG_XGET_REQ(M) (M)->xget_request
302 
304 #define XML_MSG_ALLINONE_MODE(M) (M)->all_in_one_mode
305 
309 #define XML_MSG_LAST_GET2_FILPTR(M) (M)->get2_filptr
310 
312 #define XML_MSG_GET2CB_ALLINONE(M) (M)->get2cb
313 
314 
316 #define XML_MSG_NMDA_PARAMS(M) (M)->nmda_params
317 
319 #define XML_MSG_WITH_ORIGIN(M) \
320  ((M)->nmda_params && (M)->nmda_params->with_origin)
321 
323 #define XML_MSG_EDIT_CONFIG_ROOT(M) (M)->edit_config_root
324 
326 #define XML_MSG_DEPTH_TARGET(M) (M)->depth_target
327 
328 
330 #define XML_MSG_NMDA_OPERATIONAL(M) \
331  ((M)->nmda_params && \
332  ((M)->nmda_params->nmda_ds == NCX_NMDA_DS_OPERATIONAL))
333 
334 
335 /********************************************************************
336 * *
337 * T Y P E S *
338 * *
339 *********************************************************************/
340 
351 typedef struct xml_msg_hdr_t_ {
352 
354  uint16 flags;
355 
364  dlq_hdr_t prefixQ;
369  dlq_hdr_t errQ;
372  dlq_hdr_t filptr_cleanupQ;
394  dlq_hdr_t error_dataQ;
397  dlq_hdr_t *lookupQ;
400  dlq_hdr_t *matchQ;
403  dlq_hdr_t *selectQ;
409  struct agt_acm_cache_t_ *acm_cache;
410 
416  uint32 msgid;
417 
422 
424  boolean cfgid_valid;
425 
429  void *acm_cbfn;
430 
431  uint32 max_depth;
432  uint32 start_depth;
433  uint32 cur_depth;
436  time_t match_tstamp;
437 
439  ncx_etag_t match_etag;
440 
443 
446 
448  struct tk_chain_t_ *tkc;
449 
452 
455 
458 
461 
464 
467 
471  val_value_t *actionval; /* backptr into rpc_input tree */
472 
474  struct getbulk_cb_t_ *getbulk_cb;
475 
479  struct obj_template_t_ *get2_target;
480 
484  struct getcb_get2_t_ *get2cb;
485 
487  dlq_hdr_t modtagQ;
488 
490  struct ypgnmi_get_cb_t_ *gnmi_getcb;
491 
493  struct ypgnmi_edit_cb_t_ *gnmi_editcb;
494 
498  boolean prune_bad_data;
499 
503  boolean xget_request;
504 
507 
511  struct ncx_filptr_t_ *get2_filptr;
512 
515 
517  dlq_hdr_t aiocbQ;
518 
523  struct obj_template_t_ *anyxml_obj;
524 
531 
535  struct obj_template_t_ *depth_target;
536 
537 } xml_msg_hdr_t;
538 
539 
549 typedef void
551  xml_msg_hdr_t *mhdr,
552  status_t res,
553  val_value_t *errnode,
554  const xmlChar *badval);
555 
556 
557 
570 typedef void
572  xml_msg_hdr_t *mhdr,
573  status_t res,
574  val_value_t *errnode,
575  const xmlChar *badval,
576  const ncx_errinfo_t *errinfo);
577 
578 
579 
590 typedef void
592  xml_msg_hdr_t *mhdr,
593  status_t res,
594  struct obj_template_t_ *errobj,
595  const xmlChar *badval);
596 
597 
606 typedef boolean (*xml_msg_authfn_t) (xml_msg_hdr_t *msg,
607  const xmlChar *username,
608  const val_value_t *val);
609 
610 
629 typedef void
631  xml_msg_hdr_t *mhdr,
632  ncx_layer_t layer,
633  status_t res,
634  const xml_node_t *xmlnode,
635  ncx_node_t parmtyp,
636  const void *error_info,
637  ncx_node_t nodetyp,
638  void *error_path);
639 
640 
661 typedef void
663  xml_msg_hdr_t *msghdr,
664  ncx_layer_t layer,
665  status_t res,
666  const xml_node_t *xmlnode,
667  ncx_node_t parmtyp,
668  const void *error_info,
669  ncx_node_t nodetyp,
670  void *error_path,
671  const ncx_errinfo_t *errinfo);
672 
673 
692 typedef void
694  xml_msg_hdr_t *msghdr,
695  ncx_layer_t layer,
696  status_t res,
697  const xml_attr_t *xmlattr,
698  const xml_node_t *xmlnode,
699  const xmlChar *badns,
700  ncx_node_t nodetyp,
701  void *errnode);
702 
703 
704 /********************************************************************
705 * *
706 * F U N C T I O N S *
707 * *
708 *********************************************************************/
709 
710 
716 extern void
718 
719 
731 extern void
733 
734 
748 extern const xmlChar *
750  xmlns_id_t parent_nsid,
751  xmlns_id_t nsid,
752  val_value_t *curelem,
753  boolean *xneeded);
754 
755 
775 extern const xmlChar *
777  xmlns_id_t nsid);
778 
779 
790 extern const xmlChar *
792  xmlns_id_t nsid);
793 
794 
806 extern status_t
808  xmlns_id_t nsid,
809  xmlChar **retbuff,
810  uint32 buffsize);
811 
812 
831 extern status_t
833  xml_attrs_t *attrs,
834  boolean addncid,
835  boolean addncxid);
836 
837 
847 extern status_t
849  xml_attrs_t *attrs);
850 
851 
866 extern status_t
868  xmlns_id_t nsid,
869  const xmlChar *badns,
870  xml_attrs_t *attrs);
871 
872 
885 extern status_t
887  xml_attrs_t *attrs,
888  boolean addncx);
889 
890 
898 extern status_t
900 
901 
910 extern status_t
912  xml_attrs_t* attrs,
913  xmlns_id_t ncid);
914 
915 
916 
921 extern void xml_msg_init (void);
922 
923 
928 extern void xml_msg_cleanup (void);
929 
930 
937 extern void xml_msg_set_cfgid (xml_msg_hdr_t *msg,
938  ncx_cfg_t cfgid);
939 
940 
949 extern ncx_cfg_t
951  boolean *isvalid);
952 
953 
960 extern uint32
962 
963 
970 extern ncx_withdefaults_t
972 
973 
974 
981 extern void
983  ncx_withdefaults_t withdef);
984 
985 
992 extern uint32
994 
995 
1002 extern void
1004  uint32 max_depth);
1005 
1006 
1013 extern uint32
1015 
1016 
1023 extern void
1025  uint32 start_depth);
1026 
1027 
1034 extern uint32
1036 
1037 
1044 extern void
1046  uint32 cur_depth);
1047 
1048 
1057 extern ncx_display_mode_t
1059  boolean is_output);
1060 
1061 
1071 extern void
1073  boolean is_output,
1074  ncx_display_mode_t encoding);
1075 
1076 
1085 extern ncx_etag_t
1087  boolean *test);
1088 
1089 
1097 extern void
1099  ncx_etag_t etag,
1100  boolean test_sense);
1101 
1102 
1111 extern time_t
1113  boolean *test);
1114 
1115 
1123 extern void
1125  time_t tstamp,
1126  boolean test_sense);
1127 
1128 
1135 extern dlq_hdr_t *
1137 
1138 
1145 extern dlq_hdr_t *
1147 
1148 
1155 extern dlq_hdr_t *
1157 
1158 
1164 extern void
1166 
1167 
1173 extern void
1175 
1176 
1195 extern boolean
1197  const struct obj_template_t_ *obj);
1198 
1199 
1211 extern void
1213  ncx_filptr_t *filptr);
1214 
1215 
1222 extern status_t
1224 
1225 
1229 #ifdef __cplusplus
1230 } /* end extern 'C' */
1231 #endif
1232 
1233 #endif /* _H_xml_msg */
void * val_error_fn
xml_msg_val_error_fn_t val_error_fn
Definition: xml_msg.h:451
ncx_withdefaults_t withdef
with-defaults value
Definition: xml_msg.h:356
Common Encoding Message Header No longer XML specific!! Used by JSON parsing as well!! Allows common ...
Definition: xml_msg.h:351
gather node data into a simple struct.
Definition: xml_util.h:204
void xml_msg_dec_cur_depth(xml_msg_hdr_t *mhdr)
Decrement the cur_depth parameter if needed.
Definition: xml_msg.c:1674
status_t xml_msg_build_prefix_map(xml_msg_hdr_t *msg, xml_attrs_t *attrs, boolean addncid, boolean addncxid)
Build a queue of xmlns_pmap_t records for the current message.
Definition: xml_msg.c:839
dlq_hdr_t * xml_msg_get_matchQ(xml_msg_hdr_t *msg)
Get the GET2 match Queue.
Definition: xml_msg.c:1621
ncx_cfg_t cfgid
the xml_msg_set_cfgid function is used by the retrieval operation (e.g., <get>, <get-config> to set t...
Definition: xml_msg.h:421
void xml_msg_inc_cur_depth(xml_msg_hdr_t *mhdr)
Increment the cur_depth parameter if needed.
Definition: xml_msg.c:1652
void xml_msg_set_withdef(xml_msg_hdr_t *msg, ncx_withdefaults_t withdef)
Set the message withdef enum.
Definition: xml_msg.c:1325
void xml_msg_cleanup(void)
Cleanup this module.
Definition: xml_msg.c:1235
void(* xml_msg_val_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, status_t res, val_value_t *errnode, const xmlChar *badval)
Record an rpc-error for YANG-API/RESTCONF response translation.
Definition: xml_msg.h:550
void xml_msg_init(void)
Init this module.
Definition: xml_msg.c:1225
void xml_msg_set_max_depth(xml_msg_hdr_t *msg, uint32 max_depth)
Set the message max_depth value.
Definition: xml_msg.c:1359
uint32 xml_msg_get_msgid(xml_msg_hdr_t *msg)
Get the message sequence ID in the message.
Definition: xml_msg.c:1294
void * record_attr_error
xml_msg_record_attr_error_fn_t record_attr_error
Definition: xml_msg.h:466
void xml_msg_set_cur_depth(xml_msg_hdr_t *msg, uint32 cur_depth)
Set the message cur_depth value.
Definition: xml_msg.c:1427
const xmlChar * xml_msg_get_prefix_xpath(xml_msg_hdr_t *msg, xmlns_id_t nsid)
Get the module prefix for XPath.
Definition: xml_msg.c:641
void(* xml_msg_obj_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, status_t res, struct obj_template_t_ *errobj, const xmlChar *badval)
Record an rpc-error for YANG-API/RESTCONF response translation.
Definition: xml_msg.h:591
boolean xget_request
flag set if <get> request is for XPath filtering.
Definition: xml_msg.h:503
uint32 xml_msg_get_start_depth(xml_msg_hdr_t *msg)
Get the message start_depth value.
Definition: xml_msg.c:1377
ncx_display_mode_t xml_msg_get_encoding(xml_msg_hdr_t *msg, boolean is_output)
Get the message encoding value.
Definition: xml_msg.c:1456
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
struct agt_acm_cache_t_ * acm_cache
server access control for database reads and writes; !!! shadow pointer to per-session cache...
Definition: xml_msg.h:409
struct getbulk_cb_t_ * getbulk_cb
getbulk control block to save parameters and state for <getbulk>
Definition: xml_msg.h:474
struct tk_chain_t_ * tkc
used for RESTCONF JSON parsing
Definition: xml_msg.h:448
boolean all_in_one_mode
TRUE if this is All in One mode.
Definition: xml_msg.h:506
time_t match_tstamp
match timestamp used for RESTCONF conditionals
Definition: xml_msg.h:436
void * record_error
xml_msg_record_error_fn_t record_error
Definition: xml_msg.h:460
dlq_hdr_t * xml_msg_get_selectQ(xml_msg_hdr_t *msg)
Get the GET2 select Queue.
Definition: xml_msg.c:1636
Value Node Basic Support.
void xml_msg_set_start_depth(xml_msg_hdr_t *msg, uint32 start_depth)
Set the message start_depth value.
Definition: xml_msg.c:1393
status_t xml_msg_add_ncid_to_prefix_map(xml_msg_hdr_t *msg, xml_attrs_t *attrs, xmlns_id_t ncid)
Add an ncid or ncxid to a prefix map.
Definition: xml_msg.c:1182
void * obj_error_fn
xml_msg_obj_error_fn_t obj_error_fn
Definition: xml_msg.h:457
uint32 start_depth
for nested GET2, 0=ignore
Definition: xml_msg.h:432
void xml_msg_set_encoding(xml_msg_hdr_t *msg, boolean is_output, ncx_display_mode_t encoding)
Set the message encoding value.
Definition: xml_msg.c:1481
represents one attribute
Definition: xml_util.h:156
YANG module data structures Many internal representations of YANG module constructs.
struct ncx_filptr_t_ * get2_filptr
The last GET2 Filter Pointer; may be used in case there are some All in One nodes still left...
Definition: xml_msg.h:511
void * record_error_errinfo
xml_msg_record_error_errinfo_fn_t record_error_errinfo
Definition: xml_msg.h:463
status_t xml_msg_clean_defns_attr(xml_attrs_t *attrs)
Get rid of an xmlns=foo default attribute.
Definition: xml_msg.c:1133
ncx_etag_t match_etag
match ETag used for RESTCONF conditionals
Definition: xml_msg.h:439
uint32 msgid
incremented on every initialized message header rolls over at MAX_UINT32 back to zero used by agt_acm...
Definition: xml_msg.h:416
XML Utilities.
void xml_msg_save_filptr(xml_msg_hdr_t *msg, ncx_filptr_t *filptr)
Store current message subtree filter in the Queue for later cleanup.
Definition: xml_msg.c:1799
boolean(* xml_msg_authfn_t)(xml_msg_hdr_t *msg, const xmlChar *username, const val_value_t *val)
read authorization callback template
Definition: xml_msg.h:606
const xmlChar * xml_msg_get_prefix_start_tag(xml_msg_hdr_t *msg, xmlns_id_t nsid)
Find the namespace prefix for the specified namespace ID.
Definition: xml_msg.c:700
uint16 flags
internal message flags
Definition: xml_msg.h:354
void xml_msg_set_etag(xml_msg_hdr_t *msg, ncx_etag_t etag, boolean test_sense)
Set the etag match parameters.
Definition: xml_msg.c:1529
struct ypgnmi_edit_cb_t_ * gnmi_editcb
gnmi control block to save parameters and state for gnmi <get>
Definition: xml_msg.h:493
one value to match one type
Definition: val.h:870
struct for holding r/o pointer to generic internal node for filtering purposes
Definition: ncxtypes.h:984
void(* xml_msg_record_attr_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_attr_t *xmlattr, const xml_node_t *xmlnode, const xmlChar *badns, ncx_node_t nodetyp, void *errnode)
Generate an rpc_err_rec_t and save it in the msg.
Definition: xml_msg.h:693
status_t xml_msg_check_xmlns_attr(xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *badns, xml_attrs_t *attrs)
Check the default NS and the prefix map in the msg;.
Definition: xml_msg.c:954
status_t xml_msg_set_with_origin(xml_msg_hdr_t *mhdr)
Set the with-origin parameter to true.
Definition: xml_msg.c:1819
uint32 max_depth
max-depth value, 0=ignore
Definition: xml_msg.h:431
Session Control Block.
Definition: ses.h:542
boolean prune_bad_data
flag set if parsing a config file prune bad data for startup-error=continue
Definition: xml_msg.h:498
ncx_display_mode_t
enumeration of val_dump_value display modes
Definition: ncxtypes.h:599
status_t
global error return code
Definition: status_enum.h:186
boolean cfgid_valid
flag needed since ncx_cfg_t uses value zero for running config
Definition: xml_msg.h:424
status_t xml_msg_finish_prefix_map(xml_msg_hdr_t *msg, xml_attrs_t *attrs)
Finish the queue of xmlns_pmap_t records for the current message.
Definition: xml_msg.c:884
struct ypgnmi_get_cb_t_ * gnmi_getcb
gnmi control block to save parameters and state for gnmi <get>
Definition: xml_msg.h:490
ncx_display_mode_t output_encoding
RESTCONF output encoding.
Definition: xml_msg.h:445
ncx_layer_t
Enumeration of NETCONF protocol layers.
Definition: ncxtypes.h:494
uint32 xml_msg_get_cur_depth(xml_msg_hdr_t *msg)
Get the message cur_depth value.
Definition: xml_msg.c:1411
uint32 xml_msg_get_max_depth(xml_msg_hdr_t *msg)
Get the message max_depth value.
Definition: xml_msg.c:1343
dlq_hdr_t * xml_msg_get_lookupQ(xml_msg_hdr_t *msg)
Get the GET2 lookup Queue.
Definition: xml_msg.c:1606
Global error messages for status code enumerations.
struct obj_template_t_ * anyxml_obj
object pointer used by server to track real object properties for certain anyxml or anydata nodes suc...
Definition: xml_msg.h:523
val_value_t * edit_config_root
if this is an edit request then the <config> root needs to be saved in the message header to allow NA...
Definition: xml_msg.h:530
void xml_msg_set_tstamp(xml_msg_hdr_t *msg, time_t tstamp, boolean test_sense)
Set the timestamp match parameters.
Definition: xml_msg.c:1581
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1252
struct obj_template_t_ * get2_target
GET2 nested target needs to be saved so callback code can filter out nodes that are not being request...
Definition: xml_msg.h:479
status_t xml_msg_gen_new_prefix(xml_msg_hdr_t *msg, xmlns_id_t nsid, xmlChar **retbuff, uint32 buffsize)
Generate a new namespace prefix.
Definition: xml_msg.c:743
ncx_cfg_t xml_msg_get_cfgid(xml_msg_hdr_t *msg, boolean *isvalid)
Set the config ID in the message.
Definition: xml_msg.c:1269
const xmlChar * xml_msg_get_prefix(xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, val_value_t *curelem, boolean *xneeded)
Find the namespace prefix for the specified namespace ID If it is not there then create one...
Definition: xml_msg.c:525
ncx_node_t
NCX Internal Node Types.
Definition: ncxtypes.h:424
ncx_display_mode_t input_encoding
RESTCONF input encoding.
Definition: xml_msg.h:442
uint32 cur_depth
current depth value
Definition: xml_msg.h:433
void(* xml_msg_val_errinfo_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, status_t res, val_value_t *errnode, const xmlChar *badval, const ncx_errinfo_t *errinfo)
Record an rpc-error for YANG-API/RESTCONF response translation Add errinfo struct if present...
Definition: xml_msg.h:571
internal NMDA get-data state parameters; rest of parameter are stored directly in the xml_msg_hdr_t u...
Definition: ncxtypes.h:1524
ncx_etag_t xml_msg_get_etag(xml_msg_hdr_t *msg, boolean *test)
Get the message etag match value and test sense.
Definition: xml_msg.c:1507
time_t xml_msg_get_tstamp(xml_msg_hdr_t *msg, boolean *test)
Get the message timestamp match value and test sense.
Definition: xml_msg.c:1559
struct obj_template_t_ * depth_target
GET2 nested depth target needs to be saved so xml_msg_test_max_depth can produce a correct response a...
Definition: xml_msg.h:535
struct getcb_get2_t_ * get2cb
GET2 control block needed in NACM data rule processing set and cleared for each ACM check needed; bac...
Definition: xml_msg.h:484
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:535
XML namespace support.
val_value_t * actionval
support for the YANG 1.1 <action> data tree that is used to derive keys during invocation of the call...
Definition: xml_msg.h:471
void(* xml_msg_record_error_errinfo_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
Generate an rpc_err_rec_t and save it in the msg Use the provided error info record for <rpc-error> f...
Definition: xml_msg.h:662
ncx_withdefaults_t
enum for with-defaults enum values
Definition: ncxtypes.h:1164
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
ncx_withdefaults_t xml_msg_get_withdef(xml_msg_hdr_t *msg)
Get the message withdef enum.
Definition: xml_msg.c:1309
void(* xml_msg_record_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: xml_msg.h:630
boolean xml_msg_test_max_depth(xml_msg_hdr_t *mhdr, const struct obj_template_t_ *obj)
Test the max_depth parameter if needed.
Definition: xml_msg.c:1711
void xml_msg_init_hdr(xml_msg_hdr_t *msg)
Initialize a new xml_msg_hdr_t struct.
Definition: xml_msg.c:393
void xml_msg_set_cfgid(xml_msg_hdr_t *msg, ncx_cfg_t cfgid)
Set the config ID in the message.
Definition: xml_msg.c:1248
void * val_errinfo_fn
xml_msg_val_error_errinfo_fn_t val_error_fn
Definition: xml_msg.h:454
dlq_hdr_t xml_attrs_t
queue of xml_attr_t
Definition: xml_util.h:152
void * acm_cbfn
agent access control read authorization callback function: xml_msg_authfn_t
Definition: xml_msg.h:429
status_t xml_msg_gen_xmlns_attrs(xml_msg_hdr_t *msg, xml_attrs_t *attrs, boolean addncx)
Generate any xmlns directives in the top-level attribute Q.
Definition: xml_msg.c:1034
ncx_nmda_params_t * nmda_params
NMDA suport for get-data.
Definition: xml_msg.h:514