|
|
#include <snmp/snmp.h> #include <snmp/objects.h>int dump_object(OT ot, int i);
The arguments supplied to dump_object are the object type and the level of the object in the tree.
int dump_object_by_tree(OT ot, int i);This routine dumps the relevant information pertaining to all objects in a subtree by recursively calling itself and dump_object. This routine is invoked with two arguments: the object type of the subtree and the level of the subtree.
int dump_objects_by_tree();This routine dumps the relevant information of all the compiled objects in the trees rooted at ccitt (0) and iso (1).
OID inaddr2oid(unsigned long addr);This routine takes an Internet address (struct in_addr) as an argument and returns an OID representation of the address.
int mediaddr2oid(u_intThis routine stores the length of an address (optionally) and its contents in an OID. The ip argument is theip, u_char
addr, int len, int islen);
oid_elements
field of an OIDentifier structure. addr and
len are pointers to the address and its length, respectively.
islen specifies whether the length of the address needs to be
stored in the oid_elements
. mediaddr2oid returns the
number of elements stored.
OI name2inst(OID oid);This routine takes an OID as an argument and returns an OI with
oi_name
set to oid and
oi_type
set to the oid's object type.
OT name2obj(OID oid);This routine takes an OID as an argument and returns the object type associated with either the exact name or the prefix of the name.
OI next2inst(OID oid);This routine takes an OID and finds the closest object type before the variable name and returns an OI corresponding to that object type.
int o_integer(OI oi, struct type_SNMP_VarBindThe routine o_integer associates the value (ObjectSyntax) of an INTEGER, Gauge, or Counter type object with its name.v, int number);
int o_ipaddr(OI oi, struct ype_SNMP_VarBindThe routine o_ipaddr associates the value (ObjectSyntax) of an IpAddress type object with its name.v, caddr_t value);
int o_longword(OI oi, struct type_SNMP_VarBindThis routine associates the value (ObjectSyntax) of a Gauge, INTEGER, or Counter type object with its name.v, int number);
int o_number(OI oi, struct type_SNMP_VarBindThe o_number routine associates the value (ObjectSyntax) of a TimeTicks type object with its name.v, caddr_t number);
int o_specific(OI oi, struct type_SNMP_VarBindThis routine associates the value of an OBJECT IDENTIFIER type object with its name.v, caddr_t value);
int o_string(OI oi, struct type_SNMP_VarBindThe o_string routine associates the value of a DisplayString, OctetString or ClnpAddress type object with its name.v, char
base, int len);
charThe routine octet2str takes an OctetString as an argument and returns a NULL-terminated string suitable for printing. This is used primarily as a debugging aid. It returns a NULL on failure.octet2str(OctetString
os);
int oid_cmp(OID p, OID q);This routine is used to compare two OIDs. oid_cmp returns -1 if (p > q), 1 if (p > q), and 0 otherwise.
OID oid_cpy(OID q);This routine allocates and returns a copy of the OID supplied as its argument.
OID oid_extend(OID q, int howmuch);The oid_extend routine allocates a larger OID. The length of the new OID is equal to the length of the OID q plus howmuch. The elements in the q OID are copied into the new OID.
OID oid_normalize(OID q, int howmuch, int bigvalue);This routine invokes oid_extend with q and howmuch and then initializes the extra elements in the new OID to the value specified in bigvalue.
charThis routine takes an OID as an argument and returns a printable string in symbolic form (sysObjectID) or symbolic and numeric combination form (system.2).oid2ode(OID oid);
OctetStringThe os_cpy routine allocates and returns a copy of the orig OctetString supplied as its argument.os_cpy(OctetString
orig);
charThe routine sprintoid takes an OID as an argument and returns a printable string in numeric form (1.3.6.1.2.1.1.2). This is used primarily as a debugging aid.sprintoid(OID oid);
OI text2inst(charThis routine takes a string as an argument and returns an OI. This string can be in numeric form (1.3.6.1), symbolic form (internet), or a combination of numeric and symbolic forms (iso.3.6.1). text2inst calls text2oid to get the OID corresponding to text, and then calls name2obj to get the type associated with the OID.text);
OT text2obj(charThis routine takes a string as an argument and returns the object type associated with the exact name. This string can be in numeric form (1.3.6.1), symbolic form (internet), or a combination of numeric and symbolic forms (iso.3.6.1).text);
OID text2oid(charThis routine takes a string as an argument and returns the OID associated with the corresponding object. This string can be in numeric form (1.3.6.1), symbolic form (internet), or a combination of numeric and symbolic forms (iso.3.6.1).name);
OS text2syn(charThe routine text2syn takes a syntax name and returns the structure associated with it.name);
#include <snmp/snmp.h>The routines getsmuxEntrybyidentity and getsmuxEntrybyname search for an entry of a specific peer in the SNMP peers database /etc/snmpd.peers. The name argument passed to getsmuxEntrybyname is the name of the peer, and the identity passed to getsmuxEntrybyidentity is the OID of the peer.struct smuxEntry
getsmuxEntrybyidentity(OID identity);
struct smuxEntry
getsmuxEntrybyname(char
name);
#include <sys/types.h> #include <sys/time.h> #include <poll.h>xselect simulates the select(3C) routine.int xselect(int nfds, fd_set
rfds, fd_set
wfds, fd_set
efds, int secs);