NAME
uptime_string, myaddress, mib_TxtToOid, mib_OidToTxt - Useful functions

SYNOPSIS
cc [ flag ... ] file ... -lsnmp [ library ... ]

#include <sys/types.h>
#include <snmp/snmp.h>

char *uptime_string(unsigned int timeticks, char * buf);

unsigned int myaddress(void);

int mib_TxtToOid(char * Buf, oid ** OidP, int * LenP);

int mib_OidToTxt(oid * O, int OLen, char *Buf, int BufLen);

DESCRIPTION
uptime_string() converts the value of timeticks into a readable string. This function assumes that timeticks is of SMI type TimeTicks (Centi-seconds).

myaddress() returns the IP address of the current active interface.

mib_TxtToOid and mib_OidToTxt convert between ASN oids and textual strings (IE: ".1.3.6").

mib_TxtToOid allocates space for the ASN oid, and this space must later be free()'d.

mib_OidToTxt starts filling the specified buffer (of length BufLen) until it runs out of space, or finishes.

RETURN VALUE
uptime_string() returns the filled buffer.

myaddress() returns the IP address, or 0.

mib_TxtToOid() and mib_OidToTxt() return 1 upon success, 0 otherwise.