yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
ypgnmi.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#if defined(WITH_GNMI) && defined(WITH_RESTCONF) && defined(WITH_YCONTROL)
13
14#ifndef _H_ypgnmi
15#define _H_ypgnmi
16
17/* FILE: ypgnmi.h
18*********************************************************************
19* *
20* P U R P O S E *
21* *
22*********************************************************************/
23
29/*********************************************************************
30* *
31* C H A N G E H I S T O R Y *
32* *
33*********************************************************************
34
35date init comment
36----------------------------------------------------------------------
3726-JUNE-18 am Begun
38*/
39
40#include <xmlstring.h>
41
42#ifndef _H_status
43#include "status.h"
44#endif
45
46#ifndef _H_status_enum
47#include "status_enum.h"
48#endif
49
50#ifndef _H_ncxtypes
51#include "ncxtypes.h"
52#endif
53
54#ifndef _H_dlq
55#include "dlq.h"
56#endif
57
58#ifndef _H_val
59#include "val.h"
60#endif
61
62#ifndef _H_yangapi
63#include "yangapi.h"
64#endif
65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70
81/********************************************************************
82* *
83* T Y P E S *
84* *
85*********************************************************************/
86
88typedef struct ypgnmi_get_cb_t_ {
89
91 xmlChar *prefix_str;
92
94 xmlChar *path_str;
95
100
103
106
108
109
111typedef struct ypgnmi_edit_t_ {
112
113 /* queue header in case added to a queue */
114 dlq_hdr_t qhdr;
115
117 xmlChar *path_str;
118
122 xmlChar *input;
123
126
129
131 const xmlChar *error_details;
132
135
141
142
144typedef struct ypgnmi_edit_cb_t_ {
146 dlq_hdr_t editsQ;
147
149 xmlChar *prefix_str;
150
152
153
154/********************************************************************
155* *
156* F U N C T I O N S *
157* *
158*********************************************************************/
159
160
166extern ypgnmi_get_cb_t *
167 ypgnmi_new_gcb (void);
168
169
175extern void
177
178
185extern ypgnmi_edit_t *
187
188
195extern ypgnmi_edit_t *
197
198
207extern ypgnmi_edit_t *
208 ypgnmi_new_edit (xmlChar *path_str,
209 xmlChar *input,
210 op_editop_t editop);
211
212
218extern void
220
221
227extern ypgnmi_edit_cb_t *
228 ypgnmi_new_ecb (void);
229
230
236extern void
238
239
260extern void
262 const xmlChar *edit_id,
263 status_t res);
264
265
275extern boolean
277
278
282#ifdef __cplusplus
283} /* end extern 'C' */
284#endif
285
286#endif /* _H_ypgnmi */
287#endif // WITH_GNMI && WITH_RESTCONF && WITH_YCONTROL
dlq provides general double-linked list and queue support:
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
restconf_content_t
RESTCONF content query param enumeration.
Definition: yangapi.h:215
void ypgnmi_free_gcb(ypgnmi_get_cb_t *cb)
Clean and free a ypgnmi_get_cb_t control block.
Definition: ypgnmi.c:112
ypgnmi_edit_t * get_next_edit_entry(ypgnmi_edit_t *entry)
Get the next edit entry in the editsQ.
Definition: ypgnmi.c:168
ypgnmi_edit_cb_t * ypgnmi_new_ecb(void)
Create a new ypgnmi_edit_cb_t control block.
Definition: ypgnmi.c:270
void ypgnmi_free_edit(ypgnmi_edit_t *entry)
Free a yp-gnmi Edit entries.
Definition: ypgnmi.c:241
ypgnmi_edit_t * get_first_edit_entry(ypgnmi_edit_cb_t *cb)
Get the first edit entry in editsQ.
Definition: ypgnmi.c:141
void ypgnmi_set_edit_status(rpc_msg_t *msg, const xmlChar *edit_id, status_t res)
Set the error status to the gNMI edit.
Definition: ypgnmi.c:341
boolean ypgnmi_check_edits_status(ypgnmi_edit_cb_t *ecb)
Check if any of the requested edits failed.
Definition: ypgnmi.c:380
ypgnmi_get_cb_t * ypgnmi_new_gcb(void)
Create a new ypgnmi_get_cb_t control block.
Definition: ypgnmi.c:89
void ypgnmi_free_ecb(ypgnmi_edit_cb_t *cb)
Clean and free a ypgnmi_edit_cb_t control block.
Definition: ypgnmi.c:294
ypgnmi_edit_t * ypgnmi_new_edit(xmlChar *path_str, xmlChar *input, op_editop_t editop)
Create a new yp-gnmi Edit entriy.
Definition: ypgnmi.c:197
status_t
global error return code
Definition: status_enum.h:210
YANG module data structures Many internal representations of YANG module constructs.
Global error messages for status code enumerations.
global error status code enumerations
One YANG data-def-stmt.
Definition: obj.h:1209
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
one value to match one type
Definition: val.h:911
gNMI Edit Control Block
Definition: ypgnmi.h:144
dlq_hdr_t editsQ
edits: Q of ypgnmi_edit_t
Definition: ypgnmi.h:146
xmlChar * prefix_str
malloced! Specified Path for the get request
Definition: ypgnmi.h:149
Delete/Replace/Update edit requests Q.
Definition: ypgnmi.h:111
op_editop_t editop
edit request operation
Definition: ypgnmi.h:125
val_value_t * value
malloced! Specified Value for the Replace/Upodate requests NULL if the op is DELETE
Definition: ypgnmi.h:139
xmlChar * path_str
malloced! back-ptr Specified Path for the delete request
Definition: ypgnmi.h:117
status_t res
status of the edit
Definition: ypgnmi.h:128
const xmlChar * error_details
some specific error details of the edit
Definition: ypgnmi.h:131
obj_template_t * target_obj
backptr inside schema_tree to target object
Definition: ypgnmi.h:134
xmlChar * input
malloced! Specified Input for the Replace/Upodate requests NULL if the op is DELETE
Definition: ypgnmi.h:122
gNMI GET control block
Definition: ypgnmi.h:88
xmlChar * prefix_str
malloced! Specified Path for the get request
Definition: ypgnmi.h:91
xmlChar * path_str
malloced! back-ptr Specified Path for the get request
Definition: ypgnmi.h:94
val_value_t * request_target
backptr inside root_tree to the target value
Definition: ypgnmi.h:105
obj_template_t * target_obj
backptr inside schema_tree to the target object
Definition: ypgnmi.h:102
restconf_content_t content_enum
content parameter from RESTCONF ALL by default
Definition: ypgnmi.h:99
Value Node Basic Support.
YANG-API definitions (pre-RESTCONF)