/*
 * Definitions for the variables as defined in the MIB
 */
/***********************************************************
	Copyright 1988, 1989 by Carnegie Mellon University

                      All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of CMU not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/

struct	mib_system {
    char    sysDescr[32];   /* textual description */
    u_char  sysObjectID[16];/* OBJECT IDENTIFIER of system */
    u_char  ObjIDLen;	    /* length of sysObjectID */
    u_int32  sysUpTime;	    /* Uptime in 100/s of a second */    
};

struct mib_interface {
    int32    ifNumber;	    /* number of interfaces */
};

struct mib_ifEntry {
    int32    ifIndex;	    /* index of this interface	*/
    char    ifDescr[32];    /* english description of interface	*/
    int32    ifType;	    /* network type of device	*/
    int32    ifMtu;	    /* size of largest packet in bytes	*/
    u_int32  ifSpeed;	    /* bandwidth in bits/sec	*/
    u_char  ifPhysAddress[11];	/* interface's address */
    u_char  PhysAddrLen;    /* length of physAddr */
    int32    ifAdminStatus;  /* desired state of interface */
    int32    ifOperStatus;   /* current operational status */
    u_int32  ifLastChange;   /* value of sysUpTime when current state entered */
    u_int32  ifInOctets;	    /* number of octets received on interface */
    u_int32  ifInUcastPkts;  /* number of unicast packets delivered */
    u_int32  ifInNUcastPkts; /* number of broadcasts or multicasts */
    u_int32  ifInDiscards;   /* number of packets discarded with no error */
    u_int32  ifInErrors;	    /* number of packets containing errors */
    u_int32  ifInUnknownProtos;	/* number of packets with unknown protocol */
    u_int32  ifOutOctets;    /* number of octets transmitted */
    u_int32  ifOutUcastPkts; /* number of unicast packets sent */
    u_int32  ifOutNUcastPkts;/* number of broadcast or multicast pkts */
    u_int32  ifOutDiscards;  /* number of packets discarded with no error */
    u_int32  ifOutErrors;    /* number of pkts discarded with an error */
    u_int32  ifOutQLen;	    /* number of packets in output queue */
};

struct mib_atEntry {
    int32    atIfIndex;	    /* interface on which this entry maps */
    u_char  atPhysAddress[11]; /* physical address of destination */
    u_char  PhysAddressLen; /* length of atPhysAddress */
    u_int32  atNetAddress;   /* IP address of physical address */
};

struct mib_ip {
    int32    ipForwarding;   /* 1 if gateway, 2 if host */
    int32    ipDefaultTTL;   /* default TTL for pkts originating here */
    u_int32  ipInReceives;   /* no. of IP packets received from interfaces */
    u_int32  ipInHdrErrors;  /* number of pkts discarded due to header errors */
    u_int32  ipInAddrErrors; /* no. of pkts discarded due to bad address */
    u_int32  ipForwDatagrams;/* number pf pkts forwarded through this entity */
    u_int32  ipInUnknownProtos;/* no. of local-addressed pkts w/unknown proto */
    u_int32  ipInDiscards;   /* number of error-free packets discarded */
    u_int32  ipInDelivers;   /* number of datagrams delivered to upper level */
    u_int32  ipOutRequests;  /* number of IP datagrams originating locally */
    u_int32  ipOutDiscards;  /* number of error-free output IP pkts discarded */
    u_int32  ipOutNoRoutes;  /* number of IP pkts discarded due to no route */
    int32    ipReasmTimeout; /* seconds fragment is held awaiting reassembly */
    u_int32  ipReasmReqds;   /* no. of fragments needing reassembly (here) */
    u_int32  ipReasmOKs;	    /* number of fragments reassembled */
    u_int32  ipReasmFails;   /* number of failures in IP reassembly */
    u_int32  ipFragOKs;	    /* number of datagrams fragmented here */
    u_int32  ipFragFails;    /* no. pkts unable to be fragmented here */
    u_int32  ipFragCreates;  /* number of IP fragments created here */
};

struct mib_ipAddrEntry {
    u_int32  ipAdEntAddr;    /* IP address of this entry */
    int32    ipAdEntIfIndex; /* IF for this entry */
    u_int32  ipAdEntNetMask; /* subnet mask of this entry */
    int32    ipAdEntBcastAddr;/* read the MIB for this one */
};

