SNMP Manager Programmer's Guide

Programming Examples
SNMP Manager Programmer’s Guide134249
2-39
Guardian and OSS Differences
3 (linkUp)
4 (authenticationFailure)
5 (egpNeighborLoss)
6 (enterpriseSpecific)
generic-trap-string
is a pointer to one of the generic trap strings described above.
str_to_type()
The str_to_type() function converts a string depicting an SNMP type into its
corresponding Manager Services representation.
rcode
is an integer indicating the outcome of the call. A value of -1 indicates failure.
type-string
is a pointer to one of the following strings; the corresponding Manager Services
representation of each string is shown in parentheses:
INTEGER (VT_NUMBER)
OCTET_STRING (VT_STRING)
DisplayString (VT_STRING)
OBJECT_IDENTIFIER (VT_OBJECT)
NULL (VT_EMPTY)
IpAddress (VT_IPADDRESS)
Counter (VT_COUNTER)
Gauge (VT_GAUGE)
TimeTicks (VT_TIMETICKS)
Opaque (VT_OPAQUE)
Guardian and OSS Differences
Only a few changes needed to be made to the sample files and some Manager Services
library files so that they could be used in Guardian and OSS environments:
Two typedefs appear in the OSS source files to ensure successful C compilation:
typedef unsigned long u_long;
typedef unsigned short u_short;
include "printh"
rcode = str_to_type(type-string);
int
str_to_type(char *type-string);