smi_render(3)

πŸ’… smi_render β€” the SMI data and MIB data rendering routines, bestie

okay so welcome to smi_render(3), part of the SMI Management Information Library ✨ this is the page where we make OIDs and MIB values look cute and readable instead of a raw pile of numbers, and honestly? iconic.


🌸 NAME 🌸

smiRenderOID, smiRenderValue, smiRenderNode, smiRenderType β€” the SMI data and MIB data rendering routines πŸŽ€


✨ 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);

like, four functions, one #include, zero drama πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

These functions can be used to render OIDs, values of MIB data, or names of MIB nodes or types. basically: they take the nerdy internal stuff and hand you back a string that a human can actually read. no cap.

The smiRenderOID() function 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. πŸ‘‘

The smiRenderValue() function 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. 🫢

The smiRenderNode() function renders the name of a node given by smiNodePtr. The flags can be used to control the resulting format, see FORMATS below. 🌈

The smiRenderType() function 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 logcially or-ed set of flags that can be used to control the format of the rendered items β€” so like, you stack the vibes you want and the function serves them up πŸ’…

  • SMI_RENDER_NUMERIC β€” Allow numeric representation (default). this is the fallback era and she's reliable fr fr.
  • SMI_RENDER_NAME β€” Allow a representation by name(s) if possible. names > numbers, obviously.
  • SMI_RENDER_QUALIFIED β€” In case of a name representation, force a module prefix, e.g. IF-MIB::ifIndex instead of just ifIndex. giving full government name energy πŸ‘‘
  • 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. glow-up for your values, periodt.
  • SMI_RENDER_PRINTABLE β€” In case of octet string value rendering, force a printable representation if all octets of the octet string are printable. only if all of them are printable, bestie, every single octet has to pass the vibe check.
  • 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. so like, instead of ghosting you it says "<unknown>" 🫢
  • SMI_RENDER_ALL β€” Apply a combination of all these flags. This supports the (hopefully) most human friendly representations. the full-glam combo ✨πŸ”₯

😭 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.

bestie listen: NULL here is not a personality trait, it's a rendering failure. unless you passed SMI_RENDER_UNKNOWN, in which case the only way to get NULL is running out of memory πŸ’€

πŸ’œ SEE ALSO πŸ’œ

libsmi(3), smi.h


🌟 AUTHOR 🌟

(C) 2002 Frank Strauss, TU Braunschweig, Germany <strauss@ibr.cs.tu-bs.de>


and that's the page, bestie πŸŽ€ brought to you by IBR, dated July 24, 2002 β€” yeah she's vintage but she still ate πŸ’…βœ¨