struct mib_ipRouteEntry {
    u_int32  ipRouteDest;    /* destination IP addr for this route */
    int32    ipRouteIfIndex; /* index of local IF for this route */
    int32    ipRouteMetric1; /* Primary routing metric */
    int32    ipRouteMetric2; /* Alternate routing metric */
    int32    ipRouteMetric3; /* Alternate routing metric */
    int32    ipRouteMetric4; /* Alternate routing metric */
    u_int32  ipRouteNextHop; /* IP addr of next hop */
    int32    ipRouteType;    /* Type of this route */
    int32    ipRouteProto;   /* How this route was learned */
    int32    ipRouteAge;	    /* No. of seconds since updating this route */
};

struct mib_icmp {
    u_int32  icmpInMsgs;	    /* Total of ICMP msgs received */
    u_int32  icmpInErrors;   /* Total of ICMP msgs received with errors */
    u_int32  icmpInDestUnreachs;
    u_int32  icmpInTimeExcds;
    u_int32  icmpInParmProbs;
    u_int32  icmpInSrcQuenchs;
    u_int32  icmpInRedirects;
    u_int32  icmpInEchos;
    u_int32  icmpInEchoReps;
    u_int32  icmpInTimestamps;
    u_int32  icmpInTimestampReps;
    u_int32  icmpInAddrMasks;
    u_int32  icmpInAddrMaskReps;
    u_int32  icmpOutMsgs;
    u_int32  icmpOutErrors;
    u_int32  icmpOutDestUnreachs;
    u_int32  icmpOutTimeExcds;
    u_int32  icmpOutParmProbs;
    u_int32  icmpOutSrcQuenchs;
    u_int32  icmpOutRedirects;
    u_int32  icmpOutEchos;
    u_int32  icmpOutEchoReps;
    u_int32  icmpOutTimestamps;
    u_int32  icmpOutTimestampReps;
    u_int32  icmpOutAddrMasks;
    u_int32  icmpOutAddrMaskReps;
};

struct	mib_tcp {
    int32    tcpRtoAlgorithm;	/* retransmission timeout algorithm */
    int32    tcpRtoMin;		/* minimum retransmission timeout (mS) */
    int32    tcpRtoMax;		/* maximum retransmission timeout (mS) */ 
    int32    tcpMaxConn;		/* maximum tcp connections possible */
    u_int32  tcpActiveOpens;	/* number of SYN-SENT -> CLOSED transitions */
    u_int32  tcpPassiveOpens;	/* number of SYN-RCVD -> LISTEN transitions */
    u_int32  tcpAttemptFails;/*(SYN-SENT,SYN-RCVD)->CLOSED or SYN-RCVD->LISTEN*/
    u_int32  tcpEstabResets;	/* (ESTABLISHED,CLOSE-WAIT) -> CLOSED */
    u_int32  tcpCurrEstab;	/* number in ESTABLISHED or CLOSE-WAIT state */
    u_int32  tcpInSegs;		/* number of segments received */
    u_int32  tcpOutSegs;		/* number of segments sent */
    u_int32  tcpRetransSegs;	/* number of retransmitted segments */
};

struct mib_tcpConnEntry {
    int32    tcpConnState;	/* State of this connection */
    u_int32  tcpConnLocalAddress;/* local IP address for this connection */
    int32    tcpConnLocalPort;	/* local port for this connection */
    u_int32  tcpConnRemAddress;	/* remote IP address for this connection */
    int32    tcpConnRemPort;	/* remote port for this connection */
};

struct mib_udp {
    u_int32  udpInDatagrams; /* No. of UDP datagrams delivered to users */
    u_int32  udpNoPorts;	    /* No. of UDP datagrams to port with no listener */
    u_int32  udpInErrors;    /* No. of UDP datagrams unable to be delivered */
    u_int32  udpOutDatagrams;/* No. of UDP datagrams sent from this entity */
};

struct	mib_egp {
    u_int32  egpInMsgs;	/* No. of EGP msgs received without error */
    u_int32  egpInErrors;/* No. of EGP msgs received with error */
    u_int32  egpOutMsgs;	/* No. of EGP msgs sent */
    u_int32  egpOutErrors;/* No. of (outgoing) EGP msgs dropped due to error */
};

