1smi_attribute(3) SMI Management Information Library smi_attribute(3)
2
3
4
6 smiGetAttribute, smiGetFirstAttribute, smiGetNextAttribute, smiGetAt‐
7 tributeParentClass, smiGetAttributeParentType, smiGetFirstUniqueAt‐
8 tribute, smiGetNextUniqueAttribute, smiGetEvent, smiGetFirstEvent,
9 smiGetNextEvent, smiGetAttributeFirstRange, smiGetAttributeNextRange,
10 smiGetAttributeFirstNamedNumber, smiGetAttributeNextNamedNumber - SMI
11 Attribute information routines
12
14 #include <smi.h>
15
16 SmiAttribute *smiGetAttribute(SmiClass *smiClassPtr, char *name);
17
18 SmiAttribute *smiGetFirstAttribute(SmiClass *smiClassPtr);
19
20 SmiAttribute *smiGetNextAttribute(SmiAttribute *smiAttributePtr);
21
22 SmiType *smiGetAttributeParentType(SmiType *smiAttributePtr);
23
24 SmiClass *smiGetAttributeParentClass(SmiType *smiAttributePtr);
25
26 SmiAttribute *smiGetFirstUniqueAttribute(SmiClass *smiClassPtr);
27
28 SmiAttribute *smiGetNextUniqueAttribute(SmiAttribute *smiAttributePtr);
29
30 SmiRange *smiGetAttributeFirstRange(SmiAttribute *smiAttributePtr);
31
32 SmiRange *smiGetAttributeNextRange(SmiRange *smiRangePtr);
33
34 SmiNamedNumber *smiGetAttributeFirstNamedNumber(SmiAttribute *smiAttributePtr);
35
36 SmiNamedNumber *smiGetAttributeNextNamedNumber(SmiNamedNumber *smiNamedNumberPtr);
37
38
39 typedef struct SmiAttribute {
40 SmiIdentifier name;
41 SmiDecl decl;
42 SmiStatus status;
43 char *description;
44 char *reference;
45 } SmiAttribute;
46
47 typedef struct SmiRange {
48 SmiValue minValue;
49 SmiValue maxValue;
50 } SmiRange;
51
52 typedef struct SmiNamedNumber {
53 SmiIdentifier name;
54 SmiValue value;
55 } SmiNamedNumber;
56
57
59 These functions retrieve information on a SMIng Attribute definition
60 (SMIng).
61
62 smiGetAttribute(SmiClass *smiClassPtr, char *name) returns a pointer to
63 struct SmiAttribute for the Attribute with the given name in the given
64 class(smiClassPtr), or NULL if the attribute with the given name does
65 not exist.
66
67 smiGetFirstAttribute(SmiClass *smiClassPtr) and smiGetNextAt‐
68 tribute(SmiAttribute *smiAttributePtr) are used to iterate through the
69 attributes of the class given by smiClassPtr. They return a pointer to
70 struct SmiAttribute that represents an attribute or NULL if there are
71 no attributes left in the class, or error has occurred.
72
73 smiGetAttributeParentClass(SmiAttribute *smiAttributePtr) returns a
74 pointer to a struct SmiClass, pointing to the parent class of the given
75 smiAttributePtr, or NULL if the attribute does not reference class.
76 Note that attributes always have either parent type or parent class.
77
78 smiGetAttributeParentType(SmiType *smiAttributePtr) returns a pointer
79 to a struct SmiType, pointing to the parent type of the given smiAt‐
80 tributePtr, or NULL if the attribute does not reference type. Note
81 that attributes always have either parent type or parent class.
82
83 smiGetFirstUniqueAttribute(SmiClass *smiClassPtr) and smiGetNextU‐
84 niqueAttribute(SmiType *smiAttributePtr) are used to iterate through
85 the unique attributes of the class given by smiClassPtr. They return a
86 pointer to struct SmiAttribute that represents a unique attribute or
87 NULL if there are no unique attributes left in the class, or error has
88 occurred. This function MUST NOT be used for scalar classes, so it
89 should only be called after isClassScalar() has returned 0.
90
91 smiGetAttributeFirstRange(SmiAttribute *smiAttributePtr), and smiGetAt‐
92 tributeNextRange(SmiRange *smiRangePtr) are used to iterate through
93 ranges that restrict number or octet string types. Both functions
94 return a pointer to the struct SmiRange representing the range, or NULL
95 if there are no more ranges, or error has occurred.
96
97 smiGetAttributeFirstNamedNumber(SmiAttribute *smiAttributePtr) and
98 smiGetAttributeNextNamedNumber(SmiNamedNumber *smiNamedNumberPtr) are
99 used to iterate through named numbers of bits or enumerations for
100 attributes, which reference types, and to retrieve the reference
101 restriction of a pointer. Both functions return a pointer to the
102 struct SmiNamedNumber representing the named number, or NULL if there
103 are no named numbers left, or error has occurred. smiGetFirstNamedNum‐
104 ber() can be used to retrieve the name of the identity that is
105 restricting Pointer type, as it is stored as the name of the first
106 named number.
107
109 /usr/include/smi.h SMI library header file
110
112 libsmi(3), smi_module(3), smi.h
113
115 (C) 2007 Kaloyan Kanev, Jacobs University, Germany <k.kanev@jacobs-uni‐
116 versity.de>
117
118
119
120 February 10, 2007 smi_attribute(3)