SNMP_EXTRA(3)

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.

RFCS
Related RFCs: 1065, 1066, 1067
Related SNMPv2 RFCs: 1901, 1902, 1902, 1904, 1905, 1906, 1907, 1908, 1909

RELATED URLS
CMU Networking Group: http://www.net.cmu.edu/
CMU SNMP Home Page: http://www.net.cmu.edu/projects/snmp

SEE ALSO
snmp_api(3), snmp_api_errors(3), snmp_client(3), snmp_coexistance(3), snmp_error(3), snmp_extra(3), snmp_mib(3), snmp_mibii(3), snmp_mini_client(3), snmp_msg(3), snmp_packet_dump(3), snmp_pdu(3), snmp_sess_api(3), snmp_vars(3), snmp_version_info(3), snmp_oid(5) snmp(3)