smux_util(3snmp)


smux_util -- SMUX library utilities

Synopsis

#include <snmp/snmp.h>
#include <snmp/objects.h>

int dump_object(OT ot, int i);

Description

This routine prints out all of the relevant information pertaining to an object. The following is a partial list of this information (examples in parentheses): the symbolic name (sysDescr), relation to its parent (system.1), numeric representation (1.3.6.1.2.1.1.1), associated syntax (DisplayString), access rights for the object (read-only(1)), and status of the object (obsolete(0)).

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_int *ip, u_char *addr, int len, int islen);
This routine stores the length of an address (optionally) and its contents in an OID. The ip argument is the 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_VarBind *v, int number);
The routine o_integer associates the value (ObjectSyntax) of an INTEGER, Gauge, or Counter type object with its name.
   int o_ipaddr(OI oi, struct  ype_SNMP_VarBind *v, caddr_t value);
The routine o_ipaddr associates the value (ObjectSyntax) of an IpAddress type object with its name.
   int o_longword(OI oi, struct type_SNMP_VarBind *v, int number);
This routine associates the value (ObjectSyntax) of a Gauge, INTEGER, or Counter type object with its name.
   int o_number(OI oi, struct type_SNMP_VarBind *v, caddr_t number);
The o_number routine associates the value (ObjectSyntax) of a TimeTicks type object with its name.
   int o_specific(OI oi, struct type_SNMP_VarBind *v, caddr_t value);
This routine associates the value of an OBJECT IDENTIFIER type object with its name.
   int o_string(OI oi, struct type_SNMP_VarBind *v, char *base, int len);
The o_string routine associates the value of a DisplayString, OctetString or ClnpAddress type object with its name.
   char *octet2str(OctetString *os);
The 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.
   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.
   char *oid2ode(OID oid);
This routine takes an OID as an argument and returns a printable string in symbolic form (sysObjectID) or symbolic and numeric combination form (system.2).
   OctetString *os_cpy(OctetString *orig);
The os_cpy routine allocates and returns a copy of the orig OctetString supplied as its argument.
   char *sprintoid(OID oid);
The 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.
   OI text2inst(char *text);
This 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.
   OT text2obj(char *text);
This 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).
   OID text2oid(char *name);
This 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).
   OS text2syn(char *name);
The routine text2syn takes a syntax name and returns the structure associated with it.
   #include <snmp/snmp.h>
   

struct smuxEntry *getsmuxEntrybyidentity(OID identity);

struct smuxEntry *getsmuxEntrybyname(char *name);

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.
   #include <sys/types.h>
   #include <sys/time.h>
   #include <poll.h>
   

int xselect(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, int secs);

xselect simulates the select(3C) routine.

References

octetstring(3snmp), oid(3snmp), smux_api(3snmp), snmpd.peers(4snmp)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004