smi_render(3)
smi_render(3) π SMI Management Information Library π«Ά
π NAME π
smiRenderOID, smiRenderValue, smiRenderNode, smiRenderType β the SMI data and MIB data rendering routines. Theyβre your little string-making besties for OIDs, MIB values, node names, and type names. π
β¨ SYNOPSIS β¨
#include <smi.h>
char *smiRenderOID(unsigned int oidlen, SmiSubid *oid, int flags);
char *smiRenderValue(SmiValue *smiValuePtr, SmiType *smiTypePtr, int flags);
char *smiRenderNode(SmiNode *smiNodePtr, int flags);
char *smiRenderType(SmiType *smiTypePtr, int flags);
π¦ DESCRIPTION π¦
okay so these functions can be used to render OIDs, values of MIB data, or names of MIB nodes or types. Thatβs the whole main-character job: take the SMI thing, hand back a rendered thing. β¨
smiRenderOID()β renders an OID given by its lengthoidlenand its array of sub-identifiersoid*. Theflagscan be used to control the resulting format; see FORMATS below. π¦smiRenderValue()β renders a MIB data value given bysmiValuePtr. An underlying typesmiTypePtrmay be supplied to support a more human friendly rendering. Theflagscan be used to control the resulting format; see FORMATS below. πsmiRenderNode()β renders the name of a node given bysmiNodePtr. Theflagscan be used to control the resulting format; see FORMATS below. πΈsmiRenderType()β renders the name of a type given bysmiTypePtr. Theflagscan be used to control the resulting format; see FORMATS below. π
π FORMATS π
Each of these functions gets a last argument named flags. This is a logically or-ed set of flags that can be used to control the format of the rendered items:
SMI_RENDER_NUMERICβ allow numeric representation (default). π’SMI_RENDER_NAMEβ allow a representation by name(s) if possible. π·οΈSMI_RENDER_QUALIFIEDβ in case of a name representation, force a module prefix, e.g.IF-MIB::ifIndexinstead of justifIndex. πSMI_RENDER_FORMATβ in case ofsmiRenderValue(), force the application of a format specification (e.g. an SMIv2 DISPLAY-HINT) of an underlying type if thesmiTypePtrargument is notNULLand this type contains such a format specification. πSMI_RENDER_PRINTABLEβ in case of octet string value rendering, force a printable representation if all octets of the octet string are printable. π€SMI_RENDER_UNKNOWNβ force the return of a string containingSMI_LABEL_UNKNOWN("<unknown>"), if the rendering would fail. This way, the only condition whereNULLcan be returned is the lack of memory. πSMI_RENDER_ALLβ apply a combination of all these flags. This supports the (hopefully) most human friendly representations. π
π RETURN VALUE π
All of these functions return a string, if successful, or NULL in case of a rendering failure. See also the SMI_RENDER_UNKNOWN flag above. π«Ά
π SEE ALSO π
libsmi(3), smi.h β go peek, bestie. π
π AUTHOR π
(C) 2002 Frank Strauss, TU Braunschweig, Germany <strauss@ibr.cs.tu-bs.de>
footer credits, bestie: source/version IBR Β· date July 24, 2002 Β· page smi_render(3). thatβs the whole page β periodt. ππ
π¦ 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