File: smi_node.3

package info (click to toggle)
libsmi 0.1.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 10,364 kB
  • ctags: 2,173
  • sloc: ansic: 10,484; sh: 7,338; yacc: 6,150; lex: 1,524; makefile: 162
file content (219 lines) | stat: -rw-r--r-- 8,206 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
.\"
.\" $Id: smi_node.3.in,v 1.3 1999/06/16 15:04:16 strauss Exp $
.\"
.TH smi_node 3  "June 16, 1999" "IBR" "SMI Management Information Library"
.SH NAME
smiGetNode, smiGetFirstNode, smiGetNextNode, smiFreeNode \- SMI type
information routines
.SH SYNOPSIS
.nf
.B #include <smi.h>
.RS
.RE
.sp
.BI "SmiNode *smiGetNode(char *" module ", char *" name );
.RE
.sp
.BI "SmiNode *smiGetNodeByOID(unsigned int" oidlen ", Subid" oid[] );
.RE
.sp
.BI "SmiNode *smiGetFirstNode(char *" module ", SmiNodekind " kinds );
.RE
.sp
.BI "SmiNode *smiGetNextNode(SmiNode *" smiNodePtr ", SmiNodekind " kinds );
.RE
.sp
.BI "SmiNode *smiGetParentNode(SmiNode *" smiNodePtr );
.RE
.sp
.BI "SmiNode *smiGetFirstChildNode(SmiNode *" smiNodePtr );
.RE
.sp
.BI "SmiNode *smiGetNextChildNode(SmiNode *" smiNodePtr );
.RE
.sp
.BI "SmiNode *smiGetFirstIndexNode(SmiNode *" smiRowNodePtr );
.RE
.sp
.BI "SmiNode *smiGetNextIndexNode(SmiNode *" smiRowNodePtr ", SmiNode *" smiIndexNodePtr );
.RE
.sp
.BI "SmiNode *smiGetFirstMemberNode(SmiNode *" smiGroupNodePtr );
.RE
.sp
.BI "SmiNode *smiGetNextMemberNode(SmiNode *" smiGroupNodePtr ", SmiNode *" smiMemberNodePtr );
.RE
.sp
.BI "SmiNode *smiGetFirstObjectNode(SmiNode *" smiNotificationNodePtr );
.RE
.sp
.BI "SmiNode *smiGetNextObjectNode(SmiNode *" smiNotificationNodePtr ", SmiNode *" smiObjectNodePtr );
.RE
.sp
.BI "SmiNode *smiGetFirstMandatoryNode(SmiNode *" smiComplianceNodePtr );
.RE
.sp
.BI "SmiNode *smiGetNextMandatoryNode(SmiNode *" smiComplianceNodePtr ", SmiNode *" smiMandatoryNodePtr );
.RE
.sp
.BI "void smiFreeNode(SmiNode *" smiNodePtr );
.RE
.sp
.BI "SmiOption *smiGetFirstOption(SmiNode *" smiComplianceNodePtr );
.RE
.sp
.BI "SmiOption *smiGetNextOption(SmiNode *" smiComplianceNodePtr ", SmiOption *" smiOptionPtr );
.RE
.sp
.BI "void smiFreeOption(SmiOption *" smiOptionPtr );
.RE
.sp
.BI "SmiRefinement *smiGetFirstRefinement(SmiNode *" smiComplianceNodePtr );
.RE
.sp
.BI "SmiRefinement *smiGetNextRefinement(SmiNode *" smiComplianceNodePtr ", SmiRefinement *" smiRefinementPtr );
.RE
.sp
.BI "void smiFreeRefinement(SmiRefinement *" smiRefinementPtr );
.RE

typedef struct SmiNode {
    SmiIdentifier       module;
    SmiIdentifier       name;
    SmiObjectIdentifier oid;        /* dotted string */
    SmiIdentifier       typename;
    SmiIdentifier       typemodule;
    SmiIndexkind        indexkind;    
    int                 implied;    /* implied index length? */
    int                 create;     /* creatable table rows? */
    SmiIdentifier       relatedmodule;
    SmiIdentifier       relatedname;
    SmiDecl             decl;
    SmiBasetype         basetype;
    SmiAccess           access;
    SmiStatus           status;
    char                *format;
    SmiValue            *valuePtr;
    char                *units;
    char                *description;
    char                *reference;
} SmiNode;

typedef struct SmiOption {
    SmiIdentifier       module;
    SmiIdentifier       name;
    SmiIdentifier       compliancemodule;
    SmiIdentifier       compliancename;
    char                *description;
} SmiOption;
 
typedef struct SmiRefinement {
    SmiIdentifier       module;
    SmiIdentifier       name;
    SmiIdentifier       compliancemodule;
    SmiIdentifier       compliancename;
    SmiIdentifier       typemodule;
    SmiIdentifier       typename;
    SmiIdentifier       writetypemodule;
    SmiIdentifier       writetypename;
    SmiAccess           access;
    char                *description;
} SmiRefinement;


