yumapro  20.10-12
YumaPro SDK
getbulk.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 - 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  */
12 #ifndef _H_getbulk
13 #define _H_getbulk
14 
15 /* FILE: getbulk.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 #include <xmlstring.h>
28 
29 #include "dlq.h"
30 #include "ncxtypes.h"
31 #include "status_enum.h"
32 #include "val.h"
33 #include "yangapi.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 
40 /********************************************************************
41 * *
42 * T Y P E S *
43 * *
44 *********************************************************************/
45 
46 
59 typedef struct getbulk_cb_t_ {
60 
63 
65  xmlChar *list_target;
66 
69 
71  uint32 count;
72 
74  restconf_content_t content_enum;
75 
77  uint32 ret_count;
78 
79  /* depth parameter set directly in xml_msg_hdr */
80  //uint32 depth;
81 
82  /* withdef parameter set directly in xml_msg_hdr */
83  //ncx_withdefaults_t withdef;
84 
93  int32 start_indent;
94 
96  val_value_t *last_keys;
97 
99  val_value_t *list_test_val;
100 
102  val_value_t *fixed_keys;
103 
105  obj_template_t *last_keys_obj;
106 
111  val_value_t *last_entry;
112 
114  val_value_t *ret_last_keys;
115 
116 } getbulk_cb_t;
117 
118 
119 /********************************************************************
120 * *
121 * F U N C T I O N S *
122 * *
123 *********************************************************************/
124 
130 extern getbulk_cb_t *
131  getbulk_new_cb (void);
132 
133 
139 extern void
140  getbulk_free_cb (getbulk_cb_t *cb);
141 
142 
155 extern status_t
156  getbulk_check_get2 (getbulk_cb_t *bulk,
157  obj_template_t *obj,
158  uint32 *max_entries,
159  val_value_t **last_entry);
160 
161 
170 extern boolean
171  getbulk_with_get2 (getbulk_cb_t *bulk,
172  obj_template_t *obj);
173 
174 
184 extern status_t
185  getbulk_create_last_keys (getbulk_cb_t *bulk,
186  val_value_t *lastval);
187 
188 
198 extern status_t
199  getbulk_create_last_keys_get2 (getbulk_cb_t *bulk,
200  dlq_hdr_t *keyQ);
201 
202 
206 #ifdef __cplusplus
207 } /* end extern 'C' */
208 #endif
209 
210 #endif
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
getbulk_cb_t_::last_keys
val_value_t * last_keys
last_keys anydata w/ last keys from client request
Definition: getbulk.h:96
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
getbulk_cb_t_::list_target
xmlChar * list_target
expression identifying the list object to walk
Definition: getbulk.h:65
getbulk_cb_t_::source_cfg
struct cfg_template_t_ * source_cfg
back-ptr to the datastore config
Definition: getbulk.h:62
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
getbulk_cb_t_::count
uint32 count
number of list entries requested
Definition: getbulk.h:71
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
cfg_template_t_
struct representing 1 configuration database
Definition: cfg.h:225
status_enum.h
global error status code enumerations
val_get_next_index
val_index_t * val_get_next_index(const val_index_t *valindex)
Get the next index entry, if any for this value node.
Definition: val.c:10714
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
ncxconst.h
Contains NCX constants.
getbulk_cb_t_::content_enum
restconf_content_t content_enum
content parameter from RESTCONF
Definition: getbulk.h:74
getbulk_cb_t_
Get Bulk Control BLock.
Definition: getbulk.h:59
val_has_index
boolean val_has_index(const val_value_t *val)
Determine if this value has an index.
Definition: val.c:10660
getbulk_cb_t_::last_keys_obj
obj_template_t * last_keys_obj
last_keys object saved from rpc/output for return last keys
Definition: getbulk.h:105
getbulk_cb_t_::start_indent
int32 start_indent
the requested indent for the list target instances <verbatim> <rpc-reply> <bulk> <data> <foo> <– star...
Definition: getbulk.h:93
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
NCX_BT_LIST
@ NCX_BT_LIST
internal, YANG list
Definition: ncxtypes.h:228
xml_val.h
Utility functions for creating value structs.
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
val_util.h
Value Node Utilities.
getbulk_new_cb
getbulk_cb_t * getbulk_new_cb(void)
Create a new getbulk control block.
Definition: getbulk.c:97
getbulk_cb_t_::list_test_val
val_value_t * list_test_val
list_test filter for list-target
Definition: getbulk.h:99
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_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
val_child.h
Value Node Child Access Support.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
getbulk_check_get2
status_t getbulk_check_get2(getbulk_cb_t *bulk, obj_template_t *obj, uint32 *max_entries, val_value_t **last_entry)
Check the GET2 object against the getbulk request to see if it needs to be processed as get-bulk or n...
Definition: getbulk.c:151
getbulk_cb_t_::ret_count
uint32 ret_count
number of list entries returned
Definition: getbulk.h:77
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
getbulk_create_last_keys_get2
status_t getbulk_create_last_keys_get2(getbulk_cb_t *bulk, dlq_hdr_t *keyQ)
Create the <last-keys> container and clone the keys from the lastval; For GET2 callback.
Definition: getbulk.c:280
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
getbulk_cb_t_::last_entry
val_value_t * last_entry
last_entry based on target object; moves key leafs from last_keys into this value for checking in the...
Definition: getbulk.h:111
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
getbulk_cb_t_::ret_last_keys
val_value_t * ret_last_keys
last_keys anyxml w/ last keys to return to client
Definition: getbulk.h:114
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.
getbulk_cb_t_::fixed_keys
val_value_t * fixed_keys
fixed_keys anydata w/ any fixed keys from client request
Definition: getbulk.h:102
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.
getbulk_cb_t_::target_obj
struct obj_template_t_ * target_obj
back-ptr to the target object template
Definition: getbulk.h:68
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
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)
getbulk_with_get2
boolean getbulk_with_get2(getbulk_cb_t *bulk, obj_template_t *obj)
Check the GET2 object against the getbulk request to see if it needs to be processed as get-bulk or n...
Definition: getbulk.c:188
dlq.h
dlq provides general double-linked list and queue support:
getbulk.h
yumaworks-getbulk.yang data structure support
obj_template_t_
One YANG data-def-stmt.
Definition: obj.h:1056
val_get_first_index
val_index_t * val_get_first_index(const val_value_t *val)
Get the first index entry, if any for this value node.
Definition: val.c:10685