yumapro  20.10-12
YumaPro SDK
agt_yangapi_reply.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #if defined(WITH_YANGAPI) || defined(WITH_RESTCONF) || defined(WITH_YCONTROL)
12 #ifndef _H_agt_yangapi_reply
13 #define _H_agt_yangapi_reply
14 /* FILE: agt_yangapi_reply.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
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 17-mar-13 abb Begun.
36 */
37 
38 #ifndef _H_rpc
39 #include "rpc.h"
40 #endif
41 
42 #ifndef _H_ses
43 #include "ses.h"
44 #endif
45 
46 #ifndef _H_status
47 #include "status.h"
48 #endif
49 
50 #ifndef _H_yangapi
51 #include "yangapi.h"
52 #endif
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
59 
60 /********************************************************************
61 * *
62 * T Y P E S *
63 * *
64 *********************************************************************/
65 
66 
67 /********************************************************************
68 * *
69 * F U N C T I O N S *
70 * *
71 *********************************************************************/
72 
97 extern status_t
98  agt_yangapi_reply_send (ses_cb_t *scb,
99  yangapi_cb_t *rcb,
100  rpc_msg_t *msg,
101  status_t res,
102  boolean is_events);
103 
104 
117 extern status_t
118  agt_yangapi_yangpatch_reply_send (ses_cb_t *scb,
119  yangapi_cb_t *rcb,
120  rpc_msg_t *msg,
121  status_t res);
122 
123 
137 extern void
138  agt_yangapi_reply_output_last_keys (ses_cb_t *scb,
139  yangapi_cb_t *rcb,
140  rpc_msg_t *msg,
141  val_value_t *valnode,
142  int32 indent);
143 
144 
158 extern status_t
159  agt_yangapi_getbulk_reply_send (ses_cb_t *scb,
160  yangapi_cb_t *rcb,
161  rpc_msg_t *msg,
162  status_t res);
163 
164 
165 
169 #ifdef __cplusplus
170 } /* end extern 'C' */
171 #endif
172 
173 #endif /* _H_agt_yangapi_reply */
174 #endif // WITH_YANGAPI || WITH_YCONTROL || WITH_RESTCONF
ses_set_SSE_encoding
void ses_set_SSE_encoding(ses_cb_t *scb)
Set the output encoding to have a Server Sent Events filter Used for notification delivery over RESTC...
Definition: ses.c:4103
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
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
xml_wr_max_check_val_force
void xml_wr_max_check_val_force(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns, xmlns_id_t force_nsid, const xmlChar *force_name)
Generate entire val_value_t *w/filter)
Definition: xml_wr.c:3468
ncx_free_filptr
void ncx_free_filptr(ncx_filptr_t *filptr)
Free a new ncx_filptr_t struct or add to the cache if room.
Definition: ncx.c:6271
agt_cap.h
NETCONF Server capabilities handler.
xml_msg_set_cur_depth
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
cfg.h
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
ses_finish_msg
void ses_finish_msg(ses_cb_t *scb)
Finish an outbound message on the specified session.
Definition: ses.c:3013
json_wr_check_child_obj
void json_wr_check_child_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn, boolean isfirst, boolean isfirstchild)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2886
YANGAPI_LAUNCHPT_YANG_PLAIN
@ YANGAPI_LAUNCHPT_YANG_PLAIN
RESTCONF 'schema' resource class.
Definition: yangapi.h:158
agt_ses.h
Server Session Management.
agt_util.h
Utility Functions for NCX Server method routines.
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
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
obj_find_defval
boolean obj_find_defval(obj_template_t *obj, const xmlChar *find_defval)
Find a default.
Definition: obj.c:17547
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
YANGAPI_LAUNCHPT_MODULE
@ YANGAPI_LAUNCHPT_MODULE
modules/module launch point
Definition: yangapi.h:146
obj_has_ro_descendants
boolean obj_has_ro_descendants(obj_template_t *obj)
Check if there are any accessible read-only descendant nodes within the object.
Definition: obj.c:14876
agt_output_end_container
void agt_output_end_container(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent)
Output an end container node.
Definition: agt_util.c:5408
YANGAPI_LAUNCHPT_DATA
@ YANGAPI_LAUNCHPT_DATA
/restconf/data/foo launch point
Definition: yangapi.h:137
VAL_XPATHPCB
#define VAL_XPATHPCB(V)
Access the Xpath parser control block.
Definition: val.h:651
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
agt_yangapi_reply_output_last_keys
void agt_yangapi_reply_output_last_keys(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, val_value_t *valnode, int32 indent)
Output the last-keys for <get-bulk>
Definition: agt_yangapi_reply.c:3051
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
NCX_WITHDEF_TRIM
@ NCX_WITHDEF_TRIM
trim
Definition: ncxtypes.h:1014
val.h
Value Node Basic Support.
NCX_WITHDEF_NONE
@ NCX_WITHDEF_NONE
not set
Definition: ncxtypes.h:1011
xml_util.h
XML Utilities.
agt_tree.h
Server subtree filter processing for <filter> element in <get> and <get-config> operations.
json_wr_simval_line
void json_wr_simval_line(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *namestr, const xmlChar *valstr, ncx_btype_t btyp, int32 startindent, boolean isfirst)
generate 1 line for a simple value within a container or array
Definition: json_wr.c:1861
getbulk_create_last_keys
status_t getbulk_create_last_keys(getbulk_cb_t *bulk, val_value_t *lastval)
Create the <last-keys> container and clone the keys from the lastval.
Definition: getbulk.c:217
agt_yangapi_getbulk_reply_send
status_t agt_yangapi_getbulk_reply_send(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, status_t res)
Output a RESTCONF <get-bulk> reply.
Definition: agt_yangapi_reply.c:3101
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
tstamp_time2htmltime
status_t tstamp_time2htmltime(time_t *timerec, xmlChar *buff, size_t buffsize)
Convert the specified time_t to a HTML timestamp string.
Definition: tstamp.c:488
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
RESTCONF_CONTENT_ALL
@ RESTCONF_CONTENT_ALL
all descendant data nodes
Definition: yangapi.h:217
YANGAPI_LAUNCHPT_OPERATION
@ YANGAPI_LAUNCHPT_OPERATION
/restconf/operations/some-operation launch point
Definition: yangapi.h:152
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.
xml_wr.h
XML Write functions.
ncx_num.h
NCX Module Library Number Utility Functions.
YANGAPI_LAUNCHPT_YANGLIB_VERSION
@ YANGAPI_LAUNCHPT_YANGLIB_VERSION
/restconf/yang-library-version launch point
Definition: yangapi.h:173
val_child_find_same
val_value_t * val_child_find_same(const val_value_t *child, const val_value_t *parent, val_child_op_t child_op)
Find the child header for the specified child, which is a different root; e.g., trying to match candi...
Definition: val_child.c:1888
xml_wr_check_child_obj
void xml_wr_check_child_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn)
Generate entire val_value_t *w/filter) for GET2.
Definition: xml_wr.c:4130
agt_restcmn_record_error
void agt_restcmn_record_error(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: agt_restcmn.c:7326
VAL_CHILD_OP_NEXT
@ VAL_CHILD_OP_NEXT
get-next
Definition: val_child.h:83
SES_YPMODE_RESTCONF
@ SES_YPMODE_RESTCONF
RESTCONF mode.
Definition: ses.h:312
agt_xml.h
NETCONF Server XML Reader interface.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
NCX_PROTO_YUMA_YANGAPI
@ NCX_PROTO_YUMA_YANGAPI
YumaPro YANG-API 1.0.
Definition: ncxtypes.h:785
xml_msg_get_withdef
ncx_withdefaults_t xml_msg_get_withdef(xml_msg_hdr_t *msg)
Get the message withdef enum.
Definition: xml_msg.c:1309
agt_yangapi.h
Yuma REST API Message Handler.
YANGAPI_LAUNCHPT_NONE
@ YANGAPI_LAUNCHPT_NONE
not set
Definition: yangapi.h:128
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
agt_restcmn_get_config_parm
boolean agt_restcmn_get_config_parm(yangapi_cb_t *rcb, val_value_t *context_node)
Get the value of the config parm to use.
Definition: agt_restcmn.c:7100
xml_clean_attrs
void xml_clean_attrs(xml_attrs_t *attrs)
clean an xml_attrs_t variable
Definition: xml_util.c:1243
ses_putchar
void ses_putchar(ses_cb_t *scb, uint32 ch)
Write one char to the session, without any translation.
Definition: ses.c:2353
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
agt_output_start_errors_container
void agt_output_start_errors_container(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
Output a start <errors> element on the specified session for RESTCONF error handling.
Definition: agt_util.c:5356
NCX_WITHDEF_REPORT_ALL
@ NCX_WITHDEF_REPORT_ALL
report-all
Definition: ncxtypes.h:1012
xmlns_get_module
const xmlChar * xmlns_get_module(xmlns_id_t nsid)
get the module name of the namespace ID
Definition: xmlns.c:1126
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
AGT_RPC_PH_REPLY
@ AGT_RPC_PH_REPLY
(4) NO CB FOR THIS STATE
Definition: agt_rpc.h:127
agt_val.h
NETCONF Server database callback handler.
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
xml_msg_gen_xmlns_attrs
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
json_wr_output_null
void json_wr_output_null(ses_cb_t *scb, int32 startindent)
generate a null value; needed for printing empty <data> element which is done as a wrapper,...
Definition: json_wr.c:2856
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
xpath.h
Schema and data model Xpath search support.
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
xml_val.h
Utility functions for creating value structs.
ERR_NCX_PRECONDITION_FAILED
@ ERR_NCX_PRECONDITION_FAILED
392
Definition: status_enum.h:435
YANGAPI_LAUNCHPT_OPERATIONS
@ YANGAPI_LAUNCHPT_OPERATIONS
/restconf/operations launch point
Definition: yangapi.h:149
xml_init_attrs
void xml_init_attrs(xml_attrs_t *attrs)
initialize an xml_attrs_t variable
Definition: xml_util.c:745
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
agt_ncx.h
NETCONF Server standard method routines.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
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
NCX_WITHDEF_REPORT_ALL_TAGGED
@ NCX_WITHDEF_REPORT_ALL_TAGGED
report-all-tagged
Definition: ncxtypes.h:1013
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
val_is_config_data
boolean val_is_config_data(const val_value_t *val)
Check if the specified value is a config DB object instance.
Definition: val.c:11157
TSTAMP_HTML_SIZE
#define TSTAMP_HTML_SIZE
minimum buffer size for HTML format string
Definition: tstamp.h:76
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
xmlns_find_ns_by_module
xmlns_id_t xmlns_find_ns_by_module(const xmlChar *modname)
Find the NS ID from its module name that registered it.
Definition: xmlns.c:712
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
agt_output_start_node
void agt_output_start_node(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent, boolean try_modname)
Output a start node and try to use modname infront if needed.
Definition: agt_util.c:5297
val_util.h
Value Node Utilities.
json_wr.h
JSON Write functions.
xml_wr_max_check_val
void xml_wr_max_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent, val_nodetest_fn_t testfn, boolean force_xmlns)
Generate entire val_value_t *w/filter)
Definition: xml_wr.c:3423
YANGAPI_LAUNCHPT_NEW_DATA
@ YANGAPI_LAUNCHPT_NEW_DATA
/restconf/data/foo/new-bar launch point
Definition: yangapi.h:140
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
SES_OUT_BYTES
#define SES_OUT_BYTES(S)
get session out bytes
Definition: ses.h:120
YANGAPI_LAUNCHPT_TOP
@ YANGAPI_LAUNCHPT_TOP
/restconf launch point
Definition: yangapi.h:131
rpc.h
NETCONF protocol remote procedure call common definitions.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
NCX_DISPLAY_MODE_XML_NONS
@ NCX_DISPLAY_MODE_XML_NONS
XML display mode without any prefixes (not compliant XML!)
Definition: ncxtypes.h:463
agt_rpc_send_rpc_error
status_t agt_rpc_send_rpc_error(ses_cb_t *scb, xml_msg_hdr_t *msg, const rpc_err_rec_t *err, int32 indent, boolean isfirst, boolean islast)
Send one <rpc-error> element on the specified session.
Definition: agt_rpc.c:3747
XML_MSG_SET_WITH_GET2
#define XML_MSG_SET_WITH_GET2(M)
Set flag that GET2 mode requested.
Definition: xml_msg.h:231
val_child.h
Value Node Child Access Support.
xml_wr_end_elem
void xml_wr_end_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an end tag to the specified session.
Definition: xml_wr.c:3114
agt_check_config
boolean agt_check_config(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
Used by the <get-config> operation to return any type of configuration data.
Definition: agt_util.c:2542
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
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.
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
yangconst.h
Contains YANG constants separated to prevent H file include loops.
xml_msg_build_prefix_map
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_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
ses_withdef
ncx_withdefaults_t ses_withdef(const ses_cb_t *scb)
Get the with-defaults value for this session.
Definition: ses.c:3461
agt_restcmn_method_is_read
boolean agt_restcmn_method_is_read(yangapi_method_t method)
Check if this is a read method.
Definition: agt_restcmn.c:6332
json_wr_end_array
void json_wr_end_array(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON array
Definition: json_wr.c:1829
YANGAPI_LAUNCHPT_YANG
@ YANGAPI_LAUNCHPT_YANG
YANG launch point.
Definition: yangapi.h:155
agt_yangapi_reply.h
RESTCONF Reply Handler.
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
agt_restcmn.h
Common function for RESTCONF and YANG-API protocols.
xml_msg_get_max_depth
uint32 xml_msg_get_max_depth(xml_msg_hdr_t *msg)
Get the message max_depth value.
Definition: xml_msg.c:1343
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
json_wr_start_array
void json_wr_start_array(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate start of a JSON array
Definition: json_wr.c:1668
agt_tree_output_filter
void agt_tree_output_filter(ses_cb_t *scb, rpc_msg_t *msg, ncx_filptr_t *top, int32 indent, boolean getop)
get and get-config step 2.
Definition: agt_tree.c:3139
xml_wr_begin_elem_ex
void xml_wr_begin_elem_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
Write a start or empty XML tag to the specified session.
Definition: xml_wr.c:3001
xpath_yang.h
YANG-specific Xpath support.
agt_check_default
boolean agt_check_default(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
Used by the <get*> operation to return only values not set to the default.
Definition: agt_util.c:2601
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
xml_msg.h
XML and JSON Message send and receive support.
agt_tree_prune_filter2
ncx_filptr_t * agt_tree_prune_filter2(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *root, obj_template_t *root_obj, val_value_t *filter, boolean getop, boolean *do_all)
get and get-config step 1.
Definition: agt_tree.c:3021
XML_MSG_DEPTH_TARGET
#define XML_MSG_DEPTH_TARGET(M)
GET2 depth target for the level 1 node.
Definition: xml_msg.h:326
xml_wr_string_elem
void xml_wr_string_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *str, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent)
Write a start tag, simple string content, and an end tag to the specified session.
Definition: xml_wr.c:3235
xpath_get_next_resnode
xpath_resnode_t * xpath_get_next_resnode(xpath_resnode_t *resnode)
Get the next result in the renodeQ from a result struct.
Definition: xpath.c:3959
xml_val_new_struct
val_value_t * xml_val_new_struct(const xmlChar *name, xmlns_id_t nsid)
Set up a new generic struct.
Definition: xml_val.c:323
agt_rpcerr_get_http_status_string
const xmlChar * agt_rpcerr_get_http_status_string(uint32 status)
Translate the HTTP status code to an HTTP status line.
Definition: agt_rpcerr.c:2323
agt_val_parse.h
XML Parameter Value Parser Module.
ses_indent
void ses_indent(ses_cb_t *scb, int32 indent)
Write the proper newline + indentation to the specified session.
Definition: ses.c:2768
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
xpath1_res_flatten_result
status_t xpath1_res_flatten_result(xpath_pcb_t *pcb, xpath_result_t *result)
Convert any vahdr resnodes to valptr resnodes for simplified processing.
Definition: xpath1_res.c:928
NCX_DISPLAY_MODE_PLAIN
@ NCX_DISPLAY_MODE_PLAIN
plain CLI display mode
Definition: ncxtypes.h:451
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
val_set_by_default
boolean val_set_by_default(const val_value_t *val)
Check if the value was set by val_add_defaults.
Definition: val.c:12571
RESTCONF_CONTENT_CONFIG
@ RESTCONF_CONTENT_CONFIG
return only configuration data nodes
Definition: yangapi.h:215
log.h
NCX System Logging Manager.
agt_yangapi_reply_send
status_t agt_yangapi_reply_send(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, status_t res, boolean is_events)
Send a RESTCONF reply.
Definition: agt_yangapi_reply.c:2645
YANGAPI_METHOD_POST
@ YANGAPI_METHOD_POST
POST method.
Definition: yangapi.h:120
agt_rpcerr_get_http_status_code
uint32 agt_rpcerr_get_http_status_code(status_t res)
Translate the rpc_err_t to an HTTP code.
Definition: agt_rpcerr.c:2211
agt_yangapi_yangpatch_reply_send
status_t agt_yangapi_yangpatch_reply_send(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, status_t res)
Send a YANG Patch reply.
Definition: agt_yangapi_reply.c:2940
agt_sys.h
NETCONF system.yang DM module support.
xmlns_nc_id
xmlns_id_t xmlns_nc_id(void)
Get the ID for the NETCONF namespace or 0 if it doesn't exist.
Definition: xmlns.c:880
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
xml_wr_empty_elem
void xml_wr_empty_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an empty XML tag to the specified session without attributes.
Definition: xml_wr.c:3076
agt_restcmn_get_nsid
xmlns_id_t agt_restcmn_get_nsid(ncx_protocol_t proto)
Get the XML namespace ID for specific proto.
Definition: agt_restcmn.c:6853
xpath_clone_pcb
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
agt_rpc_data_cb_t
status_t(* agt_rpc_data_cb_t)(ses_cb_t *scb, rpc_msg_t *msg, uint32 indent)
Callback template for RPCs that use an inline callback function instead of generating a malloced val_...
Definition: agt_rpc.h:178
rpc_err.h
NETCONF protocol standard error definitions.
agt_cfg.h
Manage Server configuration edit transactions.
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_acm.h
NETCONF Server Access Control Entry Points.
json_wr_start_object
void json_wr_start_object(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, int32 startindent)
generate start of a JSON object
Definition: json_wr.c:1427
RESTCONF_CONTENT_NONCONFIG
@ RESTCONF_CONTENT_NONCONFIG
only non-configuration data nodes
Definition: yangapi.h:216
YANGAPI_LAUNCHPT_DATASTORE
@ YANGAPI_LAUNCHPT_DATASTORE
/restconf/data launch point
Definition: yangapi.h:134
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
YANGAPI_METHOD_HEAD
@ YANGAPI_METHOD_HEAD
HEAD method.
Definition: yangapi.h:118
RPC_DATA_STD
@ RPC_DATA_STD
STD is used by <get> and <get-config> to force a <data> container in the NETCONF namespace.
Definition: rpc.h:162
cap.h
NETCONF protocol capabilities.
ses_get_out_encoding
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4126
xml_msg_clean_defns_attr
status_t xml_msg_clean_defns_attr(xml_attrs_t *attrs)
Get rid of an xmlns=foo default attribute.
Definition: xml_msg.c:1133
agt_rpc_reorder_dataQ
void agt_rpc_reorder_dataQ(rpc_msg_t *msg)
Reorder the dataQ.
Definition: agt_rpc.c:4768
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
agt_check_config_false
boolean agt_check_config_false(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
Used by the <get*> operation to return only config=false nodes and the ID ancestor nodes.
Definition: agt_util.c:2663
obj_get_default
const xmlChar * obj_get_default(const obj_template_t *obj)
Get the default value for the specified object.
Definition: obj.c:11570
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
YANGAPI_METHOD_PATCH
@ YANGAPI_METHOD_PATCH
PATCH method.
Definition: yangapi.h:122
agt_rpcerr.h
NETCONF protocol <rpc-error> server-side handler.
xml_attrs_t
dlq_hdr_t xml_attrs_t
queue of xml_attr_t
Definition: xml_util.h:151
obj.h
Data Object Support.
ses_start_msg
status_t ses_start_msg(ses_cb_t *scb)
Start a new outbound message on the specified session.
Definition: ses.c:2970
XML_MSG_SET_LOOKUPQ
#define XML_MSG_SET_LOOKUPQ(M, Q)
Set GET2 lookup entry.
Definition: xml_msg.h:237
ses_set_out_encoding
void ses_set_out_encoding(ses_cb_t *scb, ncx_display_mode_t encoding)
Set the output encoding.
Definition: ses.c:4084
xpath1_res.h
XPath 1.0 expression support; result support.
json_wr_end_object
void json_wr_end_object(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON object
Definition: json_wr.c:1642
xml_msg_set_withdef
void xml_msg_set_withdef(xml_msg_hdr_t *msg, ncx_withdefaults_t withdef)
Set the message withdef enum.
Definition: xml_msg.c:1325
val_sprintf_etag
status_t val_sprintf_etag(val_value_t *val, xmlChar *buff, int32 buffsize)
Write the Entity Tag for the value to the specified buffer.
Definition: val.c:13472
agt_output_start_container
void agt_output_start_container(ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent)
Output a start container node.
Definition: agt_util.c:5243
XML_MSG_GET2_TARGET
#define XML_MSG_GET2_TARGET(M)
GET2 request target terminal node.
Definition: xml_msg.h:270
agt_check_config_false_default
boolean agt_check_config_false_default(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
Used by the <get> operation to return only content=nonconfig nodes and the ID ancestor node and only ...
Definition: agt_util.c:2722
val_child_next_same
val_value_t * val_child_next_same(val_value_t *curnode)
Get the next node of the same type.
Definition: val_child.c:2359
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
YANGAPI_LAUNCHPT_VERSION
@ YANGAPI_LAUNCHPT_VERSION
version launch point
Definition: yangapi.h:161
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
ses_putstr
void ses_putstr(ses_cb_t *scb, const xmlChar *str)
Write a zero-terminated string to the session.
Definition: ses.c:2460
json_wr_full_check_val_force
status_t json_wr_full_check_val_force(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, xmlns_id_t force_nsid, const xmlChar *force_name)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2667
YANGAPI_METHOD_OPTIONS
@ YANGAPI_METHOD_OPTIONS
OPTIONS method.
Definition: yangapi.h:117
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
NCX_DISPLAY_MODE_JSON
@ NCX_DISPLAY_MODE_JSON
JSON (RFC 7951 format)
Definition: ncxtypes.h:466
xmlns.h
XML namespace support.
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
status.h
Global error messages for status code enumerations.
NCX_WITHDEF_EXPLICIT
@ NCX_WITHDEF_EXPLICIT
explicit
Definition: ncxtypes.h:1015
yangapi.h
YANG-API definitions (pre-RESTCONF)
YANGAPI_METHOD_PUT
@ YANGAPI_METHOD_PUT
PUT method.
Definition: yangapi.h:121
NCX_DISPLAY_MODE_XML
@ NCX_DISPLAY_MODE_XML
XML display mode.
Definition: ncxtypes.h:460
XML_MSG_SET_SELECTQ
#define XML_MSG_SET_SELECTQ(M, Q)
Set GET2 selectQ entry.
Definition: xml_msg.h:243
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:
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
getbulk.h
yumaworks-getbulk.yang data structure support
json_wr_start_object_ex
void json_wr_start_object_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, int32 startindent, boolean startbrace, boolean endbrace)
generate start of a JSON object (extended version)
Definition: json_wr.c:1478
YANGAPI_METHOD_DELETE
@ YANGAPI_METHOD_DELETE
DELETE method.
Definition: yangapi.h:123
xml_msg_set_max_depth
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
YANGAPI_LAUNCHPT_MODULES
@ YANGAPI_LAUNCHPT_MODULES
modules launch point
Definition: yangapi.h:143