/***************************************************************************/ /* Module: $Id: snmp.h,v 1.2 1999/05/07 04:15:27 maf Exp $ /* Description: /* Author: maf /* Notes: /***************************************************************************/ /* $Log: snmp.h,v $ Revision 1.2 1999/05/07 04:15:27 maf pr -e2 Revision 1.1 1997/02/23 18:05:11 maf Initial revision * Revision 2.3 1994/01/02 20:06:35 maf * *** empty log message *** * * Revision 2.3 1994/01/02 20:06:35 maf * *** empty log message *** * * Revision 2.2 1993/12/20 01:53:55 maf * snmp.c header * * Revision 2.1 1993/10/19 19:37:25 maf * kbconfig 1.7+ * * Revision 1.2 1993/08/30 16:39:14 maf * cleaned up status vars * added support for query option * * Revision 1.1 1993/08/29 01:43:30 maf * Initial revision * */ #ifndef SNMP_H #define SNMP_H #include "snmpcli.h" #define SNMP_PORT 161 /* use socket 161 for SNMP */ #define SNMP_READ_TIMEOUT 2 /* two seconds */ struct SNMPConnection { /* remote host snmp */ #ifdef WATTCP tcp_Socket *s; /* pointer to TCP socket */ #endif #ifdef SOCKET int sockfd; /* our udp socket */ #endif int validsocket; /* is the socket valid */ char *buffer; /* for snmp */ CliRequestType *req; /* SNMP request structure */ CliRequestType *reqr; /* SNMP reply structure */ u_long IP; /* ip address of remote device */ char *community; /* community */ char *hostname; /* host name as entered by user */ }; /* SNMP Error Codes */ /* if you define a new error code here, make sure to also added to snmperrno.c, or else using it could cause a crash. */ #define SNMPE_TOOBIG 0 /* snmp TooBig error */ #define SNMPE_NOSUCHNAME 1 /* snmpErrorNoSuchName */ #define SNMPE_BADVALUE 2 /* snmpErrorBadValue */ #define SNMPE_GENERIC 3 /* snmpErrorGeneric */ #define SNMPE_BADSOCK 10 /* couldn't open socket to remote host */ #define SNMPE_INET 11 /* can only handle AF_INET connections */ #define SNMPE_RES 12 /* couldn't resolv hostname */ #define SNMPE_CONNECT 13 /* couldn't connect to remote host */ #define SNMPE_MEMBUF 14 /* couldn't allocate memory for packet buf */ #define SNMPE_MEMREQUEST 15 /* coulnd't allocate memory for req struct */ #define SNMPE_MEMDECODE 16 /* couldn't allocate memory for decode stuct */ #define SNMPE_MEMSOCK 17 /* couldn't allocate memory for soc struct */ #define SNMPE_MEMHNAME 18 /* couldn't allocate memory for hostname */ #define SNMPE_MEMCOMMUNITY 19 /* couldn't allocate memory for community */ #define SNMPE_WRITE 20 /* error sending to network */ #define SNMPE_READ 21 /* error reading from network */ #define SNMPE_TIMEOUT 22 /* timeout reading from network */ #define SNMPE_ENCODE 23 /* error encoding packet */ #define SNMPE_DECODE 24 /* error decoding packet */ #endif /* SNMP_H */