yumapro  25.10-1
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
91typedef boolean (*sid_dict_walk_cbfn_t) (ncx_sid_ns_t sid_ns,
92 const xmlChar *identifier,
93 boolean is_obsolete,
94 void *cookie);
95
96
97
98/********************************************************************
99* *
100* F U N C T I O N S *
101* *
102*********************************************************************/
103
104/* Group defined in obj.h */
105
106
123extern status_t
124 sid_dict_init (void);
125
126
132extern status_t
133 sid_dict_init_write (void);
134
135
136
141extern void
142 sid_dict_cleanup (void);
143
144
149extern void
151
152
161extern status_t
162 sid_dict_add_data (uint32 id,
163 obj_template_t *obj,
164 boolean internal);
165
166
174extern boolean
175 sid_dict_remove_data (uint32 id,
176 obj_template_t *obj);
177
178
188extern status_t
189 sid_dict_find_data (uint32 id,
190 ncx_sid_t sid,
191 obj_template_t **obj);
192
193
202extern status_t
203 sid_dict_add_module (uint32 id,
204 ncx_module_t *mod,
205 boolean internal);
206
207
215extern boolean
216 sid_dict_remove_module (uint32 id,
217 ncx_module_t *mod);
218
219
229extern status_t
230 sid_dict_find_module (uint32 id,
231 ncx_sid_t sid,
232 ncx_module_t **mod);
233
234
243extern status_t
244 sid_dict_add_identity (uint32 id,
245 ncx_identity_t *ident,
246 boolean internal);
247
248
256extern boolean
257 sid_dict_remove_identity (uint32 id,
258 ncx_identity_t *ident);
259
260
270extern status_t
271 sid_dict_find_identity (uint32 id,
272 ncx_sid_t sid,
273 ncx_identity_t **ident);
274
275
284extern status_t
285 sid_dict_add_feature (uint32 id,
286 ncx_feature_t *feat,
287 boolean internal);
288
289
297extern boolean
298 sid_dict_remove_feature (uint32 id,
299 ncx_feature_t *feat);
300
301
311extern status_t
312 sid_dict_find_feature (uint32 id,
313 ncx_sid_t sid,
314 ncx_feature_t **feat);
315
316
329extern status_t
331 uint32 *retcnt);
332
333
346extern status_t
348 void *cookie);
349
350
351
352
353
354
355
362extern void
363 sid_dict_dump (uint32 id);
364
365
366
371extern void
372 sid_dict_write_dump (void);
373
374
388extern void
390 xml_msg_hdr_t *mhdr,
391 obj_template_t *obj,
392 boolean external_only,
393 xmlns_id_t parent_nsid,
394 ncx_sid_t start_sid,
395 ncx_sid_t stop_sid,
396 int32 indent);
397
398
404extern ncx_sid_t
405 sid_dict_highest (void);
406
407
413extern uint32
414 sid_dict_count (void);
415
416
424extern status_t
425 sid_dict_new (uint32 *id);
426
427
433extern void
434 sid_dict_free (uint32 id);
435
436
440#ifdef __cplusplus
441} /* end extern 'C' */
442#endif
443
444#endif // WITH_YANG_CBOR
445#endif /* _H_sid_dict */
status_t
global error return code
Definition: status_enum.h:219
boolean sid_dict_remove_feature(uint32 id, ncx_feature_t *feat)
Remove a feature identity object from the SID item dict.
Definition: sid_dict.c:1379
status_t sid_dict_init(void)
Initialize the YANG SID dictionary.
Definition: sid_dict.c:741
void sid_dict_cleanup(void)
Cleanup the YANG SID dictionary.
Definition: sid_dict.c:794
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:1271
void sid_dict_write_dump(void)
Print the sorted dictionary contents WRITE TREE.
Definition: sid_dict.c:1795
status_t sid_dict_new(uint32 *id)
Allocate a new SID tree for a session.
Definition: sid_dict.c:2068
void sid_dict_cleanup_write(void)
Cleanup the YANG SID dictionary for writing a SID DICT file.
Definition: sid_dict.c:827
uint32 sid_dict_count(void)
Get the current count of SID numbers.
Definition: sid_dict.c:2050
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:851
boolean sid_dict_remove_module(uint32 id, ncx_module_t *mod)
Remove a module object from the SID item dict.
Definition: sid_dict.c:1071
boolean sid_dict_remove_data(uint32 id, obj_template_t *obj)
Remove a data object from the SID item dict.
Definition: sid_dict.c:915
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:1424
status_t sid_dict_init_write(void)
Initialize the YANG SID dictionary for writing a SID DICT file.
Definition: sid_dict.c:770
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:965
status_t sid_dict_add_module_write(ncx_module_t *mod, uint32 *retcnt)
Store all the entries for a module for writing.
Definition: sid_dict.c:1648
ncx_sid_t sid_dict_highest(void)
Get the highest SID number.
Definition: sid_dict.c:2035
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:1162
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:1315
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:1008
void sid_dict_free(uint32 id)
Free a SID tree previously allocated with sid_dict_new.
Definition: sid_dict.c:2105
boolean sid_dict_remove_identity(uint32 id, ncx_identity_t *ident)
Remove an identity object from the SID item dict.
Definition: sid_dict.c:1226
void sid_dict_dump(uint32 id)
Print the sorted dictionary contents.
Definition: sid_dict.c:1752
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:1982
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:1117
status_t sid_dict_walk_module_write(sid_dict_walk_cbfn_t cbfn, void *cookie)
Walk the SID WRITE tree to generate item entries.
Definition: sid_dict.c:1709
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_sid_ns_t
enumeration for YANG SID namespace identifiers
Definition: ncxtypes.h:1748
NETCONF Session Common definitions module.
boolean(* sid_dict_walk_cbfn_t)(ncx_sid_ns_t sid_ns, const xmlChar *identifier, boolean is_obsolete, void *cookie)
SIDGEN function callback.
Definition: sid_dict.h:91
YANG feature entry.
Definition: ncxtypes.h:1001
YANG identity entry.
Definition: ncxtypes.h:1084
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1118
One YANG data-def-stmt.
Definition: obj.h:1284
Session Control Block.
Definition: ses.h:759
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:417
XML and JSON Message send and receive support.