struct	mib_egpNeighEntry {
    int32    egpNeighState;  /* local EGP state with this entry's neighbor */
    u_int32  egpNeighAddr;   /* IP address of this entry's neighbor */
};

#define MIB 1, 3, 6, 1, 2, 1

#define MIB_IFTYPE_OTHER		    1
#define MIB_IFTYPE_REGULAR1822		    2
#define MIB_IFTYPE_HDH1822		    3
#define MIB_IFTYPE_DDNX25		    4
#define MIB_IFTYPE_RFC877X25		    5
#define MIB_IFTYPE_ETHERNETCSMACD	    6
#define MIB_IFTYPE_ISO88023CSMACD	    7
#define MIB_IFTYPE_ISO88024TOKENBUS	    8
#define MIB_IFTYPE_ISO88025TOKENRING	    9
#define MIB_IFTYPE_ISO88026MAN		    10
#define MIB_IFTYPE_STARLAN		    11
#define MIB_IFTYPE_PROTEON10MBIT	    12
#define MIB_IFTYPE_PROTEON80MBIT	    13
#define MIB_IFTYPE_HYPERCHANNEL		    14
#define MIB_IFTYPE_FDDI			    15
#define MIB_IFTYPE_LAPB			    16
#define MIB_IFTYPE_SDLC			    17
#define MIB_IFTYPE_T1CARRIER		    18
#define MIB_IFTYPE_CEPT			    19
#define MIB_IFTYPE_BASICISDN		    20
#define MIB_IFTYPE_PRIMARYISDN		    21
#define MIB_IFTYPE_PROPPOINTTOPOINTSERIAL   22

#define MIB_IFSTATUS_UP		1
#define MIB_IFSTATUS_DOWN	2
#define MIB_IFSTATUS_TESTING	3

#define MIB_FORWARD_GATEWAY	1
#define MIB_FORWARD_HOST	2

#define MIB_IPROUTETYPE_OTHER	1
#define MIB_IPROUTETYPE_INVALID	2
#define MIB_IPROUTETYPE_DIRECT	3
#define MIB_IPROUTETYPE_REMOTE	4

#define MIB_IPROUTEPROTO_OTHER	    1
#define MIB_IPROUTEPROTO_LOCAL	    2
#define MIB_IPROUTEPROTO_NETMGMT    3
#define MIB_IPROUTEPROTO_ICMP	    4
#define MIB_IPROUTEPROTO_EGP	    5
#define MIB_IPROUTEPROTO_GGP	    6
#define MIB_IPROUTEPROTO_HELLO	    7
#define MIB_IPROUTEPROTO_RIP	    8
#define MIB_IPROUTEPROTO_ISIS	    9
#define MIB_IPROUTEPROTO_ESIS	    10
#define MIB_IPROUTEPROTO_CISCOIGRP  11
#define MIB_IPROUTEPROTO_BBNSPFIGP  12
#define MIB_IPROUTEPROTO_OIGP	    13

#define MIB_TCPRTOALG_OTHER	1
#define MIB_TCPRTOALG_CONSTANT	2
#define MIB_TCPRTOALG_RSRE	3
#define MIB_TCPRTOALG_VANJ	4

#define MIB_TCPCONNSTATE_CLOSED		1
#define MIB_TCPCONNSTATE_LISTEN		2
#define MIB_TCPCONNSTATE_SYNSENT	3
#define MIB_TCPCONNSTATE_SYNRECEIVED	4
#define MIB_TCPCONNSTATE_ESTABLISHED	5
#define MIB_TCPCONNSTATE_FINWAIT1	6
#define MIB_TCPCONNSTATE_FINWAIT2	7
#define MIB_TCPCONNSTATE_CLOSEWAIT	8
#define MIB_TCPCONNSTATE_LASTACK	9
#define MIB_TCPCONNSTATE_CLOSING	10
#define MIB_TCPCONNSTATE_TIMEWAIT	11

#define MIB_EGPNEIGHSTATE_IDLE		1
#define MIB_EGPNEIGHSTATE_AQUISITION	2
#define MIB_EGPNEIGHSTATE_DOWN		3
#define MIB_EGPNEIGHSTATE_UP		4
#define MIB_EGPNEIGHSTATE_CEASE		5



