- #if !defined(AFX_MIB_H__48F4CDE8_5A8B_4B2C_8824_EE413883AD29__INCLUDED_)
- #define AFX_MIB_H__48F4CDE8_5A8B_4B2C_8824_EE413883AD29__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // MIB.h : header file
- #include "stdafx.h"
- #include "winsnmp.h"
- #include "snmp.h"
- class CipRouteTable;
- class CipRouteTableEntry;
- class CipAddrTable;
- class CipAddrTableEntry;
- class CifTable;
- class CifTableEntry;
- class CSystem;
- class CipRouteTable
- {
- public:
- CObArray m_ipRouteTableEntries; //CipRouteTableEntry
- };
- class CipRouteTableEntry : public CObject
- {
- public:
- CString ipRouteDst;
- int ipRouteIfIndex;
- // int ipRouteMetric1;
- // int ipRouteMetric2;
- // int ipRouteMetric3;
- // int ipRouteMetric4;
- CString ipRouteNextHop;
- // int ipRouteType;
- // int ipRouteProto;
- // int ipRouteAge;
- // int ipRouteMask;
- // int ipRouteMetric5;
- // int ipRouteInfo;
- };
- class CipAddrTable
- {
- public:
- CObArray m_ipAddrTableEntries;//CipAddrTableEntry
- };
- class CipAddrTableEntry : public CObject
- {
- public:
- CString ipAdEntAddr;
- int ipAdEntIfIndex;
- CString ipAdEntNetMask;
- // int ipAdEntReasmMaxSize;
- // int ipAdEntBcastAddr;
- };
- class CifTable
- {
- public:
- int ifNumber;
- CObArray m_ifTableEntries;//CifTableEntry
- };
- class CifTableEntry : public CObject
- {
- public:
- int ifIndex;
- CString ifDescr;
- int ifType;
- // int ifMtu;
- // int ifSpeed;
- CString ifPhysAddress;
- // int ifAdminStatus;
- // int ifOpenStatus;
- // int ifLastChange;
- // int ifInOctects;
- };
- class CSystem : public CObject
- {
- public:
- CString sysDescr;
- int sysObjectID;
- CString sysName;
- // int sysUpTime;
- // int sysContact;
- // int sysLocation;
- // int sysServices;
- };
- class CRouter : public CObject
- {
- public:
- CRouter();
- virtual ~CRouter();
- public:
- BOOL GetSystem(CSnmp* psnmp);
- BOOL GetRouterInfo(CSnmp* psnmp);
- void GetifTable(CSnmp* psnmp);
- void GetipAddrTable(CSnmp* psnmp);
- void GetipRouteTable(CSnmp* psnmp);
- private:
- int RecvInIfTable();
- int RecvInIpAddrTable();
- int RecvInSystem();
- public:
- void PrintRouterInfo();
- BOOL GetTableCol(CString& nStr,CString& fStr,CSnmp* psnmp);
- CipRouteTable m_ipRouteTable;//路由表信息
- CipAddrTable m_ipAddrTable;//ip地址表
- CifTable m_ifTable;//接口表
- CSystem m_sys;//路由的系统信息
- //本路由器的ip地址,可能有多个,我们只需要一个
- CString m_ipAddr;
- private:
- CSnmp *m_psnmp;//保存CSnmp对象,用来构建请求信息
- private:
- // int currRow;//当查询表时用来表示当前请求行以便构造请求Oid
- CString m_CurrOid[10];//存放当前的请求Oid,根据模板和当前行生成
- // CString m_TempleOid[10];//当前的请求Oid模板。
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_MIB_H__48F4CDE8_5A8B_4B2C_8824_EE413883AD29__INCLUDED_)