yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
smioid_tree.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_SNMP) && defined(WITH_RESTCONF)
13#ifndef _H_smioid_tree
14#define _H_smioid_tree
15
16/* FILE: smioid_tree.h
17*********************************************************************
18* *
19* P U R P O S E *
20* *
21*********************************************************************/
22
28/*********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35---------------------------------------------------------------------
3619-sep-16 rmb Begun
37
38*/
39
40#ifndef _H_dict
41#include "dict.h"
42#endif
43
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49
50/********************************************************************
51* *
52* T Y P E S *
53* *
54*********************************************************************/
55
66typedef struct smioid_node_t_ {
67 const obj_oid_t *oid;
69 struct smioid_node_t_ *next;
71
72
73
74/********************************************************************
75* *
76* F U N C T I O N S *
77* *
78*********************************************************************/
79
88extern boolean
89 smioid_extract_integers (const xmlChar *oid,
90 obj_oid_t *oid_obj);
91
92
98extern obj_oid_t *
100
101
107extern void
109
110
120extern obj_oid_t *
122 uint32 oid_len,
123 uint32 start_pos);
124
125
132extern status_t
133 smioid_tree_init (void);
134
135
140extern void
141 smioid_tree_cleanup (void);
142
143
150extern void
152 obj_oid_t *oid_obj);
153
154
161extern boolean
163
164
171extern obj_template_t *
172 smioid_tree_find (obj_oid_t *oid_obj);
173
174
181extern status_t
182 smioid_tree_dump(void);
183
184
193extern obj_oid_t *
195 boolean *found);
196
197
207extern obj_template_t *
209 boolean *ignored_index);
210
211
218extern obj_oid_t *
220
221
227extern void
228 smioid_dump_oid_string (const obj_oid_t *oid_obj);
229
230
236extern void
238
239
249extern obj_oid_t *
251 uint32 oid_len1,
252 oid_t *name2,
253 uint32 oid_len2);
254
255
262extern obj_oid_t *
264
265
271extern obj_oid_t *
273
274
280extern hb_tree *
281 smioid_tree_get (void);
282
283
287#ifdef __cplusplus
288} /* end extern 'C' */
289#endif
290
291#endif /* _H_smioid_tree */
292#endif // defined(WITH_SNMP) && defined(WITH_RESTCONF)
status_t
global error return code
Definition: status_enum.h:210
obj_oid_t * smioid_concat_object_oid(oid_t *name1, uint32 oid_len1, oid_t *name2, uint32 oid_len2)
Concatenate 2 OIDs into one OID.
Definition: smioid_tree.c:888
boolean smioid_extract_integers(const xmlChar *oid, obj_oid_t *oid_obj)
Split SMI oid string into integers using '.
Definition: smioid_tree.c:207
status_t smioid_tree_init(void)
initialize the tree used for managing the SMI OID and the associated obj_template_t reference
Definition: smioid_tree.c:379
obj_oid_t * smioid_new_scalar_object_oid(void)
Malloc a scalar index OID: '.0'.
Definition: smioid_tree.c:981
status_t smioid_tree_dump(void)
Traverses the SMI OID tree and prints the OID string and info on the obj_template_t instance.
Definition: smioid_tree.c:565
hb_tree * smioid_tree_get(void)
Get the SMI OID tree.
Definition: smioid_tree.c:1015
obj_oid_t * smioid_tree_getnext_oid(obj_oid_t *oid_obj, boolean *found)
Returns the next or closest OID for the specified oid as per the lexicographical order.
Definition: smioid_tree.c:643
boolean smioid_tree_remove(obj_template_t *obj)
Remove a entity from the specified tree.
Definition: smioid_tree.c:487
void smioid_dump_oid_string_obj(obj_template_t *obj)
Logs the given obj_template->oid object as a string.
Definition: smioid_tree.c:860
void smioid_dump_oid_string(const obj_oid_t *oid_obj)
Logs the given oid object as a string.
Definition: smioid_tree.c:818
obj_template_t * smioid_tree_find(obj_oid_t *oid_obj)
Find a object template node from the specified SMI OID string.
Definition: smioid_tree.c:537
void smioid_tree_insert(obj_template_t *obj, obj_oid_t *oid_obj)
Add a list entry to the oid tree.
Definition: smioid_tree.c:425
obj_template_t * smioid_tree_getnext_oid_obj(obj_oid_t *oid_obj, boolean *ignored_index)
Returns the next or closest oid's object template for the specified oid as per the lexicographical or...
Definition: smioid_tree.c:719
void smioid_free_object_oid(obj_oid_t *oid)
Clean and free a malloced get2 control block.
Definition: smioid_tree.c:356
obj_oid_t * smioid_tree_find_oid(obj_template_t *obj)
Find the OID value of the corresponding OBJ template.
Definition: smioid_tree.c:775
void smioid_tree_cleanup(void)
Clean and free the oid tree.
Definition: smioid_tree.c:399
obj_oid_t * smioid_new_object_oid(void)
Malloc and init a new obj_oid_t control block.
Definition: smioid_tree.c:286
obj_oid_t * smioid_dup_object_oid(obj_oid_t *copyfrom)
Duplicate OID.
Definition: smioid_tree.c:941
obj_oid_t * smioid_new_object_oid_ex(oid_t *name, uint32 oid_len, uint32 start_pos)
Malloc and init a new obj_oid_t control block.
Definition: smioid_tree.c:315
unsigned long oid_t
data type used in SNMP
Definition: obj.h:1187
defines the snmp oid value, stored as an array of integers for easier comparision when performing AVL...
Definition: obj.h:1195
One YANG data-def-stmt.
Definition: obj.h:1209
represents a pair of OID and associated object instance
Definition: smioid_tree.h:66
struct smioid_node_t_ * next
SMI get-next OID.
Definition: smioid_tree.h:69
obj_template_t * obj
object for entry
Definition: smioid_tree.h:68
const obj_oid_t * oid
OID for obj.
Definition: smioid_tree.h:67