SNMP1.h
上传用户:lvjun8202
上传日期:2013-04-30
资源大小:797k
文件大小:2k
- // SNMP1.h: interface for the CSNMP1 class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SNMP1_H__FCB4F07C_CD01_45D0_8433_978D2C3CC9A8__INCLUDED_)
- #define AFX_SNMP1_H__FCB4F07C_CD01_45D0_8433_978D2C3CC9A8__INCLUDED_
- #define M2DISPLAYSTRSIZE 255
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "stdafx.h"
- #include "winsnmp.h"
- #define OK 1
- #define ERROR 0
- class CSNMP1
- {
- public:
- CSNMP1();
- ~CSNMP1();
- private:
- smiLPUINT32 nMajorVersion,nMinorVersion,nLevel,nTranslateMode;
- smiLPUINT32 nRetransmitMode;
- HSNMP_SESSION session;
- HSNMP_SESSION session_trap; //Add by Qb
- CString strErr;
- HSNMP_PDU m_hpdu;
- HSNMP_VBL m_hvbl;
-
- struct System* system; //系统组变量
- struct Disk* disktbl; //系统物理单盘配置信息
- struct Channel* channel; //传输通道信息
- struct PhyMedia* media; //传输通道媒质信息
- struct Interface* ifTable; //设备的接口信息表,同interface group.
- //struct SNMPInfo snmpInfo ; //SNMP实体的信息,mib-2 SNMP group.
-
- char* sysName;
- LPCSTR address;
- int diskNum; //设备单盘数。
- int deviceType; //设备类型
- int softwareVersion; //软件版本号
- int hardwareVersion; //硬件版本号
- int operStatus; //但前设备运行状态
- int adminStatus; //管理状态
- //Commnity* commlist; //代理支持的共同体列表
- int* relatedDB; //与该代理相关的数据库表
- // members related to Topology function:
- int status;
-
- int x;
- int y;
- public:
- int nCount;
- BOOL sessionID;
-
- public:
- CreateSession(HWND hWnd,UINT wMsg);
- CreateSession_Trap(HWND hWnd,UINT wMsg);
- Send(LPCSTR address,const char* community/*,HSNMP_PDU pdu*/);
- CreatePdu(
- smiINT PDU_type, // PDU type
- smiINT32 request_id, // PDU request identifier
- smiINT error_status, // PDU error status, unless type is SNMP_PDU_GETBULK
- smiINT error_index // PDU error index, unless type is SNMP_PDU_GETBULK
- //HSNMP_VBL varbindlist // handle to the variable bindings list
- );
- CreateVbl(LPCSTR name,smiLPVALUE pvalue);
- Register();
- //int Receive(LPTSTR *name,smiLPVALUE *value,smiLPINT PDU_type,char* pSrc);
- int Receive(LPTSTR *name,smiLPVALUE *value,smiLPINT PDU_type,char* pSrc);
- //Receive(LPTSTR *name,smiLPVALUE *value,smiLPINT PDU_type,HSNMP_ENTITY srcEntity,HSNMP_ENTITY dstEntity);
- SetVbl(LPCSTR name,smiLPVALUE pvalue);
- };
- #endif // !defined(AFX_SNMP1_H__FCB4F07C_CD01_45D0_8433_978D2C3CC9A8__INCLUDED_)