yumapro  20.10-12
YumaPro SDK
agt_yangapi.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_YCONTROL) || defined(WITH_RESTCONF)
12 #ifndef _H_agt_yangapi
13 #define _H_agt_yangapi
14 /* FILE: agt_yangapi.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 10-apr-12 abb Begun.
36 */
37 
38 #ifndef _H_ses
39 #include "ses.h"
40 #endif
41 
42 #ifndef _H_status
43 #include "status.h"
44 #endif
45 
46 #ifndef _H_yangapi
47 #include "yangapi.h"
48 #endif
49 
50 #ifndef _H_yang_patch
51 #include "yang_patch.h"
52 #endif
53 
54 #ifndef _H_agt_restcmn
55 #include "agt_restcmn.h"
56 #endif
57 
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 
64 /********************************************************************
65 * *
66 * C O N S T A N T S *
67 * *
68 *********************************************************************/
69 
70 
71 /********************************************************************
72 * *
73 * T Y P E S *
74 * *
75 *********************************************************************/
76 
77 
78 /********************************************************************
79 * *
80 * F U N C T I O N S *
81 * *
82 *********************************************************************/
83 
102 extern status_t
103  agt_yangapi_init (void);
104 
105 
111 extern void
112  agt_yangapi_cleanup (void);
113 
114 
122 extern boolean
123  agt_yangapi_dispatch (ses_cb_t *scb);
124 
125 
145 extern boolean
146  agt_yangapi_dispatch_db_api (ses_cb_t *scb,
147  yang_patch_cb_t *pcb,
148  boolean skip_sil,
149  boolean skip_save,
150  const xmlChar *comment_str,
151  status_t *res);
152 
153 
165 extern status_t
166  agt_yangapi_validate_method_params (ses_cb_t *scb,
167  yangapi_cb_t *rcb,
168  rpc_msg_t *msg);
169 
170 
176 extern agt_yangapi_context_t *
178 
179 
184 #ifdef __cplusplus
185 } /* end extern 'C' */
186 #endif
187 
188 #endif /* _H_agt_yangapi */
189 #endif // WITH_YANGAPI || WITH_YCONTROL || WITH_RESTCONF
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
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
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
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
agt_restcmn_free_msg
void agt_restcmn_free_msg(rpc_msg_t *msg)
Free an rpc_msg_t.
Definition: agt_restcmn.c:6899
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
cfg_rwlock_acquire_lock_pair
status_t cfg_rwlock_acquire_lock_pair(thd_tcb_t *tcb, cfg_template_t *cfg1, boolean wrlock1, cfg_template_t *cfg2, boolean wrlock2)
Acquire multiple (2) locks in predetermined, repeatable in order to help prevent deadlock.
Definition: cfg.c:839
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_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
OP_EDITOP_NONE
@ OP_EDITOP_NONE
not set
Definition: op.h:123
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
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
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.
obj_is_rpc
boolean obj_is_rpc(const obj_template_t *obj)
Check if the object is an RPC method.
Definition: obj.c:13983
cfg_new_fake_candidate
cfg_template_t * cfg_new_fake_candidate(const xmlChar *name, ncx_cfg_t cfg_id)
Malloc and initialize a new fake Candidate cfg_template_t struct.
Definition: cfg.c:3391
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
op_insertop_id
op_insertop_t op_insertop_id(const xmlChar *opstr)
Get the ID for the insert operation from its keyword.
Definition: op.c:234
YANGAPI_LAUNCHPT_OPERATION
@ YANGAPI_LAUNCHPT_OPERATION
/restconf/operations/some-operation launch point
Definition: yangapi.h:152
agt_yangapi_cleanup
void agt_yangapi_cleanup(void)
Cleanup the agt_yangapi module.
Definition: agt_yangapi.c:859
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
xml_wr.h
XML Write functions.
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
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
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
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
agt_not.h
NETCONF Notifications DM module support.
agt_cap_get_caps
cap_list_t * agt_cap_get_caps(void)
Get the NETCONF server capabilities.
Definition: agt_cap.c:931
cfg_get_dirty_flag
boolean cfg_get_dirty_flag(const cfg_template_t *cfg)
Get the config dirty flag value.
Definition: cfg.c:2066
agt_yangapi.h
Yuma REST API Message Handler.
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
yangapi_new_rcb
yangapi_cb_t * yangapi_new_rcb(void)
Create a new YANG-API control block.
Definition: yangapi.c:317
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.
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.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
cap_first_modcap
cap_rec_t * cap_first_modcap(cap_list_t *caplist)
Get the first module capability in the list.
Definition: cap.c:2674
val_add_child
void val_add_child(val_value_t *child, val_value_t *parent)
Add a child (deprecated: use val_child_add instead)
Definition: val.c:8231
xml_val.h
Utility functions for creating value structs.
AGT_EVAL_REQUEST_LIMIT
#define AGT_EVAL_REQUEST_LIMIT
max.
Definition: agt.h:499
YANGAPI_LAUNCHPT_OPERATIONS
@ YANGAPI_LAUNCHPT_OPERATIONS
/restconf/operations launch point
Definition: yangapi.h:149
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
NCX_WITHDEF_REPORT_ALL_TAGGED
@ NCX_WITHDEF_REPORT_ALL_TAGGED
report-all-tagged
Definition: ncxtypes.h:1013
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
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
agt_restcmn_get_param
xmlChar * agt_restcmn_get_param(yangapi_cb_t *rcb, const xmlChar *name, boolean *found)
Find a query parameter and return its value.
Definition: agt_restcmn.c:4049
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_get_savedevQ
dlq_hdr_t * agt_get_savedevQ(void)
Get the agt_savedevQ pointer.
Definition: agt.c:4747
yang_patch_op_to_editop
op_editop_t yang_patch_op_to_editop(yang_patch_op_t op, boolean *is_insert)
Convert a YANG Patch operation enum to the corresponding edit operation.
Definition: yang_patch.c:1149
YANGAPI_LAUNCHPT_NEW_DATA
@ YANGAPI_LAUNCHPT_NEW_DATA
/restconf/data/foo/new-bar launch point
Definition: yangapi.h:140
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
NCX_CFGID_CANDIDATE
@ NCX_CFGID_CANDIDATE
candidate datastore
Definition: ncxtypes.h:385
agt_sil_lib.h
Server Instrumentation Library Support.
YANGAPI_LAUNCHPT_EVENTS
@ YANGAPI_LAUNCHPT_EVENTS
events launch point
Definition: yangapi.h:170
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
SES_TR_DROPPED
@ SES_TR_DROPPED
dropped by remote peer
Definition: ses.h:391
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
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
cap_next_modcap
cap_rec_t * cap_next_modcap(cap_rec_t *curcap)
Get the next module capability in the list.
Definition: cap.c:2707
yang_patch.h
YANG Patch Media Type.
obj_find_template_top
obj_template_t * obj_find_template_top(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files visible to this module.
Definition: obj.c:5826
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_yangapi_validate_method_params
status_t agt_yangapi_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_yangapi.c:1630
ses_stop_msg_mode
void ses_stop_msg_mode(ses_cb_t *scb)
Set the message output mode to inactive.
Definition: ses.c:2950
agt_make_leaf
val_value_t * agt_make_leaf(obj_template_t *parentobj, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a string val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:3683
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
YANGAPI_LAUNCHPT_YANG
@ YANGAPI_LAUNCHPT_YANG
YANG launch point.
Definition: yangapi.h:155
GETCB_GET_VALUE
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:247
agt_yangapi_reply.h
RESTCONF Reply Handler.
agt_restcmn.h
Common function for RESTCONF and YANG-API protocols.
YANGAPI_METHOD_NONE
@ YANGAPI_METHOD_NONE
not set
Definition: yangapi.h:116
SES_YPMODE_NONE
@ SES_YPMODE_NONE
not set
Definition: ses.h:310
xpath_yang.h
YANG-specific Xpath support.
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
agt_yangapi_get_context
agt_yangapi_context_t * agt_yangapi_get_context(void)
Get the YANG-API Context structure.
Definition: agt_yangapi.c:1768
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_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_yangapi_dispatch
boolean agt_yangapi_dispatch(ses_cb_t *scb)
Dispatch an incoming Yuma REST API request.
Definition: agt_yangapi.c:882
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
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_restcmn_make_uri
xmlChar * agt_restcmn_make_uri(ses_cb_t *scb, const xmlChar *target, const xmlChar *edit_target)
Make a URI string.
Definition: agt_restcmn.c:7167
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
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
yang_patch_edit_count
uint32 yang_patch_edit_count(yang_patch_cb_t *pcb)
Get the number of edits in the PCB.
Definition: yang_patch.c:443
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_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
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.
cfg_free_template
void cfg_free_template(cfg_template_t *cfg)
Clean and free the cfg_template_t struct.
Definition: cfg.c:1383
agt_cfg.h
Manage Server configuration edit transactions.
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
cfg_rwlock_unlock
status_t cfg_rwlock_unlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Release a lock associated with a cfg (datastore) RWLOCK structure.
Definition: cfg.c:535
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.
rpc_free_msg
void rpc_free_msg(rpc_msg_t *msg)
Free all the memory used by the specified rpc_msg_t.
Definition: rpc.c:152
YANGAPI_LAUNCHPT_DATASTORE
@ YANGAPI_LAUNCHPT_DATASTORE
/restconf/data launch point
Definition: yangapi.h:134
yangapi_free_rcb
void yangapi_free_rcb(yangapi_cb_t *rcb)
Free a YANGAPI control block.
Definition: yangapi.c:351
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_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
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
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.
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
agt_yangapi_edit_request_ex2
status_t agt_yangapi_edit_request_ex2(ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, val_value_t *force_editval, op_editop_t force_editop, boolean skip_sil, boolean skip_save, boolean check_candidate, boolean candidate_start_dirty, const xmlChar *comment_str, yang_patch_edit_t *edit)
Handle an edit request from DB-API (extra 2)
Definition: agt_yangapi_edit.c:1377
SES_TRANSPORT_HTTP
@ SES_TRANSPORT_HTTP
YumaPro REST API ncxconnect, no framing.
Definition: ses.h:339
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
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
agt_yangapi_dispatch_db_api
boolean agt_yangapi_dispatch_db_api(ses_cb_t *scb, yang_patch_cb_t *pcb, boolean skip_sil, boolean skip_save, const xmlChar *comment_str, status_t *res)
Dispatch an incoming YControl DB-API request.
Definition: agt_yangapi.c:1260
YANGAPI_METHOD_OPTIONS
@ YANGAPI_METHOD_OPTIONS
OPTIONS method.
Definition: yangapi.h:117
ERR_NCX_EVAL_LIMIT_REACHED
@ ERR_NCX_EVAL_LIMIT_REACHED
398
Definition: status_enum.h:441
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.
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.
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
yang_patch_where_to_str
const xmlChar * yang_patch_where_to_str(yang_patch_where_t wh)
Convert a YANG Patch where enum to the where string for the enumeration.
Definition: yang_patch.c:645
YANGAPI_METHOD_DELETE
@ YANGAPI_METHOD_DELETE
DELETE method.
Definition: yangapi.h:123
agt_yangapi_init
status_t agt_yangapi_init(void)
Initialize the agt_yangapi module.
Definition: agt_yangapi.c:834
YANGAPI_LAUNCHPT_MODULES
@ YANGAPI_LAUNCHPT_MODULES
modules launch point
Definition: yangapi.h:143