77#define YANG_API_MODULE NCXMOD_YANG_API
78#define YANGAPI_WRAPPER_NODE NCX_EL_DATA
79#define YANGPATCH_WRAPPER_NODE (const xmlChar *)"yang-patch-status"
80#define YANG_API_REVISION NULL
82#define YANG_API_ROOT (const xmlChar *)"yang-api"
83#define YANG_API_VERSION (const xmlChar *)"1.0"
85 (const xmlChar *)"Please specify module name and revision"
88#define RESTCONF_REVISION (const xmlChar *)"2017-01-26"
89#define RESTCONF_YUMA_REVISION (const xmlChar *)"2015-12-03"
91#define RESTCONF_ROOT (const xmlChar *)"restconf"
92#define RESTCONF_QMAX (const xmlChar *)"1.0"
94#define RESTCONF_CONTENT_JSON (const xmlChar *)"application/json"
95#define RESTCONF_CONTENT_XML (const xmlChar *)"application/xml"
96#define RESTCONF_CONTENT_TEXT_XML (const xmlChar *)"text/xml"
97#define RESTCONF_DEF_ACCEPT_TYPE (const xmlChar *)"application/yang-data"
98#define RESTCONF_HEADER_WILDCARD (const xmlChar *)"*/*"
101#define RESTCONF_CONTENT_PATCH_XML \
102 (const xmlChar *)"application/yang-patch+xml"
103#define RESTCONF_CONTENT_PATCH_JSON \
104 (const xmlChar *)"application/yang-patch+json"
111#define TEMP_BUFF_SIZE 1024
113#define YL_FS_SEP (const xmlChar *)"/"
115#define YANG_XRD_MEDIA (const xmlChar *)"application/xrd"
116#define YANG_YANG_MEDIA (const xmlChar *)"application/yang"
117#define YANG_EVENT_MEDIA (const xmlChar *)"text/event"
118#define YANG_STREAM_SUBMEDIA (const xmlChar *)"stream"
119#define YANG_PATCH_SUBMEDIA (const xmlChar *)"patch"
120#define YANG_DATA_SUBMEDIA (const xmlChar *)"data"
121#define YANG_XRD_SUBMEDIA (const xmlChar *)"xrd"
124#define RESTCONF_YANG_SCHEMA (const xmlChar *)"schema"
170typedef struct agt_yangapi_context_t_ {
183typedef struct agt_restconf_data_t_ {
209extern const xmlChar *
328 const xmlChar *path);
497 const xmlChar *parmname);
558 boolean error_recorded,
629 const xmlChar *target,
630 const xmlChar *edit_target);
661 const xmlChar *badval);
678 const xmlChar *badval);
697 const xmlChar *badval,
716 const xmlChar *badval);
734 const xmlChar *badval);
742extern const xmlChar *
GET1 and GET2 Callback Support.
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:6757
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:5863
yangapi_param_t * agt_restcmn_get_first_param(yangapi_cb_t *rcb)
Get the first query parameter entry from the parameter queue.
Definition: agt_restcmn.c:4220
xmlns_id_t agt_restcmn_get_nsid(ncx_protocol_t proto)
Get the XML namespace ID for specific proto.
Definition: agt_restcmn.c:7215
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:5730
boolean agt_restcmn_method_is_read(yangapi_method_t method)
Check if this is a read method.
Definition: agt_restcmn.c:6693
val_value_t * agt_restcmn_get_active_root(yangapi_cb_t *rcb)
Select the active CFG and return its root val.
Definition: agt_restcmn.c:8067
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:5817
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:6040
int agt_restcmn_get_content_len(yangapi_cb_t *rcb)
Get the content length for the input request message body.
Definition: agt_restcmn.c:6272
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:6305
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:4808
const xmlChar * agt_restcmn_entry_point(void)
Get the RESTCONF entry point name.
Definition: agt_restcmn.c:7854
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:7698
yangapi_param_t * agt_restcmn_get_next_param(yangapi_param_t *param)
Get the next query parameter entry from the parameter queue.
Definition: agt_restcmn.c:4241
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:7654
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:4077
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:7875
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:5929
xmlChar * agt_restcmn_decode_url(const xmlChar *url, status_t *res)
Decode URL encoded string value into string.
Definition: agt_restcmn.c:7594
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:4191
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:6633
yangapi_method_t agt_restcmn_get_method(const xmlChar *method)
Get the HTTP method enum from the string.
Definition: agt_restcmn.c:6658
boolean agt_restcmn_operation_supports_json(obj_template_t *rpcobj)
Check if the NETCONF operation supports JSON output.
Definition: agt_restcmn.c:6186
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:7462
void agt_restcmn_record_error_errinfo(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.
Definition: agt_restcmn.c:7729
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:6217
const xmlChar * get_launchpoint_name(yangapi_launchpt_t launchpt)
Get the keyword for the specified launchpt.
Definition: agt_restcmn.c:3984
void agt_restcmn_obj_error(ses_cb_t *scb, xml_msg_hdr_t *mhdr, status_t res, obj_template_t *errobj, const xmlChar *badval)
Record an rpc-error for YANG-API/RESTCONF response translation.
Definition: agt_restcmn.c:7761
status_t agt_rescmn_setup_action_request(ses_cb_t *scb, rpc_msg_t *msg, yangapi_cb_t *rcb)
Setup the data needed to invoke a YANG action.
Definition: agt_restcmn.c:7976
void agt_restcmn_print_debug_line(ses_cb_t *scb, yangapi_cb_t *rcb)
Print the message received debug line.
Definition: agt_restcmn.c:7279
xmlChar * agt_restcmn_make_uri(ses_cb_t *scb, const xmlChar *target, const xmlChar *edit_target)
Make a URI string.
Definition: agt_restcmn.c:7531
status_t agt_restcmn_parse_fragment(yangapi_cb_t *rcb, xmlChar *uri, uint32 *retlen)
parse the request URI fragment
Definition: agt_restcmn.c:4040
void agt_restcmn_val_error(ses_cb_t *scb, xml_msg_hdr_t *mhdr, status_t res, val_value_t *errval, const xmlChar *badval)
Record an rpc-error for YANG-API/RESTCONF response translation.
Definition: agt_restcmn.c:7810
void agt_restcmn_free_msg(rpc_msg_t *msg)
Free an rpc_msg_t.
Definition: agt_restcmn.c:7261
val_value_t * agt_restcmn_new_config_wrapper(void)
Create a <config> wrapper val and return it.
Definition: agt_restcmn.c:7493
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:4271
getcb_mode_t
get callback retrieval types; only get2 supports getnext
Definition: getcb.h:259
yangapi_launchpt_t
describes the type of node indicated by the RequestURI path Used internally in the server to process ...
Definition: yangapi.h:126
yangapi_method_t
HTTP methods used by YANG-API and RESTCONF.
Definition: yangapi.h:111
status_t
global error return code
Definition: status_enum.h:210
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_protocol_t
NCX session protocol versions supported.
Definition: ncxtypes.h:1001
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
RESTCONF structure for data.
Definition: agt_restcmn.h:183
obj_template_t * obj
/restconf container
Definition: agt_restcmn.h:186
ncx_module_t * yuma_mod
yumaworks-restconf module
Definition: agt_restcmn.h:185
boolean restconf_enabled
RESTCONF protocol OK.
Definition: agt_restcmn.h:190
xmlns_id_t mod_nsid
module namespace iD
Definition: agt_restcmn.h:191
uint32 cap_changes
capability set
Definition: agt_restcmn.h:188
uint32 requests
limit in the EVAL_VERSION
Definition: agt_restcmn.h:189
ncx_module_t * mod
ietf-restconf module
Definition: agt_restcmn.h:184
val_value_t * root
template for retrieval
Definition: agt_restcmn.h:187
module context node with cached schema tree and API template for retrieval (root)
Definition: agt_restcmn.h:170
obj_template_t * obj
/yang-api container
Definition: agt_restcmn.h:172
boolean yangapi_enabled
YANG-API protocol OK.
Definition: agt_restcmn.h:176
xmlns_id_t mod_nsid
module namespace ID
Definition: agt_restcmn.h:177
uint32 cap_changes
not used yet
Definition: agt_restcmn.h:174
uint32 requests
limit in the EVAL_VERSION
Definition: agt_restcmn.h:175
ncx_module_t * mod
yang-api module
Definition: agt_restcmn.h:171
val_value_t * root
template for retrieval
Definition: agt_restcmn.h:173
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1366
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1229
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
Restapi Control Block Used by RESTCONF to hold parse and request processing state.
Definition: yangapi.h:351
YANG-API Query string parameter.
Definition: yangapi.h:183
YANG-API definitions (pre-RESTCONF)