yumapro  25.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
111typedef boolean (*sid_dict_walk_cbfn_t) (ncx_sid_t sid,
112 ncx_sid_ns_t sid_ns,
113 const xmlChar *identifier,
114 boolean is_obsolete,
115 uint8 sid_flags,
116 void *cookie);
117
118
119
120/********************************************************************
121* *
122* F U N C T I O N S *
123* *
124*********************************************************************/
125
126/* Group defined in obj.h */
127
128
145extern status_t
146 sid_dict_init (void);
147
148
154extern status_t
155 sid_dict_init_write (void);
156
157
158
163extern void
164 sid_dict_cleanup (void);
165
166
171extern void
173
174
183extern status_t
184 sid_dict_add_data (uint32 id,
185 obj_template_t *obj,
186 boolean internal);
187
188
196extern boolean
197 sid_dict_remove_data (uint32 id,
198 obj_template_t *obj);
199
200
210extern status_t
211 sid_dict_find_data (uint32 id,
212 ncx_sid_t sid,
213 obj_template_t **obj);
214
215
224extern status_t
225 sid_dict_add_module (uint32 id,
226 ncx_module_t *mod,
227 boolean internal);
228
229
237extern boolean
238 sid_dict_remove_module (uint32 id,
239 ncx_module_t *mod);
240
241
251extern status_t
252 sid_dict_find_module (uint32 id,
253 ncx_sid_t sid,
254 ncx_module_t **mod);
255
256
265extern status_t
266 sid_dict_add_identity (uint32 id,
267 ncx_identity_t *ident,
268 boolean internal);
269
270
278extern boolean
279 sid_dict_remove_identity (uint32 id,
280 ncx_identity_t *ident);
281
282
292extern status_t
293 sid_dict_find_identity (uint32 id,
294 ncx_sid_t sid,
295 ncx_identity_t **ident);
296
297
306extern status_t
307 sid_dict_add_feature (uint32 id,
308 ncx_feature_t *feat,
309 boolean internal);
310
311
319extern boolean
320 sid_dict_remove_feature (uint32 id,
321 ncx_feature_t *feat);
322
323
333extern status_t
334 sid_dict_find_feature (uint32 id,
335 ncx_sid_t sid,
336 ncx_feature_t **feat);
337
338
351extern status_t
353 uint32 *retcnt);
354
355
369extern status_t
371 void *cookie);
372
373
388extern status_t
389 sid_dict_walk_tree (uint32 id,
391 void *cookie);
392
393
400extern void
401 sid_dict_dump (uint32 id);
402
403
404
409extern void
410 sid_dict_write_dump (void);
411
412
426extern void
428 xml_msg_hdr_t *mhdr,
429 obj_template_t *obj,
430 boolean external_only,
431 xmlns_id_t parent_nsid,
432 ncx_sid_t start_sid,
433 ncx_sid_t stop_sid,
434 int32 indent);
435
436
442extern ncx_sid_t
443 sid_dict_highest (void);
444
445
451extern uint32
452 sid_dict_count (void);
453
454
462extern status_t
463 sid_dict_new (uint32 *id);
464
465
471extern void
472 sid_dict_free (uint32 id);
473
474
478#ifdef __cplusplus
479} /* end extern 'C' */
480#endif
481
482#endif // WITH_YANG_CBOR
483#endif /* _H_sid_dict */
status_t
global error return code
Definition: status_enum.h:219
status_t sid_dict_walk_tree(uint32 id, sid_dict_walk_cbfn_t cbfn, void *cookie)
Walk the specified tree to generate item entries.
Definition: sid_dict.c:1810
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:1405
status_t sid_dict_init(void)
Initialize the YANG SID dictionary.
Definition: sid_dict.c:767
void sid_dict_cleanup(void)
Cleanup the YANG SID dictionary.
Definition: sid_dict.c:820
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:1297
void sid_dict_write_dump(void)
Print the sorted dictionary contents WRITE TREE.
Definition: sid_dict.c:1881
status_t sid_dict_new(uint32 *id)
Allocate a new SID tree for a session.
Definition: sid_dict.c:2154
void sid_dict_cleanup_write(void)
Cleanup the YANG SID dictionary for writing a SID DICT file.
Definition: sid_dict.c:853
uint32 sid_dict_count(void)
Get the current count of SID numbers.
Definition: sid_dict.c:2136
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:877
boolean sid_dict_remove_module(uint32 id, ncx_module_t *mod)
Remove a module object from the SID item dict.
Definition: sid_dict.c:1097
boolean sid_dict_remove_data(uint32 id, obj_template_t *obj)
Remove a data object from the SID item dict.
Definition: sid_dict.c:941
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:1450
status_t sid_dict_init_write(void)
Initialize the YANG SID dictionary for writing a SID DICT file.
Definition: sid_dict.c:796
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:991
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:1674
ncx_sid_t sid_dict_highest(void)
Get the highest SID number.
Definition: sid_dict.c:2121
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:1188
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:1341
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:1034
void sid_dict_free(uint32 id)
Free a SID tree previously allocated with sid_dict_new.
Definition: sid_dict.c:2191
boolean sid_dict_remove_identity(uint32 id, ncx_identity_t *ident)
Remove an identity object from the SID item dict.
Definition: sid_dict.c:1252
void sid_dict_dump(uint32 id)
Print the sorted dictionary contents.
Definition: sid_dict.c:1838
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:2068
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:1143
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:1779
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:1821
NETCONF Session Common definitions module.
boolean(* sid_dict_walk_cbfn_t)(ncx_sid_t sid, ncx_sid_ns_t sid_ns, const xmlChar *identifier, boolean is_obsolete, uint8 sid_flags, void *cookie)
SIDGEN function callback.
Definition: sid_dict.h:111
YANG feature entry.
Definition: ncxtypes.h:1057
YANG identity entry.
Definition: ncxtypes.h:1143
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1180
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:476
XML and JSON Message send and receive support.