yumapro  20.10-12
YumaPro SDK
agt_restconf.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_restconf
13 #define _H_agt_restconf
14 /* FILE: agt_restconf.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 18-nov-13 abb Begun; split fromagt_yangapi.h
36 
37 
38 */
39 
40 #ifndef _H_status_enum
41 #include "status_enum.h"
42 #endif
43 
44 #ifndef _H_status
45 #include "status.h"
46 #endif
47 
48 #ifndef _H_agt_restcmn
49 #include "agt_restcmn.h"
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 
57 /********************************************************************
58 * *
59 * C O N S T A N T S *
60 * *
61 *********************************************************************/
62 
63 /********************************************************************
64 * *
65 * T Y P E S *
66 * *
67 *********************************************************************/
68 
69 /********************************************************************
70 * *
71 * F U N C T I O N S *
72 * *
73 *********************************************************************/
74 
75 
76 
99 extern status_t
100  agt_restconf_setup_fields_nodes (ses_cb_t *scb,
101  yangapi_cb_t *rcb,
102  rpc_msg_t *msg,
103  boolean *errdone);
104 
105 
117 extern status_t
119  yangapi_cb_t *rcb,
120  rpc_msg_t *msg);
121 
122 
128 extern status_t
129  agt_restconf_init (void);
130 
131 
137 extern void
138  agt_restconf_cleanup (void);
139 
140 
148 extern boolean
149  agt_restconf_dispatch (ses_cb_t *scb);
150 
151 
162 extern boolean
163  agt_restconf_dispatch_ex (ses_cb_t *scb,
164  boolean scb_is_static);
165 
166 
167 #if defined(WITH_GNMI) && defined(WITH_RESTCONF) && defined(WITH_YCONTROL)
168 
182 extern boolean
183  agt_restconf_dispatch_gnmi_get (ses_cb_t *scb);
184 #endif // WITH_GNMI
185 
186 
192 extern agt_restconf_data_t *
194 
195 
201 extern val_value_t *
202  agt_restconf_get_root (void);
203 
204 
205 #ifdef STATIC_LINK
206 #ifdef WITH_RESTCONF
207 
214 extern status_t
216 
217 
225 extern status_t
227 
228 
236 extern void
238 
239 #endif // WITH_RESTCONF
240 #endif // STATIC_LINK
241 
242 
247 #ifdef __cplusplus
248 } /* end extern 'C' */
249 #endif
250 
251 #endif /* _H_agt_restconf */
252 #endif // WITH_RESTCONF || WITH_YANGPAI || WITH_YCONTROL
NCX_AGT_TARG_RUNNING
@ NCX_AGT_TARG_RUNNING
target=running
Definition: ncxtypes.h:355
cfg_rwlock_acquire_single_rdlock
status_t cfg_rwlock_acquire_single_rdlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Acquire a single RWLOCK for read access.
Definition: cfg.c:957
ses.h
NETCONF Session Common definitions module.
ERR_NCX_UNEXPECTED_INPUT
@ ERR_NCX_UNEXPECTED_INPUT
389
Definition: status_enum.h:432
NCX_MATCH_EXACT
@ NCX_MATCH_EXACT
exact (default)
Definition: ncxtypes.h:523
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
TK_TT_TSTRING
@ TK_TT_TSTRING
token string
Definition: tk.h:319
agt_ypsnmp.h
Yuma Interface to net-snmp data structures. Agent interface.
tk_next_typ
tk_type_t tk_next_typ(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3349
agt_restconf_cleanup
void agt_restconf_cleanup(void)
Cleanup the agt_yangapi module.
Definition: agt_restconf.c:1985
agt_cap.h
NETCONF Server capabilities handler.
cfg.h
agt_restcmn_get_http_input
status_t agt_restcmn_get_http_input(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, int content_len)
Get the input from the session input buffers and parse it as the specified target object type.
Definition: agt_restcmn.c:5380
agt_restcmn_free_msg
void agt_restcmn_free_msg(rpc_msg_t *msg)
Free an rpc_msg_t.
Definition: agt_restcmn.c:6899
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
agt_restcmn_setup_read_params
status_t agt_restcmn_setup_read_params(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
Setup the message parameters from the yangapi_cb values.
Definition: agt_restcmn.c:5681
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
ncx_decode_url_string
status_t ncx_decode_url_string(const xmlChar *urlstr, uint32 urlstrlen, xmlChar *buffer, uint32 *cnt)
Fill buffer with a plain string from a URL string.
Definition: ncx.c:10822
agt_restconf.h
IETF RESTCONF Protocol Message Handler.
agt_ses.h
Server Session Management.
agt_util.h
Utility Functions for NCX Server method routines.
cfg_ok_to_write
status_t cfg_ok_to_write(const cfg_template_t *cfg, ses_id_t sesid)
Check if the specified config can be written right now by the specified session ID.
Definition: cfg.c:2286
agt_restconf_static_restmon_cleanup
void agt_restconf_static_restmon_cleanup(void)
Call the cleanup function for the ietf-restconf-monitoring module.
Definition: agt_restconf.c:2753
tstamp.h
Timestamp utilities.
agt_restcmn_get_method
yangapi_method_t agt_restcmn_get_method(const xmlChar *method)
Get the HTTP method enum from the string.
Definition: agt_restcmn.c:6297
agt_rpc_invoke_rpc
status_t agt_rpc_invoke_rpc(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method_node)
Invoke an RPC – need to call following functions first:
Definition: agt_rpc.c:3986
tk_get_token_name
const char * tk_get_token_name(tk_type_t ttyp)
Get the symbolic token name.
Definition: tk.c:3280
tk_new_chain
tk_chain_t * tk_new_chain(void)
Allocatate a new token parse chain.
Definition: tk.c:2919
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
cfg_rwlock_acquire_single_wrlock
status_t cfg_rwlock_acquire_single_wrlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Acquire a single RWLOCK for write access.
Definition: cfg.c:978
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
YANGAPI_LAUNCHPT_DATA
@ YANGAPI_LAUNCHPT_DATA
/restconf/data/foo launch point
Definition: yangapi.h:137
ncx_get_mod_nsid
xmlns_id_t ncx_get_mod_nsid(const ncx_module_t *mod)
Get the main module namespace ID.
Definition: ncx.c:4850
ses_start_msg_mode
void ses_start_msg_mode(ses_cb_t *scb)
Set the message output mode to active.
Definition: ses.c:2932
ERR_NCX_JSON_NOT_YET
@ ERR_NCX_JSON_NOT_YET
412
Definition: status_enum.h:455
agt_yangapi_edit.h
Yuma REST API Edit Handler.
agt_restcmn_setup_notifications
status_t agt_restcmn_setup_notifications(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
setup the notification delivery on this GET request
Definition: agt_restcmn.c:5576
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
SES_ST_IDLE
@ SES_ST_IDLE
adble to accept requests
Definition: ses.h:358
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
agt_restconf_dispatch_gnmi_get
boolean agt_restconf_dispatch_gnmi_get(ses_cb_t *scb)
Dispatch an incoming gNMI GET request with help of RESTCONF.
Definition: agt_restconf.c:2785
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.
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.
status_enum.h
global error status code enumerations
agt_restconf_static_restmon_init2
status_t agt_restconf_static_restmon_init2(void)
Call the ietf-restconf-monitoring init2 function.
Definition: agt_restconf.c:2733
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.
agt_restcmn_validate_method
status_t agt_restcmn_validate_method(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
validate that the method is supported for the URI given.
Definition: agt_restcmn.c:5946
tk_dump_chain
void tk_dump_chain(const tk_chain_t *tkc)
Debug printf the token chain !!! Very verbose !!!
Definition: tk.c:3532
xml_wr.h
XML Write functions.
ncx_num.h
NCX Module Library Number Utility Functions.
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
agt_restcmn_get_content_len
int agt_restcmn_get_content_len(yangapi_cb_t *rcb)
Get the content length for the input request message body.
Definition: agt_restcmn.c:5913
SES_YPMODE_RESTCONF
@ SES_YPMODE_RESTCONF
RESTCONF mode.
Definition: ses.h:312
agt_sys_send_sysConfigChange
void agt_sys_send_sysConfigChange(const ses_cb_t *scb, dlq_hdr_t *auditrecQ)
Queue the Config Change notification.
Definition: agt_sys.c:1355
agt_restcmn_record_obj_error
void agt_restcmn_record_obj_error(ses_cb_t *scb, rpc_msg_t *msg, status_t res, obj_template_t *errobj, const xmlChar *badval)
Record an rpc-error for YANG-API/RESTCONF response translation the error node is an object,...
Definition: agt_restcmn.c:7282
agt_xml.h
NETCONF Server XML Reader interface.
agt_yangapi_edit_request
status_t agt_yangapi_edit_request(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
Perform an internal <edit-config> and <commit> if needed.
Definition: agt_yangapi_edit.c:1299
agt_restconf_init
status_t agt_restconf_init(void)
Initialize the agt_restconf module.
Definition: agt_restconf.c:1960
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.
agt_not.h
NETCONF Notifications DM module support.
xpath_yang_make_instanceid_val
val_value_t * xpath_yang_make_instanceid_val(xpath_pcb_t *pcb, status_t *retres, val_value_t **deepest)
Make a value subtree out of an instance-identifier Used by yangcli to send PDUs from CLI target param...
Definition: xpath_yang.c:2838
agt_yangapi.h
Yuma REST API Message Handler.
agt_restconf_validate_method_params
status_t agt_restconf_validate_method_params(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
validate that the operation is supported for the URI parameters given.
Definition: agt_restconf.c:1618
TK_ADV
#define TK_ADV(T)
advance the current token pointer
Definition: tk.h:107
agt_restcmn_check_unmodified_return
boolean agt_restcmn_check_unmodified_return(yangapi_cb_t *rcb)
Check if the context node(s) will match the filters (if any)
Definition: agt_restcmn.c:5511
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
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
agt_cb.h
NETCONF Server Data Model callback handler.
SES_TRANSPORT_COAP
@ SES_TRANSPORT_COAP
CoAP UDP socket.
Definition: ses.h:343
agt_restcmn_parse_fragment
status_t agt_restcmn_parse_fragment(yangapi_cb_t *rcb, xmlChar *uri, uint32 *retlen)
parse the request URI fragment
Definition: agt_restcmn.c:3898
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
TK_TT_FSLASH
@ TK_TT_FSLASH
forward slash char '/'
Definition: tk.h:301
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.
agt_val.h
NETCONF Server database callback handler.
agt_json_parse.h
JSON input stream parser module.
xpath1.h
XPath 1.0 expression support.
agt_yangpatch_edit
status_t agt_yangpatch_edit(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
Handle a YANG Patch edit.
Definition: agt_yangpatch.c:1309
agt_in_maintenance_mode
boolean agt_in_maintenance_mode(void)
Return true if in mainenance mode now.
Definition: agt.c:5184
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
xml_val.h
Utility functions for creating value structs.
agt_restconf_get_root
val_value_t * agt_restconf_get_root(void)
Get the RESTCONF Context root val_value_t node.
Definition: agt_restconf.c:2687
TK_TT_LPAREN
@ TK_TT_LPAREN
left paren '('
Definition: tk.h:289
ERR_NCX_WRONG_TKTYPE
@ ERR_NCX_WRONG_TKTYPE
245
Definition: status_enum.h:284
YANGAPI_LAUNCHPT_OPERATIONS
@ YANGAPI_LAUNCHPT_OPERATIONS
/restconf/operations launch point
Definition: yangapi.h:149
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
agt_restconf_dispatch
boolean agt_restconf_dispatch(ses_cb_t *scb)
Dispatch an incoming RESTCONF request.
Definition: agt_restconf.c:2009
TK_CUR_MOD
#define TK_CUR_MOD(T)
return the current token module qualifier value
Definition: tk.h:134
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
agt_ncx.h
NETCONF Server standard method routines.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
cfg_rwlock_release_all_locks
status_t cfg_rwlock_release_all_locks(thd_tcb_t *tcb)
Release all RWLOCKs recorded in TCB lock state structure.
Definition: cfg.c:675
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
agt_make_empty_leaf
val_value_t * agt_make_empty_leaf(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, boolean boolval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_EMPTY)
Definition: agt_util.c:5932
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
ERR_NCX_MAINTENANCE_MODE
@ ERR_NCX_MAINTENANCE_MODE
420
Definition: status_enum.h:463
agt_rpc_invoke_action
status_t agt_rpc_invoke_action(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method_node, val_value_t *action_val)
Invoke an Action – need to call following functions first:
Definition: agt_rpc.c:4027
obj_has_children
boolean obj_has_children(obj_template_t *obj)
Check if there are any accessible nodes within the object.
Definition: obj.c:14831
ncx_valid_name
boolean ncx_valid_name(const xmlChar *str, uint32 len)
Check if an xmlChar string is a valid YANG identifier value.
Definition: ncx.c:7596
ncx_match_any_object_ex
obj_template_t * ncx_match_any_object_ex(const xmlChar *modname, const xmlChar *objname, boolean dataonly, ncx_name_match_t name_match, boolean alt_names, status_t *retres)
Match any object in any YANG module with double extra search options.
Definition: ncx.c:4171
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
val_util.h
Value Node Utilities.
agt_restcmn_parse_path
status_t agt_restcmn_parse_path(ses_cb_t *scb, rpc_msg_t *msg, yangapi_cb_t *rcb, val_value_t *root, const xmlChar *path)
parse the request URI path
Definition: agt_restcmn.c:4593
json_wr.h
JSON Write functions.
agt_cb_run_command_complete
void agt_cb_run_command_complete(ses_cb_t *scb, rpc_msg_t *msg, const xmlChar *command_modname, const xmlChar *command_name)
Run Command Complete callbacks.
Definition: agt_cb.c:4373
agt_get_savedevQ
dlq_hdr_t * agt_get_savedevQ(void)
Get the agt_savedevQ pointer.
Definition: agt.c:4747
ncx_get_gen_container
obj_template_t * ncx_get_gen_container(void)
Get the object template for the NCX generic container.
Definition: ncx.c:6678
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
agt_restconf_dispatch_ex
boolean agt_restconf_dispatch_ex(ses_cb_t *scb, boolean scb_is_static)
Dispatch an incoming RESTCONF request (Extended)
Definition: agt_restconf.c:2031
agt_make_leaf2
val_value_t * agt_make_leaf2(obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:5545
agt_sil_lib.h
Server Instrumentation Library Support.
SES_TRANSPORT_GNMI
@ SES_TRANSPORT_GNMI
GNMI Internal processing over RESTCONF.
Definition: ses.h:347
YANGAPI_LAUNCHPT_EVENTS
@ YANGAPI_LAUNCHPT_EVENTS
events launch point
Definition: yangapi.h:170
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
YANGAPI_LAUNCHPT_TOP
@ YANGAPI_LAUNCHPT_TOP
/restconf launch point
Definition: yangapi.h:131
rpc.h
NETCONF protocol remote procedure call common definitions.
agt_ses_request_close
boolean agt_ses_request_close(ses_cb_t *scb, ses_id_t killedby, ses_term_reason_t termreason)
Start the close of the specified session.
Definition: agt_ses.c:1056
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xml_strncmp
int xml_strncmp(const xmlChar *s1, const xmlChar *s2, uint32 maxlen)
String compare for xmlChar for at most 'maxlen' xmlChars.
Definition: xml_util.c:1824
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
SES_TR_DROPPED
@ SES_TR_DROPPED
dropped by remote peer
Definition: ses.h:391
val_child.h
Value Node Child Access Support.
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
OP_INSOP_NONE
@ OP_INSOP_NONE
not set
Definition: op.h:138
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
obj_rpc_has_input
boolean obj_rpc_has_input(obj_template_t *obj)
Check if the RPC object has any real input children.
Definition: obj.c:14956
agt_restcmn_operation_supports_json
boolean agt_restcmn_operation_supports_json(obj_template_t *rpcobj)
Check if the NETCONF operation supports JSON output.
Definition: agt_restcmn.c:5827
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
tk_setup_chain_fields
void tk_setup_chain_fields(tk_chain_t *tkc, xmlChar *str)
Setup a previously allocated chain for 'fields' RESTCONF query parameter str value.
Definition: tk.c:2997
NCX_BT_CONTAINER
@ NCX_BT_CONTAINER
internal container
Definition: ncxtypes.h:225
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.
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
yangconst.h
Contains YANG constants separated to prevent H file include loops.
xml_msg_set_encoding
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
obj_is_anydata
boolean obj_is_anydata(const obj_template_t *obj)
Check if object is an anydata.
Definition: obj.c:13284
TK_CUR_MODLEN
#define TK_CUR_MODLEN(T)
return the current token module qualifier value length
Definition: tk.h:137
yang_patch.h
YANG Patch Media Type.
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
LOGINFO
#define LOGINFO
Check if at least log-level=info.
Definition: log.h:279
ses_withdef
ncx_withdefaults_t ses_withdef(const ses_cb_t *scb)
Get the with-defaults value for this session.
Definition: ses.c:3461
ses_stop_msg_mode
void ses_stop_msg_mode(ses_cb_t *scb)
Set the message output mode to inactive.
Definition: ses.c:2950
TK_TT_RPAREN
@ TK_TT_RPAREN
right paren ')'
Definition: tk.h:290
ncx_get_gen_root
obj_template_t * ncx_get_gen_root(void)
Get the object template for the NCX generic root container.
Definition: ncx.c:6720
agt.h
Multi-Protocol Network Management Server.
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
agt_op_ok_for_maintenance_mode
boolean agt_op_ok_for_maintenance_mode(const obj_template_t *rpcobj)
Check if the operation is OK for maintenance mode.
Definition: agt_util.c:6753
agt_yangapi_reply.h
RESTCONF Reply Handler.
TK_TT_SEMICOL
@ TK_TT_SEMICOL
semi-colon ';'
Definition: tk.h:288
agt_restcmn.h
Common function for RESTCONF and YANG-API protocols.
get_launchpoint_name
const xmlChar * get_launchpoint_name(yangapi_launchpt_t launchpt)
Get the keyword for the specified launchpt.
Definition: agt_restcmn.c:3842
YANGAPI_METHOD_NONE
@ YANGAPI_METHOD_NONE
not set
Definition: yangapi.h:116
xpath_yang.h
YANG-specific Xpath support.
obj_is_anyxml
boolean obj_is_anyxml(const obj_template_t *obj)
Check if object is an anyxml.
Definition: obj.c:13271
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
xml_msg.h
XML and JSON Message send and receive support.
YANGAPI_LAUNCHPT_STREAMS
@ YANGAPI_LAUNCHPT_STREAMS
streams launch point
Definition: yangapi.h:164
ERR_NCX_TOO_MANY_XML
@ ERR_NCX_TOO_MANY_XML
411
Definition: status_enum.h:454
agt_acm_clear_msg_cache
void agt_acm_clear_msg_cache(xml_msg_hdr_t *msg)
Clear an agt_acm_cache_t struct attached to the specified message.
Definition: agt_acm.c:734
agt_yangpatch.h
YumaPro YANG-PATCH Edit Handler for HA/RESTCONF/NETCONF.
agt_getbulk_ok_for_nolock
boolean agt_getbulk_ok_for_nolock(const xmlChar *pathstr)
Check if the get-bulk target is OK for a nolock get without waiting for a pthreads filter.
Definition: agt_util.c:6646
agt_val_parse.h
XML Parameter Value Parser Module.
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
agt_make_object
val_value_t * agt_make_object(obj_template_t *parentobj, const xmlChar *objname, status_t *res)
make a val_value_t struct for a specified node
Definition: agt_util.c:3841
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
SES_ST_SHUTDOWN_REQ
@ SES_ST_SHUTDOWN_REQ
session shutdown requested
Definition: ses.h:360
agt_restcmn_check_metpar_error
status_t agt_restcmn_check_metpar_error(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, const xmlChar *parmname)
validate that the URI parameters given are supported for the method
Definition: agt_restcmn.c:6272
agt_ypsnmp_reply_handler
status_t agt_ypsnmp_reply_handler(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, status_t result)
Handler called for sending a response.
Definition: agt_ypsnmp.c:3529
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
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
ncxmod_load_module
status_t ncxmod_load_module(const xmlChar *modname, const xmlChar *revision, dlq_hdr_t *savedevQ, ncx_module_t **retmod)
Determine the location of the specified module and then load it into the system, if not already loade...
Definition: ncxmod.c:4342
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
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_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
ypgnmi.h
YP-GNMI requests support module.
agt_sys.h
NETCONF system.yang DM module support.
cfg_ok_to_read
status_t cfg_ok_to_read(const cfg_template_t *cfg)
Check if the specified config can be read right now.
Definition: cfg.c:2226
rpc_new_msg
rpc_msg_t * rpc_new_msg(void)
Malloc and initialize a new rpc_msg_t struct.
Definition: rpc.c:84
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_restconf_setup_fields_nodes
status_t agt_restconf_setup_fields_nodes(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, boolean *errdone)
Setup fields nodes if parameter is used.
Definition: agt_restconf.c:1426
YANGAPI_METHOD_GET
@ YANGAPI_METHOD_GET
GET method.
Definition: yangapi.h:119
clear_errors
void clear_errors(void)
Clear the error_stack if it has any errors stored in it.
Definition: status.c:179
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
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
tk_tokenize_input
status_t tk_tokenize_input(tk_chain_t *tkc, ncx_module_t *mod)
Parse the input (FILE or buffer) into tk_token_t structs.
Definition: tk.c:3641
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.
val_child_swap
status_t val_child_swap(val_value_t *newchild, val_value_t *curchild)
Swap a child value node with a current value node.
Definition: val_child.c:2253
YANGAPI_LAUNCHPT_DATASTORE
@ YANGAPI_LAUNCHPT_DATASTORE
/restconf/data launch point
Definition: yangapi.h:134
YANGAPI_LAUNCHPT_ACTION
@ YANGAPI_LAUNCHPT_ACTION
action launch point
Definition: yangapi.h:176
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
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
SES_TR_CLOSED
@ SES_TR_CLOSED
close-session
Definition: ses.h:389
agt_timer_get_timenow
void agt_timer_get_timenow(time_t *tnow)
Get the current time using the system or monotonic clock.
Definition: agt_timer.c:457
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
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_restcmn_set_content_encoding
status_t agt_restcmn_set_content_encoding(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg)
Get the content encoding used.
Definition: agt_restcmn.c:5465
agt_rpcerr.h
NETCONF protocol <rpc-error> server-side handler.
agt_restcmn_validate_query_string
status_t agt_restcmn_validate_query_string(ses_cb_t *scb, rpc_msg_t *msg, yangapi_cb_t *rcb)
Validate the parameters in the request URI query string.
Definition: agt_restcmn.c:4083
obj.h
Data Object Support.
TK_CUR_TYP
#define TK_CUR_TYP(T)
return the current token type
Definition: tk.h:125
cfg_get_config_id
cfg_template_t * cfg_get_config_id(ncx_cfg_t cfgid)
Get the config struct from its ID.
Definition: cfg.c:1530
agt_restcmn_print_debug_line
void agt_restcmn_print_debug_line(ses_cb_t *scb, yangapi_cb_t *rcb)
Print the message received debug line.
Definition: agt_restcmn.c:6917
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
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
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.
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
SES_TRANSPORT_HTTP
@ SES_TRANSPORT_HTTP
YumaPro REST API ncxconnect, no framing.
Definition: ses.h:339
agt_restconf_static_restmon_init1
status_t agt_restconf_static_restmon_init1(void)
Load the ietf-restconf-monitoring SIL even if it is statically linked.
Definition: agt_restconf.c:2713
agt_get_rpc_input
val_value_t * agt_get_rpc_input(rpc_msg_t *msg)
Get the rpc input value node.
Definition: agt_util.c:6487
SES_TRANSPORT_SNMP
@ SES_TRANSPORT_SNMP
SNMP UDP socket.
Definition: ses.h:345
agt_restconf_get_context
agt_restconf_data_t * agt_restconf_get_context(void)
Get the RESTCONF Context structure.
Definition: agt_restconf.c:2671
obj_is_data_db
boolean obj_is_data_db(const obj_template_t *obj)
Check if the object is some sort of data Constrained to only check the config DB objects,...
Definition: obj.c:13788
agt_timer.h
Handle timer services for the server.
agt_rpc_check_rpc_invoke
status_t agt_rpc_check_rpc_invoke(ses_cb_t *scb, rpc_msg_t *msg, obj_template_t *rpcobj)
Some RPC node parsed, check if it can be invoked or not.
Definition: agt_rpc.c:3824
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
YANGAPI_METHOD_OPTIONS
@ YANGAPI_METHOD_OPTIONS
OPTIONS method.
Definition: yangapi.h:117
val_child_add_force
status_t val_child_add_force(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node Force add even if Tree Insersion fails.
Definition: val_child.c:1624
agt_restcmn_validate_accept_header
boolean agt_restcmn_validate_accept_header(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, boolean error_recorded, status_t *res)
Validate the client Accept header.
Definition: agt_restcmn.c:6396
YANGAPI_LAUNCHPT_STREAM
@ YANGAPI_LAUNCHPT_STREAM
streams/stream launch point
Definition: yangapi.h:167
agt_restcmn_parse_query_string
status_t agt_restcmn_parse_query_string(ses_cb_t *scb, rpc_msg_t *msg, yangapi_cb_t *rcb, xmlChar *uri, uint32 *retlen)
parse the request URI query string
Definition: agt_restcmn.c:3935
ERR_NCX_MISSING_INPUT
@ ERR_NCX_MISSING_INPUT
407
Definition: status_enum.h:450
NCX_DISPLAY_MODE_JSON
@ NCX_DISPLAY_MODE_JSON
JSON (RFC 7951 format)
Definition: ncxtypes.h:466
xmlns.h
XML namespace support.
TK_TT_MSTRING
@ TK_TT_MSTRING
module-qualified token string
Definition: tk.h:320
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.
yangapi.h
YANG-API definitions (pre-RESTCONF)
print_errors
void print_errors(void)
Dump any entries stored in the error_stack.
Definition: status.c:155
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
dlq.h
dlq provides general double-linked list and queue support:
SES_ST_IN_MSG
@ SES_ST_IN_MSG
processing a request
Definition: ses.h:359
agt_restcmn_get_operations
status_t agt_restcmn_get_operations(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
GET1 operation handler for the /operations container.
Definition: agt_restcmn.c:5858
thd_module_db_rdlock
status_t thd_module_db_rdlock(thd_tcb_t *tcb)
Request read access to the module DB ("object tree")
Definition: thd.c:1340
agt_acm_init_msg_cache
status_t agt_acm_init_msg_cache(ses_cb_t *scb, xml_msg_hdr_t *msg)
Malloc and initialize an agt_acm_cache_t struct and attach it to the incoming message.
Definition: agt_acm.c:686
xmlns_check_deleted_ns
void xmlns_check_deleted_ns(void)
Check if a deleted namespace is pending and free it.
Definition: xmlns.c:1382
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
agt_cap_set_restconf_caps
status_t agt_cap_set_restconf_caps(const xmlChar *defstyle, uint8 withdef_enabled)
Initialize the RESTCONF capabilities.
Definition: agt_cap.c:315
YANGAPI_METHOD_DELETE
@ YANGAPI_METHOD_DELETE
DELETE method.
Definition: yangapi.h:123
agt_restcmn_setup_launch_point
void agt_restcmn_setup_launch_point(yangapi_cb_t *rcb)
check the parseed request URI path set the API launch point data
Definition: agt_restcmn.c:7503