File: smi_type.3.in

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 (130 lines) | stat: -rw-r--r-- 4,380 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
.\"
.\" $Id: smi_type.3.in,v 1.1 1999/06/01 20:47:19 strauss Exp $
.\"
.TH smi_type 3  "June 1, 1999" "IBR" "SMI Management Information Library"
.SH NAME
smiGetType, smiGetFirstType, smiGetNextType, smiFreeType \- SMI type
information routines
.SH SYNOPSIS
.nf
.B #include <smi.h>
.RS
.RE
.sp
.BI "SmiType *smiGetType(char *" module ", char *" type );
.RE
.sp
.BI "SmiType *smiGetFirstType(char *" module );
.RE
.sp
.BI "SmiType *smiGetNextType(SmiType *" smiTypePtr );
.RE
.sp
.BI "void smiFreeType(SmiType *" smiTypePtr );
.RE
.sp
.BI "SmiRange *smiGetFirstRange(char *" module ", char *" type );
.RE
.sp
.BI "SmiRange *smiGetNextRange(SmiRange *" smiRangePtr );
.RE
.sp
.BI "void smiFreeRange(SmiRange *" smiRangePtr );
.RE
.sp
.BI "SmiNamedNumber *smiGetFirstNamedNumber(char *" module ", char *" type );
.RE
.sp
.BI "SmiNamedNumber *smiGetNextNamedNumber(SmiNamedNumber *" smiNamedNumberPtr );
.RE
.sp
.BI "void smiFreeNamedNumber(SmiNamedNumber *" smiNamedNumberPtr );
.RE

typedef struct SmiType {
    SmiIdentifier module;
    SmiIdentifier name;
    SmiBasetype   basetype;
    SmiIdentifier parentmodule;
    SmiIdentifier parentname;
    SmiDecl       decl;
    char          *format;
    SmiValue      *valuePtr; /* default value */
    char          *units;
    SmiStatus     status;
    char          *description;
    char          *reference;
} SmiType;

typedef struct SmiRange {
    SmiIdentifier       module;
    SmiIdentifier       type;
    SmiValue            *minValuePtr;
    SmiValue            *maxValuePtr;
} SmiRange;

typedef struct SmiNamedNumber {
    SmiIdentifier       module;
    SmiIdentifier       type;
    SmiIdentifier       name;
    SmiValue            *valuePtr;
} SmiNamedNumber;

.fi
.SH DESCRIPTION
These functions retrieve information on a type definition (SMIng) or
a simple ASN.1 type definition (SMIv1/v2) or a TEXTUAL-CONVENTION
definition (SMIv2). Base types may also be retrieved, their
\fBmodule\fP element is an empty string.
.PP
The \fBsmiGetType()\fP function retrieves a \fBstruct SmiType\fP that
represents a type or textual convention. Either \fItype\fP must be the
fully qualified identifier leaving \fImodule\fP NULL, or the name is
split into the module \fImodule\fP and identifier \fItype\fP.  Elements
not available or not present in the definition contain NULL. See \fBsmi.h\fP
for the structure of contained elements.
.PP
The \fBsmiGetFirstType()\fP and \fBsmiGetNextType()\fP functions are
used to iteratively retrieve \fBstruct SmiType\fPs.
\fBsmiGetFirstType()\fP returns the first type or textual convention
defined in module \fImodule\fP.  Subsequent calls to
\fBsmiGetNextType()\fP release \fIsmiTypePtr\fP and
return the type or textual convention defined after that one.  If there are no
more type or textual convention definitions in the module NULL is returned.
.PP
Similarly, the \fBsmiGetFirstRange()\fP and \fBsmiGetNextRange()\fP
functions are used to iteratively retrieve \fBstruct SmiRange\fPs
that represent the size ranges of an octet string type or the value
ranges of a numeric type specified by \fImodule\fP and \fItype\fP.
.PP
Similarly, the \fBsmiGetFirstNamedNumber()\fP and \fBsmiGetNextNamedNumber()\fP
functions are used to iteratively retrieve \fBstruct SmiNamedNumber\fPs
that represent the named numbers of a bit set or enumeration type
specified by \fImodule\fP and \fItype\fP.
.PP
The \fBsmiFreeType()\fP function should be called when a retrieved
\fBstruct SmiType\fP is no longer needed to release its memory.
.PP
Similarly, the \fBsmiFreeRange()\fP function should be called when a retrieved
\fBstruct SmiRange\fP is no longer needed to release its memory.
.PP
Similarly, the \fBsmiFreeNamedNumber()\fP function should be called when a
retrieved \fBstruct SmiNamedNumber\fP is no longer needed to release
its memory.
.SH "RETURN VALUES"
The retrieval functions return the
requested \fBstruct smiType\fP, \fBstruct smiRange\fP, 
or \fBstruct smiNamedNumber\fP, respectively,
on success, or NULL on error. Structures should be released after use
by calling \fBsmiFreeType()\fP, \fBsmiFreeRange()\fP,
or \fBsmiFreeNamedNumber()\fP, respectively, which are a void functions.
.SH "FILES"
.nf
@prefix@/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