smi_node(3)
π NAME π
okay bestie, welcome to smi_node(3) from the SMI Management Information Library β this is the page for the SMI type information routines. The whole squad is: 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 β¨
here's the exact prototype block, no cap β copy it character for character π
#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 *smiGetFirstAlias(SmiNode *smiNodePtr);
SmiNode *smiGetNextAlias(SmiNode *smiNodePtr);
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 πΈ
okay so these functions are your little info goblins for any SMI node definition in the object identifier tree. We're talking 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 node, scalar, table, row, column, notification, group, and compliance statements in SMIng. iconic. π
smiGetNode()β retrieves astruct SmiNodethat represents a node of any kind.nodemay be either a fully qualified descriptor, a simple node name, or a numerical OID. Nodes are also found ifnodecontains an instance identifier suffix. IfsmiModulePtris notNULL, it's used to limit the search to the given module. If the node is not found,smiGetNode()returnsNULL.smiGetNodeByOID()β retrieves astruct SmiNodethat matches the longest prefix of the node specified by the object identifieroid[]with the lengthoidlen. If no such node is found,smiGetNodeByOID()returnsNULL.smiGetFirstNode()andsmiGetNextNode()β used to iteratively retrievestruct SmiNodes in tree pre-order.smiGetFirstNode()returns the first node defined in the module specified bysmiModulePtrthat is of any kind specified in thekindsbitset. Subsequent calls tosmiGetNextNode()return the next node of any kind specified in thekindsbitset. If there are no more node definitions in the module,NULLis returned.smiGetFirstAlias()andsmiGetNextAlias()β used to iteratively retrievestruct SmiNodes that have the same object identifier as thesmiNodePtrgiven as an argument. There is always one alias node, which is thesmiNodePtritself.smiGetFirstChildNode()andsmiGetNextChildNode()β used to iteratively retrievestruct SmiNodes that represent the immediate child nodes of the node specified bysmiNodePtrpassed to thesmiGetFirstChildNode()call.smiGetParentNode()β used to retrieve astruct SmiNodethat represents the parent node of the node specified bysmiNodePtr.smiGetRelatedNode()β used to retrieve astruct SmiNodethat is related to the node specified bysmiNodePtr. Actually, this is used for SMIv2 table augmentation entries and similar SMIng constructs.smiGetNodeModule()β returns the module that defines the node given bystruct SmiNodePtr.smiGetNodeType()β returns the type of the (scalar or columnar) node given bystruct SmiNodePtr. Ifstruct SmiNodePtrdoes not specify a scalar or columnar node,NULLis returned.smiGetFirstElement()andsmiGetNextElement()β used to iteratively retrievestruct 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 bysmiNodePtr. To retrieve the node that is represented by astruct SmiElement, thesmiGetElementNode()function has to be called.smiGetFirstOption()andsmiGetNextOption()β used to iteratively retrievestruct SmiOptions that represent statements on optional (object or notification) groups within the compliance statement specified bysmiComplianceNodePtr. The group node which is subject of such a statement can be retrieved by thesmiGetOptionNode()function.smiGetFirstRefinement()andsmiGetNextRefinement()β similarly, used to iteratively retrievestruct SmiRefinements that represent statements on optional object refinements within the compliance statement specified bysmiComplianceNodePtr. The node which is subject of such a refinement can be retrieved by thesmiGetRefinementNode()function. The optional refined type and write-type of a refinement can be retrieved by thesmiGetRefinementType()andsmiGetRefinementWriteType()functions. If they are not present,NULLis returned.smiGetNodeLine()β returns the line number within the module where the node specified bysmiNodePtris defined.
π FILES π
${prefix}/include/smi.hβ SMI library header file
π¦ SEE ALSO π¦
libsmi(3), smi_config(3), smi_type(3), smi_module(3), smi.h β go read these next, bestie, iykyk π
π AUTHOR π
(C) 1999-2004 Frank Strauss, TU Braunschweig, Germany<strauss@ibr.cs.tu-bs.de>
mwah π β this page is from IBR, dated March 30, 2004, and it's the smi_node(3) manual page. bye bestie! π
π¦ where this page comes from
- alpine 3.24: libsmi-doc 0.5.0-r5 Β· BSD-3-Clause AND MIT
- nixos 26.05: libsmi 0.5.0
- nixpkgs unstable: libsmi 0.5.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms