smi_node(3)
smi_node(3) β SMI type information routines π
okay bestie, welcome to smi_node(3) from the SMI Management Information Library β yes the whole family of routines is in this one page, and yes they're all about getting info on nodes. it's giving family reunion but make it C. π
β¨ NAME β¨
smiGetNode, smiGetNodeByOID, smiGetFirstNode, smiGetNextNode, smiGetParentNode, smiGetRelatedNode, smiGetFirstChildNode, smiGetNextChildNode, smiGetNodeModule, smiGetNodeType, smiGetNodeLine, smiGetFirstElement, smiGetNextElement, smiGetElementNode, smiGetFirstOption, smiGetNextOption, smiGetOptionNode, smiGetFirstRefinement, smiGetNextRefinement, smiGetRefinementModule, smiGetRefinementNode, smiGetRefinementType, smiGetRefinementWriteType β SMI type information routines πΈ
π SYNOPSIS π
#include <smi.h>
SmiNode *smiGetNode(SmiModule *smiModulePtr, char *node);
SmiNode *smiGetNodeByOID(unsigned int oidlen, SmiSubid oid[]);
SmiNode *smiGetFirstNode(SmiModule *smiModulePtr, SmiNodekind kinds);
SmiNode *smiGetNextNode(SmiNode *smiNodePtr, SmiNodekind kinds);
SmiNode *smiGetParentNode(SmiNode *smiNodePtr);
SmiNode *smiGetRelatedNode(SmiNode *smiNodePtr);
SmiNode *smiGetFirstChildNode(SmiNode *smiNodePtr);
SmiNode *smiGetNextChildNode(SmiNode *smiNodePtr);
SmiModule *smiGetNodeModule(SmiNode *smiNodePtr);
SmiType *smiGetNodeType(SmiNode *smiNodePtr);
int smiGetNodeLine(SmiNode *smiNodePtr);
SmiElement *smiGetFirstElement(SmiNode *smiNodePtr);
SmiElement *smiGetNextElement(SmiElement *smiElementPtr);
SmiNode *smiGetElementNode(SmiElement *smiElementPtr);
SmiOption *smiGetFirstOption(SmiNode *smiComplianceNodePtr);
SmiOption *smiGetNextOption(SmiOption *smiOptionPtr);
SmiNode *smiGetOptionNode(SmiOption *smiOptionPtr);
SmiRefinement *smiGetFirstRefinement(SmiNode *smiComplianceNodePtr);
SmiRefinement *smiGetNextRefinement(SmiRefinement *smiRefinementPtr);
SmiNode *smiGetRefinementNode(SmiRefinement *smiRefinementPtr);
SmiType *smiGetRefinementType(SmiRefinement *smiRefinementPtr);
SmiType *smiGetRefinementWriteType(SmiRefinement *smiRefinementPtr);
typedef struct SmiNode {
SmiIdentifier name;
int oidlen;
SmiSubid *oid; /* array of length oidlen */
SmiDecl decl;
SmiAccess access;
SmiStatus status;
char *format;
SmiValue value;
char *units;
char *description;
char *reference;
SmiIndexkind indexkind;
int implied;
int create;
SmiNodekind nodekind;
} SmiNode;
typedef struct SmiElement {
/* no visible attributes */
} SmiElement;
typedef struct SmiOption {
char *description;
} SmiOption;
typedef struct SmiRefinement {
SmiAccess access;
char *description;
} SmiRefinement;
π DESCRIPTION π
so these functions pull info on any SMI node definition in the object identifier tree, okay? that means all the 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, plus the node, scalar, table, row, column, notification, group, and compliance statements in SMIng. that's the whole roster bestie, no crumbs left. π¦
smiGetNode() hands you a struct SmiNode that represents a node of any kind. node can be a fully qualified descriptor, a simple node name, or a numerical OID. and listen β nodes are also found if node contains an instance identifier suffix. if smiModulePtr is not NULL it's used to limit the search to the given module. and if the node isn't found? smiGetNode() returns NULL. π
smiGetNodeByOID() hands you a struct SmiNode that matches the longest prefix of the node specified by the object identifier oid[] with the length oidlen. if no such node is not found, smiGetNodeByOID() returns NULL. β¨
smiGetFirstNode() and smiGetNextNode() are your iterative duo for retrieving struct SmiNodes in tree pre-order. smiGetFirstNode() returns the first node defined in the module specified by smiModulePtr that is of any kind specified in the kinds bitset. subsequent calls to smiGetNextNode() return the next node of any kind specified in the kinds bitset. and if there are no more node definitions in the module, NULL is returned. that's the end of the line, no cap. π«Ά
smiGetFirstChildNode() and smiGetNextChildNode() are the iterative duo for retrieving struct SmiNodes that represent the immediate child nodes of the node specified by smiNodePtr passed to the smiGetFirstChildNode() call. it's giving family tree, direct line only. πΈ
smiGetParentNode() is used to retrieve a struct SmiNodes that represents the parent node of the node specified by smiNodePtr. look at you, going up the tree, main character energy. π
smiGetRelatedNode() is used to retrieve a struct SmiNodes that is related to the node specified by smiNodePtr. actually, this is used for SMIv2 table augmentation entries and similar SMIng constructs. iykyk. π₯
smiGetNodeModule() returns the module that defines the node given by struct SmiNodePtr.
smiGetNodeType() returns the type of the (scalar or columnar) node given by struct SmiNodePtr. but if struct SmiNodePtr does not specify a scalar or columnar node, NULL is returned. vibe check failed, moving on. π
smiGetFirstElement() and smiGetNextElement() are the iterative duo for retrieving struct SmiElements that represent elements of index clauses or notification object lists, groups of object types or notification types, and mandatory groups of module compliance statements. the node to which the list belongs has to be specified by smiNodePtr. and to retrieve the node that is represented by a struct SmiElement, the smiGetElementNode() function has to be called. π
smiGetFirstOption() and smiGetNextOption() are the iterative duo for retrieving struct SmiOptions that represent statements on optional (object or notification) groups within the compliance statement specified by smiComplianceNodePtr. the group node which is subject of such a statement can be retrieved by the smiGetOptionNode() function. π
similarly, smiGetFirstRefinement() and smiGetNextRefinement() are the iterative duo for retrieving struct SmiRefinements that represent statements on optional object refinements within the compliance statement specified by smiComplianceNodePtr. the node which is subject of such a refinement can be retrieved by the smiGetRefinementNode() function. the optional refined type and write-type of a refinement can be retrieved by the smiGetRefinementType() and smiGetRefinementWriteType() functions. and if they are not present, NULL is returned. no type, no write-type, just vibes. π
smiGetNodeLine() returns the line number within the module where the node specified by smiNodePtr is defined. yes bestie, it snitches on exactly where it lives. π
π FILES π
${prefix}/include/smi.hβ SMI library header file
π SEE ALSO π
libsmi(3), smi_config(3), smi_type(3), smi_module(3), smi.h
π AUTHOR π
(C) 1999-2004 Frank Strauss, TU Braunschweig, Germany
<strauss@ibr.cs.tu-bs.de>
and that's the whole page bestie, slay. it's from the IBR, dated March 30, 2004, and the manual name is smi_node(3) β periodt. πβ¨π¦
π¦ 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