.fi
.SH DESCRIPTION
These functions retrieve information on any node definition in the
object identifier tree, these are ASN.1 object identifier assignments,
MODULE-IDENTITYs, OBJECT-IDENTITYs, OBJECT-TYPEs, NOTIFICATION-TYPEs,
TRAP-TYPEs, OBJECT-GROUPs, NOTIFICATION-GROUPs, MODULE-COMPLIANCEs,
and AGENT-CAPABILITYs in SMIv1/v2 and module, node, scalar, table,
row, column, notification, group, and compliance statements in SMIng.
.PP
The \fBsmiGetNode()\fP function retrieves a \fBstruct SmiNode\fP that
represents a node of any kind. Either \fIname\fP must be the fully
qualified identifier leaving \fImodule\fP NULL, or the name is split into
the module \fImodule\fP and identifier \fIname\fP. The identifier part
may also be given as a numerical OID value. In this case the \fBSmiNode\fP
that matches the longest \fIname\fP prefix will be returned. Elements not
available or not present in the definition contain NULL. See
\fBsmi.h\fP for the structure of contained elements.
.PP
The \fBsmiGetNodeByOID()\fP function retrieves a \fBstruct SmiNode\fP that
matches the longest prefix of the node that is specified by the
object identifier \fIoid[]\fP with the length \fIoidlen\fP.
Elements not available or not present in the definition contain NULL. See
\fBsmi.h\fP for the structure of contained elements.
.PP
The \fBsmiGetFirstNode()\fP and \fBsmiGetNextNode()\fP functions are
used to iteratively retrieve \fBstruct SmiNode\fPs.
\fBsmiGetFirstNode()\fP returns the first node
defined in module \fImodule\fP
that is of any kind specified in the \fIkinds\fP bitset
with respect to an object identifier tree in
pre-order (thus not necessarily the first defined in the MIB module).
Subsequent calls to \fBsmiGetNextNode()\fP release \fIsmiNodePtr\fP and
return the next node of an appropriate kind out of \fIkinds\fP. If there are no
more node definitions in the module NULL is returned.
.PP
Similarly, the \fBsmiGetFirstChildNode()\fP and \fBsmiGetNextChildNode()\fP
functions are used to iteratively retrieve \fBstruct SmiNode\fPs that
represent the immediate child nodes of that one specified
by \fIsmiNodePtr\fP to the \fBsmiGetFirstChildNode()\fP call.
.PP
Similarly, the \fBsmiGetFirstIndexNode()\fP and \fBsmiGetNextIndexNode()\fP
functions are used to iteratively retrieve \fBstruct SmiNode\fPs that
represent the index nodes of the table row specified by \fIsmiRowNodePtr\fP.
.PP
Similarly, the \fBsmiGetFirstMemberNode()\fP and \fBsmiGetNextMemberNode()\fP
functions are used to iteratively retrieve \fBstruct SmiNode\fPs that
represent the member nodes of the (object or notification) group
specified by \fIsmiGroupNodePtr\fP.
.PP
Similarly, the \fBsmiGetFirstObjectNode()\fP and \fBsmiGetNextObjectNode()\fP
functions are used to iteratively retrieve \fBstruct SmiNode\fPs that
represent the object nodes of the notification
specified by \fIsmiNotificationNodePtr\fP.
.PP
Similarly, the \fBsmiGetFirstMandatoryNode()\fP
and \fBsmiGetNextMandatoryNode()\fP
functions are used to iteratively retrieve \fBstruct SmiNode\fPs that
represent the mandatory (object or notification) groups of the compliance
statement specified by \fIsmiComplianceNodePtr\fP.
.PP
Similarly, the \fBsmiGetFirstOption()\fP
and \fBsmiGetNextOption()\fP
functions are used to iteratively retrieve \fBstruct SmiOption\fPs that
represent the optional (object or notification) groups of the compliance
statement specified by \fIsmiComplianceNodePtr\fP.
.PP
Similarly, the \fBsmiGetFirstRefinement()\fP
and \fBsmiGetNextRefinement()\fP
functions are used to iteratively retrieve \fBstruct SmiRefinement\fPs that
represent the refined objects of the compliance
statement specified by \fIsmiComplianceNodePtr\fP.
.PP
The \fBsmiFreeNode()\fP function should be called when a retrieved
\fBstruct SmiNode\fP is no longer needed to release its memory.
.PP
Similarly, the \fBsmiFreeOption()\fP function should be called when a retrieved
\fBstruct SmiOption\fP is no longer needed to release its memory.
.PP
Similarly, the \fBsmiFreeRefinement()\fP function should be called when a
retrieved \fBstruct SmiRefinement\fP is no longer needed to release its memory.
.SH "RETURN VALUES"
The retrieval functions return the requested \fBstruct smiNode\fP,
\fBstruct smiOption\fP, or \fBstruct smiRefinement\fP,
on success, or NULL on error. Structures should be released after use
by calling \fBsmiFreeNode()\fP, \fBsmiFreeOption()\fP,
or \fBsmiFreeRefinement()\fP, respectively, which are a void functions.
.SH "FILES"
.nf
/usr/local/include/smi.h    SMI library header file
.fi
.SH "SEE ALSO"
.BR libsmi "(3), "
.BR smi.h
.SH "AUTHOR"
(C) 1999 Frank Strauss, TU Braunschweig, Germany <strauss@ibr.cs.tu-bs.de>
.br