1smi_node(3) SMI Management Information Library smi_node(3)
2
3
4
6 smiGetNode, smiGetNodeByOID, smiGetFirstNode, smiGetNextNode, smiGet‐
7 ParentNode, smiGetRelatedNode, smiGetFirstChildNode, smiGet‐
8 NextChildNode, smiGetNodeModule, smiGetNodeType, smiGetNodeLine,
9 smiGetFirstElement, smiGetNextElement, smiGetElementNode, smiGet‐
10 FirstOption, smiGetNextOption, smiGetOptionNode, smiGetFirstRefinement,
11 smiGetNextRefinement, smiGetRefinementModule, smiGetRefinementNode,
12 smiGetRefinementType, smiGetRefinementWriteType - SMI type information
13 routines
14
16 #include <smi.h>
17
18 SmiNode *smiGetNode(SmiModule *smiModulePtr, char *node);
19
20 SmiNode *smiGetNodeByOID(unsigned int oidlen, SmiSubid oid[]);
21
22 SmiNode *smiGetFirstNode(SmiModule *smiModulePtr, SmiNodekind kinds);
23
24 SmiNode *smiGetNextNode(SmiNode *smiNodePtr, SmiNodekind kinds);
25
26 SmiNode *smiGetParentNode(SmiNode *smiNodePtr);
27
28 SmiNode *smiGetRelatedNode(SmiNode *smiNodePtr);
29
30 SmiNode *smiGetFirstChildNode(SmiNode *smiNodePtr);
31
32 SmiNode *smiGetNextChildNode(SmiNode *smiNodePtr);
33
34 SmiModule *smiGetNodeModule(SmiNode *smiNodePtr);
35
36 SmiType *smiGetNodeType(SmiNode *smiNodePtr);
37
38 int smiGetNodeLine(SmiNode *smiNodePtr);
39
40 SmiElement *smiGetFirstElement(SmiNode *smiNodePtr);
41
42 SmiElement *smiGetNextElement(SmiElement *smiElementPtr);
43
44 SmiNode *smiGetElementNode(SmiElement *smiElementPtr);
45
46 SmiOption *smiGetFirstOption(SmiNode *smiComplianceNodePtr);
47
48 SmiOption *smiGetNextOption(SmiOption *smiOptionPtr);
49
50 SmiNode *smiGetOptionNode(SmiOption *smiOptionPtr);
51
52 SmiRefinement *smiGetFirstRefinement(SmiNode *smiComplianceNodePtr);
53
54 SmiRefinement *smiGetNextRefinement(SmiRefinement *smiRefinementPtr);
55
56 SmiNode *smiGetRefinementNode(SmiRefinement *smiRefinementPtr);
57
58 SmiType *smiGetRefinementType(SmiRefinement *smiRefinementPtr);
59
60 SmiType *smiGetRefinementWriteType(SmiRefinement *smiRefinementPtr);
61
62 typedef struct SmiNode {
63 SmiIdentifier name;
64 int oidlen;
65 SmiSubid *oid; /* array of length oidlen */
66 SmiDecl decl;
67 SmiAccess access;
68 SmiStatus status;
69 char *format;
70 SmiValue value;
71 char *units;
72 char *description;
73 char *reference;
74 SmiIndexkind indexkind;
75 int implied;
76 int create;
77 SmiNodekind nodekind;
78 } SmiNode;
79
80 typedef struct SmiElement {
81 /* no visible attributes */
82 } SmiElement;
83
84 typedef struct SmiOption {
85 char *description;
86 } SmiOption;
87
88 typedef struct SmiRefinement {
89 SmiAccess access;
90 char *description;
91 } SmiRefinement;
92
93
95 These functions retrieve information on any SMI node definition in the
96 object identifier tree, these are ASN.1 object identifier assignments,
97 MODULE-IDENTITYs, OBJECT-IDENTITYs, OBJECT-TYPEs, NOTIFICATION-TYPEs,
98 TRAP-TYPEs, OBJECT-GROUPs, NOTIFICATION-GROUPs, MODULE-COMPLIANCEs, and
99 AGENT-CAPABILITYs in SMIv1/v2 and node, scalar, table, row, column,
100 notification, group, and compliance statements in SMIng.
101
102 The smiGetNode() function retrieves a struct SmiNode that represents a
103 node of any kind. Node may be either a fully qualified descriptor, a
104 simple node name, or a numerical OID. Nodes are also found, if node
105 contains an instance identifier suffix. If smiModulePtr is not NULL it
106 used to limit the search to the given module. If the node is not found,
107 smiGetNode() returns NULL.
108
109 The smiGetNodeByOID() function retrieves a struct SmiNode that matches
110 the longest prefix of the node that is specified by the object identi‐
111 fier oid[] with the length oidlen. If no such node is not found,
112 smiGetNodeByOID() returns NULL.
113
114 The smiGetFirstNode() and smiGetNextNode() functions are used to itera‐
115 tively retrieve struct SmiNodes in tree pre-order. smiGetFirstNode()
116 returns the first node defined in the module specified by smiModulePtr
117 that is of any kind specified in the kinds bitset. Subsequent calls to
118 smiGetNextNode() return the next node of any kind specified in the
119 kinds bitset. If there are no more node definitions in the module, NULL
120 is returned.
121
122 The smiGetFirstChildNode() and smiGetNextChildNode() functions are used
123 to iteratively retrieve struct SmiNodes that represent the immediate
124 child nodes of the node specified by smiNodePtr passed to the smiGet‐
125 FirstChildNode() call.
126
127 The smiGetParentNode() function is used to retrieve a struct SmiNodes
128 that represents the parent node of the node specified by smiNodePtr.
129
130 The smiGetRelatedNode() function is used to retrieve a struct SmiNodes
131 that is related to the node specified by smiNodePtr. Actually, this is
132 used for SMIv2 table augmentation entries and similar SMIng constructs.
133
134 The smiGetNodeModule() function returns the module that defines the
135 node given by struct SmiNodePtr.
136
137 The smiGetNodeType() function returns the type of the (scalar or colum‐
138 nar) node given by struct SmiNodePtr. If struct SmiNodePtr does not
139 specify a scalar or columnar node, NULL is returned.
140
141 The smiGetFirstElement() and smiGetNextElement() functions are used to
142 iteratively retrieve struct SmiElements that represent elements of
143 index clauses or notification object lists, groups of object types or
144 notification types, and mandatory groups of module compliance state‐
145 ments. The node to which the list belongs has to be specified by smiN‐
146 odePtr. To retrieve the node that is represented by a struct SmiEle‐
147 ment, the smiGetElementNode() function has to be called.
148
149 The smiGetFirstOption() and smiGetNextOption() functions are used to
150 iteratively retrieve struct SmiOptions that represent statements on
151 optional (object or notification) groups within the compliance state‐
152 ment specified by smiComplianceNodePtr. The group node which is subject
153 of such a statement can be retrieved by the smiGetOptionNode() func‐
154 tion.
155
156 Similarly, the smiGetFirstRefinement() and smiGetNextRefinement() func‐
157 tions are used to iteratively retrieve struct SmiRefinements that rep‐
158 resent statements on optional object refinements within the compliance
159 statement specified by smiComplianceNodePtr. The node which is subject
160 of such a refinement can be retrieved by the smiGetRefinementNode()
161 function. The optional refined type and write-type of a refinement can
162 be retrieved by the smiGetRefinementType() and smiGetRefinementWrite‐
163 Type() functions. If they are not present, NULL is returned.
164
165 The smiGetNodeLine() function returns the line number within the module
166 where the node specified by smiNodePtr is defined.
167
169 /usr/include/smi.h SMI library header file
170
172 libsmi(3), smi_config(3), smi_type(3), smi_module(3), smi.h
173
175 (C) 1999-2004 Frank Strauss, TU Braunschweig, Germany
176 <strauss@ibr.cs.tu-bs.de>
177
178
179
180IBR March 30, 2004 smi_node(3)