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 after isClassScalar() has returned 0. 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 πŸ’–πŸ¦‹πŸŽ€