yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
sid_dict.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 - 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#ifndef _H_sid_dict
12#define _H_sid_dict
13
14#ifdef WITH_YANG_CBOR
15/* FILE: sid_dict.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
33/*********************************************************************
34* *
35* C H A N G E H I S T O R Y *
36* *
37*********************************************************************
38
39date init comment
40----------------------------------------------------------------------
4127-sep-15 abb Begun; start from ydump.c
42
43*/
44
45/*** assumes procdefs.h has been included ***/
46
47
48#ifndef _H_ses
49#include "ses.h"
50#endif
51
52#ifndef _H_xml_msg
53#include "xml_msg.h"
54#endif
55
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61
63#define SID_DICT_SERVER 1
64
65#define SID_DICT_FIRST 2
66
67
68/********************************************************************
69* *
70* T Y P E S *
71* *
72*********************************************************************/
73
74
75/********************************************************************
76* *
77* F U N C T I O N S *
78* *
79*********************************************************************/
80
81/* Group defined in obj.h */
82
83
100extern status_t
101 sid_dict_init (void);
102
103
108extern void
109 sid_dict_cleanup (void);
110
111
120extern status_t
121 sid_dict_add_data (uint32 id,
122 obj_template_t *obj,
123 boolean internal);
124
125
133extern bool
134 sid_dict_remove_data (uint32 id,
135 obj_template_t *obj);
136
137
147extern status_t
148 sid_dict_find_data (uint32 id,
149 ncx_sid_t sid,
150 obj_template_t **obj);
151
152
161extern status_t
162 sid_dict_add_module (uint32 id,
163 ncx_module_t *mod,
164 boolean internal);
165
166
174extern bool
175 sid_dict_remove_module (uint32 id,
176 ncx_module_t *mod);
177
178
188extern status_t
189 sid_dict_find_module (uint32 id,
190 ncx_sid_t sid,
191 ncx_module_t **mod);
192
193
202extern status_t
203 sid_dict_add_identity (uint32 id,
204 ncx_identity_t *ident,
205 boolean internal);
206
207
215extern bool
216 sid_dict_remove_identity (uint32 id,
217 ncx_identity_t *ident);
218
219
229extern status_t
230 sid_dict_find_identity (uint32 id,
231 ncx_sid_t sid,
232 ncx_identity_t **ident);
233
234
243extern status_t
244 sid_dict_add_feature (uint32 id,
245 ncx_feature_t *feat,
246 boolean internal);
247
248
256extern bool
257 sid_dict_remove_feature (uint32 id,
258 ncx_feature_t *feat);
259
260
270extern status_t
271 sid_dict_find_feature (uint32 id,
272 ncx_sid_t sid,
273 ncx_feature_t **feat);
274
275
282extern void
283 sid_dict_dump (uint32 id);
284
285
299extern void
301 xml_msg_hdr_t *mhdr,
302 obj_template_t *obj,
303 boolean external_only,
304 xmlns_id_t parent_nsid,
305 ncx_sid_t start_sid,
306 ncx_sid_t stop_sid,
307 int32 indent);
308
309
315extern ncx_sid_t
316 sid_dict_highest (void);
317
318
324extern uint32
325 sid_dict_count (void);
326
327
335extern status_t
336 sid_dict_new (uint32 *id);
337
338
344extern void
345 sid_dict_free (uint32 id);
346
347
351#ifdef __cplusplus
352} /* end extern 'C' */
353#endif
354
355#endif // WITH_YANG_CBOR
356#endif /* _H_sid_dict */
status_t
global error return code
Definition: status_enum.h:210
status_t sid_dict_init(void)
Initialize the YANG SID dictionary.
Definition: sid_dict.c:634
void sid_dict_cleanup(void)
Cleanup the YANG SID dictionary.
Definition: sid_dict.c:661
status_t sid_dict_find_identity(uint32 id, ncx_sid_t sid, ncx_identity_t **ident)
Find an identity item in the SID item dictionary.
Definition: sid_dict.c:1113
bool sid_dict_remove_module(uint32 id, ncx_module_t *mod)
Remove a module object from the SID item dict.
Definition: sid_dict.c:913
bool sid_dict_remove_data(uint32 id, obj_template_t *obj)
Remove a data object from the SID item dict.
Definition: sid_dict.c:757
status_t sid_dict_new(uint32 *id)
Allocate a new SID tree for a session.
Definition: sid_dict.c:1581
uint32 sid_dict_count(void)
Get the current count of SID numbers.
Definition: sid_dict.c:1563
status_t sid_dict_add_data(uint32 id, obj_template_t *obj, boolean internal)
Store a data item in the SID item dict.
Definition: sid_dict.c:693
bool sid_dict_remove_identity(uint32 id, ncx_identity_t *ident)
Remove an identity object from the SID item dict.
Definition: sid_dict.c:1068
status_t sid_dict_find_feature(uint32 id, ncx_sid_t sid, ncx_feature_t **feat)
Find a feature item in the SID item dictionary.
Definition: sid_dict.c:1266
bool sid_dict_remove_feature(uint32 id, ncx_feature_t *feat)
Remove a feature identity object from the SID item dict.
Definition: sid_dict.c:1221
status_t sid_dict_find_data(uint32 id, ncx_sid_t sid, obj_template_t **obj)
Find a data item in the SID item dictionary.
Definition: sid_dict.c:807
ncx_sid_t sid_dict_highest(void)
Get the highest SID number.
Definition: sid_dict.c:1548
status_t sid_dict_add_identity(uint32 id, ncx_identity_t *ident, boolean internal)
Store an identity item in the SID item dict.
Definition: sid_dict.c:1004
status_t sid_dict_add_feature(uint32 id, ncx_feature_t *feat, boolean internal)
Store a feature item in the SID item dict.
Definition: sid_dict.c:1157
status_t sid_dict_add_module(uint32 id, ncx_module_t *mod, boolean internal)
Store a module item in the SID item dict.
Definition: sid_dict.c:850
void sid_dict_free(uint32 id)
Free a SID tree previously allocated with sid_dict_new.
Definition: sid_dict.c:1618
void sid_dict_dump(uint32 id)
Print the sorted dictionary contents.
Definition: sid_dict.c:1304
void sid_dict_xml_wr(ses_cb_t *scb, xml_msg_hdr_t *mhdr, obj_template_t *obj, boolean external_only, xmlns_id_t parent_nsid, ncx_sid_t start_sid, ncx_sid_t stop_sid, int32 indent)
Print the sorted dictionary contents for the yumaworks-yang-cbor get-yang-sid-info RPC operation.
Definition: sid_dict.c:1495
status_t sid_dict_find_module(uint32 id, ncx_sid_t sid, ncx_module_t **mod)
Find a module item in the SID item dictionary.
Definition: sid_dict.c:959
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
uint32 ncx_sid_t
Standard YANG SID is a 63-bit integer defined as uint64.
Definition: ncxtypes.h:756
NETCONF Session Common definitions module.
YANG feature entry.
Definition: ncxtypes.h:1021
YANG identity entry.
Definition: ncxtypes.h:1104
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1229
Session Control Block.
Definition: ses.h:573
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
XML and JSON Message send and receive support.