smi_attribute(3)
π smi_attribute(3) β the SMI Attribute info girlies π
okay so welcome to the smi_attribute page from the SMI Management Information Library β it's giving "everything you ever wanted to know about a SMIng Attribute" and honestly? iconic. bestie, grab a strawberry π and let's get into it.
β¨ NAME β¨
smiGetAttribute, smiGetFirstAttribute, smiGetNextAttribute, smiGetAttributeParentClass, smiGetAttributeParentType, smiGetFirstUniqueAttribute, smiGetNextUniqueAttribute, smiGetEvent, smiGetFirstEvent, smiGetNextEvent, smiGetAttributeFirstRange, smiGetAttributeNextRange, smiGetAttributeFirstNamedNumber, smiGetAttributeNextNamedNumber β SMI Attribute information routines π¦
πΈ SYNOPSIS πΈ
#include <smi.h>
SmiAttribute *smiGetAttribute(SmiClass *smiClassPtr, char *name);
SmiAttribute *smiGetFirstAttribute(SmiClass *smiClassPtr);
SmiAttribute *smiGetNextAttribute(SmiAttribute *smiAttributePtr);
SmiType *smiGetAttributeParentType(SmiType *smiAttributePtr);
SmiClass *smiGetAttributeParentClass(SmiType *smiAttributePtr);
SmiAttribute *smiGetFirstUniqueAttribute(SmiClass *smiClassPtr);
SmiAttribute *smiGetNextUniqueAttribute(SmiAttribute *smiAttributePtr);
SmiRange *smiGetAttributeFirstRange(SmiAttribute *smiAttributePtr);
SmiRange *smiGetAttributeNextRange(SmiRange *smiRangePtr);
SmiNamedNumber *smiGetAttributeFirstNamedNumber(SmiAttribute *smiAttributePtr);
SmiNamedNumber *smiGetAttributeNextNamedNumber(SmiNamedNumber *smiNamedNumberPtr);
typedef struct SmiAttribute {
SmiIdentifier name;
SmiDecl decl;
SmiStatus status;
char *description;
char *reference;
} SmiAttribute;
typedef struct SmiRange {
SmiValue minValue;
SmiValue maxValue;
} SmiRange;
typedef struct SmiNamedNumber {
SmiIdentifier name;
SmiValue value;
} SmiNamedNumber;
π DESCRIPTION π
These functions retrieve information on a SMIng Attribute definition (SMIng). periodt. that's the whole vibe, now let's go function by function π
smiGetAttribute(SmiClass *smiClassPtr, char *name) hands you a pointer to a struct SmiAttribute for the Attribute with the given name inside the given class (smiClassPtr). and if that attribute does NOT exist? you get NULL, no cap. π
smiGetFirstAttribute(SmiClass *smiClassPtr) and smiGetNextAttribute(SmiAttribute *smiAttributePtr) are your lil duo for iterating through the attributes of the class given by smiClassPtr. they return a pointer to struct SmiAttribute that represents an attribute β or NULL if there are no attributes left in the class, or an error has occurred. π
smiGetAttributeParentClass(SmiAttribute *smiAttributePtr) returns a pointer to a struct SmiClass, pointing to the parent class of the given smiAttributePtr, or NULL if the attribute does not reference class. note that attributes always have either parent type or parent class β like, it's one or the other, always, no in-between. π
smiGetAttributeParentType(SmiType *smiAttributePtr) returns a pointer to a struct SmiType, pointing to the parent type of the given smiAttributePtr, or NULL if the attribute does not reference type. and again, note that attributes always have either parent type or parent class. π¦
smiGetFirstUniqueAttribute(SmiClass *smiClassPtr) and smiGetNextUniqueAttribute(SmiType *smiAttributePtr) iterate through the unique attributes of the class given by smiClassPtr. they return a pointer to struct SmiAttribute that represents a unique attribute, or NULL if there are no unique attributes left in the class, or an error has occurred.
π¨ bestie, listen. This function MUST NOT be used for scalar classes, so it should only be called afterisClassScalar()has returned0. fr fr. do not skip the vibe check on this one. π«Ά
smiGetAttributeFirstRange(SmiAttribute *smiAttributePtr), and smiGetAttributeNextRange(SmiRange *smiRangePtr) iterate through ranges that restrict number or octet string types. both functions return a pointer to the struct SmiRange representing the range, or NULL if there are no more ranges, or an error has occurred. π₯
smiGetAttributeFirstNamedNumber(SmiAttribute *smiAttributePtr) and smiGetAttributeNextNamedNumber(SmiNamedNumber *smiNamedNumberPtr) iterate through named numbers of bits or enumerations for attributes, which reference types, and they also retrieve the reference restriction of a pointer. both functions return a pointer to the struct SmiNamedNumber representing the named number, or NULL if there are no named numbers left, or an error has occurred. and the plot twist: smiGetFirstNamedNumber() can be used to retrieve the name of the identity that is restricting Pointer type, as it is stored as the name of the first named number. ate. β¨
π FILES π
${prefix}/include/smi.hβ SMI library header file π
π SEE ALSO π
libsmi(3), smi_module(3), smi.h π
π AUTHOR π
(C) 2007 Kaloyan Kanev, Jacobs University, Germany <k.kanev@jacobs-university.de> π
and that's the whole page, bestie!! this lil masterpiece dropped on February 10, 2007 and it's still serving under the smi_attribute(3) banner. stay hydrated, go read your MIBs, and remember: attributes always have either parent type or parent class. iykyk. mwah ππ¦π
π¦ where this page comes from
- debian bookworm: libsmi2-dev 0.4.8+dfsg2-16
- debian trixie: libsmi2-dev 0.4.8+dfsg2-17+b1
- ubuntu jammy: libsmi2-dev 0.4.8+dfsg2-16
- ubuntu noble: libsmi2-dev 0.4.8+dfsg2-16.1build1
- ubuntu questing: libsmi2-dev 0.4.8+dfsg2-17
- ubuntu resolute: libsmi2-dev 0.4.8+dfsg2-18
- ubuntu stonking: libsmi2-dev 0.4.8+dfsg2-18
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms