yumapro  20.10-12
YumaPro SDK
agt_getbulk.h
Go to the documentation of this file.
1 #ifdef WITH_RESTCONF
2 #ifndef _H_agt_getbulk
3 #define _H_agt_getbulk
4 /*
5  * Copyright (c) 2008-2012, Andy Bierman, All Rights Reserved.
6  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
7  *
8  * Unless required by applicable law or agreed to in writing,
9  * software distributed under the License is distributed on an
10  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11  * KIND, either express or implied. See the License for the
12  * specific language governing permissions and limitations
13  * under the License.
14  *
15 
16 *** Generated by yangdump-sdk moggy-yang-2016-04-21.19.50-M
17 
18  Combined SIL header
19  module yumaworks-getbulk
20  revision 2016-04-09
21  namespace http://yumaworks.com/ns/yumaworks-getbulk
22  organization YumaWorks, Inc.
23  Created: 2016-04-22T20:40:08Z
24  CLI parameters:
25  format h
26  indent 4
27  module yumaworks-getbulk
28  output yumaworks-getbulk.h
29  unified true
30 
31  */
32 
33 
40 #include <xmlstring.h>
41 
42 #include "dlq.h"
43 #include "ncxtypes.h"
44 #include "op.h"
45 #include "status.h"
46 #include "val.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #define y_yumaworks_getbulk_M_yumaworks_getbulk (const xmlChar *)"yumaworks-getbulk"
53 
54 #define y_yumaworks_getbulk_R_yumaworks_getbulk (const xmlChar *)"2021-08-07"
55 
56 #define y_yumaworks_getbulk_N_bulk (const xmlChar *)"bulk"
57 #define y_yumaworks_getbulk_N_content (const xmlChar *)"content"
58 #define y_yumaworks_getbulk_N_count (const xmlChar *)"count"
59 #define y_yumaworks_getbulk_N_data (const xmlChar *)"data"
60 #define y_yumaworks_getbulk_N_datastore (const xmlChar *)"datastore"
61 #define y_yumaworks_getbulk_N_depth (const xmlChar *)"depth"
62 #define y_yumaworks_getbulk_N_get_bulk (const xmlChar *)"get-bulk"
63 #define y_yumaworks_getbulk_N_last_keys (const xmlChar *)"last-keys"
64 #define y_yumaworks_getbulk_N_fixed_keys (const xmlChar *)"fixed-keys"
65 #define y_yumaworks_getbulk_N_list_target (const xmlChar *)"list-target"
66 #define y_yumaworks_getbulk_N_with_defaults (const xmlChar *)"with-defaults"
67 #define y_yumaworks_getbulk_N_list_test (const xmlChar *)"list-test"
68 
85 extern status_t agt_getbulk_init (void);
86 
87 
95 extern status_t agt_getbulk_init2 (void);
96 
97 
103 extern void agt_getbulk_cleanup (void);
104 
105 
109 #ifdef __cplusplus
110 } /* end extern 'C' */
111 #endif
112 
113 #endif
114 #endif // WITH_RESTCONF
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.
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
agt_getbulk_cleanup
void agt_getbulk_cleanup(void)
cleanup the server instrumentation library
Definition: agt_getbulk.c:1128
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
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
agt_restconf.h
IETF RESTCONF Protocol Message Handler.
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
obj_get_typdef
typ_def_t * obj_get_typdef(obj_template_t *obj)
Get the typdef for the leaf or leaf-list.
Definition: obj.c:11991
agt_rpc_register_method
status_t agt_rpc_register_method(const xmlChar *module, const xmlChar *method_name, agt_rpc_phase_t phase, agt_rpc_method_t method)
add callback for 1 phase of RPC processing
Definition: agt_rpc.c:2557
ERR_NCX_MISSING_INDEX
@ ERR_NCX_MISSING_INDEX
306
Definition: status_enum.h:349
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
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
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
VAL_STRING
#define VAL_STRING(V)
Access the value as a string ONLY if typ_is_string(typdef) is true.
Definition: val.h:414
agt_getbulk_init2
status_t agt_getbulk_init2(void)
SIL init phase 2: non-config data structures.
Definition: agt_getbulk.c:1114
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
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
agt_getbulk.h
YumaPro <get-bulk> Operation.
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
AGT_RPC_PH_VALIDATE
@ AGT_RPC_PH_VALIDATE
(2) cb after the input is parsed
Definition: agt_rpc.h:115
val_child_find
val_value_t * val_child_find(const val_value_t *parent, const xmlChar *child_modname, const xmlChar *child_name)
Find the child node for the specified child name and modname.
Definition: val_child.c:1707
NCX_LAYER_OPERATION
@ NCX_LAYER_OPERATION
protocol operation layer
Definition: ncxtypes.h:346
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
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.
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
RPC_DATA_YANG
@ RPC_DATA_YANG
STD is used by YANG rpc or action stmts; no extra <data> container will be added to the <rpc-reply> c...
Definition: rpc.h:167
op.h
NETCONF protocol operations.
ncxmod.h
NCX Module Load Manager.
yangapi_new_rcb
yangapi_cb_t * yangapi_new_rcb(void)
Create a new YANG-API control block.
Definition: yangapi.c:317
agt_cb.h
NETCONF Server Data Model callback handler.
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
VAL_ENUM_NAME
#define VAL_ENUM_NAME(V)
Access the enum name in the value ONLY if BCX_NT_ENUM This is the macro used to check values in SIL c...
Definition: val.h:434
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
agt_record_error
void agt_record_error(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:1942
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
agt_rpc_unregister_method
void agt_rpc_unregister_method(const xmlChar *module, const xmlChar *method_name)
remove the callback functions for all phases of RPC or Action processing for the specified RPC method...
Definition: agt_rpc.c:2759
xpath1.h
XPath 1.0 expression support.
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
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
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
getcb_new_get2_lookup
getcb_get2_lookup_t * getcb_new_get2_lookup(obj_template_t *obj, dlq_hdr_t *keyvalQ)
Create a new getcb_get2_lookup struct.
Definition: getcb.c:7865
agt_restcmn_entry_point
const xmlChar * agt_restcmn_entry_point(void)
Get the RESTCONF entry point name.
Definition: agt_restcmn.c:7482
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
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_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
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
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.
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
agt_set_with_defaults
status_t agt_set_with_defaults(rpc_msg_t *msg, const xmlChar *modname, val_value_t **errval)
Check if the <with-defaults> parameter is set in the request message, and if so, it is one of the ser...
Definition: agt_util.c:4540
getbulk_new_cb
getbulk_cb_t * getbulk_new_cb(void)
Create a new getbulk control block.
Definition: getbulk.c:97
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.
NCX_CFGID_STARTUP
@ NCX_CFGID_STARTUP
startup datastore
Definition: ncxtypes.h:386
SES_OUT_BYTES
#define SES_OUT_BYTES(S)
get session out bytes
Definition: ses.h:120
rpc.h
NETCONF protocol remote procedure call common definitions.
getbulk_free_cb
void getbulk_free_cb(getbulk_cb_t *cb)
Clean and free a getbulk control block.
Definition: getbulk.c:117
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_child.h
Value Node Child Access Support.
yangapi_get_content_enum
restconf_content_t yangapi_get_content_enum(const xmlChar *content)
Get the enum for the content query parameter from the query URI part.
Definition: yangapi.c:611
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
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.h
Multi-Protocol Network Management Server.
agt_yangapi_reply.h
RESTCONF Reply Handler.
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
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
VAL_UINT
#define VAL_UINT(V)
Access the value as an uint32 ONLY if NCX_BT_UINT8, 16, 32.
Definition: val.h:482
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
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
val_child_cnt
uint32 val_child_cnt(val_value_t *parent)
Get the number of child nodes present.
Definition: val.c:8907
getcb_new_keyval2
getcb_keyval_t * getcb_new_keyval2(val_value_t *keynode, obj_template_t *keyobj, boolean fixed_value)
Create a new Get2 keyval holder using val backptr.
Definition: getcb.c:7757
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
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
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
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
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
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_set_depth
void agt_set_depth(rpc_msg_t *msg)
Check if the <depth> parameter is set in the request message.
Definition: agt_util.c:4659
YANGAPI_METHOD_GET
@ YANGAPI_METHOD_GET
GET method.
Definition: yangapi.h:119
NCX_NT_VAL
@ NCX_NT_VAL
val_value_t
Definition: ncxtypes.h:276
NCX_NT_NONE
@ NCX_NT_NONE
not set
Definition: ncxtypes.h:273
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.
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
xml_msg_set_cfgid
void xml_msg_set_cfgid(xml_msg_hdr_t *msg, ncx_cfg_t cfgid)
Set the config ID in the message.
Definition: xml_msg.c:1248
yangapi_free_rcb
void yangapi_free_rcb(yangapi_cb_t *rcb)
Free a YANGAPI control block.
Definition: yangapi.c:351
getcb_clean_keyvalQ
void getcb_clean_keyvalQ(dlq_hdr_t *que)
Free all the Get2 keyvals from a dlq_hdr.
Definition: getcb.c:7843
ses_get_out_encoding
ncx_display_mode_t ses_get_out_encoding(ses_cb_t *scb)
Get the output encoding.
Definition: ses.c:4126
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
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
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
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
XML_MSG_SET_LOOKUPQ
#define XML_MSG_SET_LOOKUPQ(M, Q)
Set GET2 lookup entry.
Definition: xml_msg.h:237
val_convert_anyxml_to_real
status_t val_convert_anyxml_to_real(val_value_t *anyxml_val, val_value_t *real_val, val_value_t **error_val)
Convert anydata nodes to match a real template.
Definition: val_util.c:7246
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.
obj_key_count
uint32 obj_key_count(const obj_template_t *obj)
Get the number of keys for this object.
Definition: obj.c:9637
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
XML_MSG_GET2_TARGET
#define XML_MSG_GET2_TARGET(M)
GET2 request target terminal node.
Definition: xml_msg.h:270
agt_timer.h
Handle timer services for the server.
agt_getbulk_init
status_t agt_getbulk_init(void)
initialize the yumaworks-getbulk server instrumentation library
Definition: agt_getbulk.c:1047
RESTCONF_CONTENT_NONE
@ RESTCONF_CONTENT_NONE
not set
Definition: yangapi.h:214
NCX_DISPLAY_MODE_JSON
@ NCX_DISPLAY_MODE_JSON
JSON (RFC 7951 format)
Definition: ncxtypes.h:466
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.
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
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