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 length oidlen and its array of sub-identifiers oid*. The flags can be used to control the resulting format; see FORMATS below. πŸ¦‹
  • smiRenderValue() β€” renders a MIB data value given by smiValuePtr. An underlying type smiTypePtr may be supplied to support a more human friendly rendering. The flags can be used to control the resulting format; see FORMATS below. πŸ“
  • smiRenderNode() β€” renders the name of a node given by smiNodePtr. The flags can be used to control the resulting format; see FORMATS below. 🌸
  • smiRenderType() β€” renders the name of a type given by smiTypePtr. The flags can 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::ifIndex instead of just ifIndex. πŸ‘‘
  • SMI_RENDER_FORMAT β€” in case of smiRenderValue(), force the application of a format specification (e.g. an SMIv2 DISPLAY-HINT) of an underlying type if the smiTypePtr argument is not NULL and 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 containing SMI_LABEL_UNKNOWN ("<unknown>"), if the rendering would fail. This way, the only condition where NULL can 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