home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.umcs.maine.edu
/
2015-02-07.ftp.umcs.maine.edu.tar
/
ftp.umcs.maine.edu
/
pub
/
thesis
/
zhongy
/
snmp
/
snmp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-10
|
3KB
|
66 lines
#define snmp_port 161
#define SMAXOBJID 32
#define SNMPMAXSZ 600
#define MAXMIBITEM 600
#define MAXSNMPNAME 100
struct oid { /* object identifier*/
int len; /*length of this object id*/
unsigned short id[SMAXOBJID]; /*array of sub-identifiers*/
};
/*structure that contains the value of an SNMP variable*/
struct snval {
int sv_type; /*variable type*/
union { /*value of var is one of these*/
int sv_int; /*variable is one of :integer */
/*counter,gauge,timeticks */
struct { /*value is a (oct) string */
char *sv_str; /*string's contents */
int sv_len; /*string's length */
} sv_str;
struct oid sv_oid; /*variable is an object id */
/* IPaddr sv_ipaddr; /*variable is an IP address */
} sv_val;
};
/*
Each snbentry node contains an SNMP binding in one of 2 forms:
ASN.1 encoded form or internal form.(The bindings list is doubly-linked)
*/
struct snbentry {
struct oid sb_oid; /*object id in internal form */
struct snval sb_val; /*value of the object */
unsigned char *sb_alstr; /*ASN.1 string containing the */
/*object id and its value */
int sb_alslen; /*length of the ASN.1 string */
char name[MAXSNMPNAME]; /*whole instance name */
/* struct snbentry *sb_next; /*next node in the bind list */
/* struct snbentry *sb_prev; /*previous node in the list */
};
/*
struct that holds a complete description of an snmp request
*/
struct req_desc {
char reqtype; /*request type */
char reqid[10]; /*request identifier */
int reqidlen; /*length of the identifier */
char err_stat; /*error status */
char err_idx; /*error index */
int err_stat_pos; /*position of error status in*/
/*the ASN.1 encoding */
int err_idx_pos; /*position of error index */
int pdutype_pos; /*position of pdu type */
struct snbentry bind; /*single bind list */
/* struct snbentry *bindlf; /*front of bindings list */
/* struct snbentry *bindle; /*end of bindings list */
};
struct snbentry mib[MAXMIBITEM];
int NUM_MIBITEM;