⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmdprotocol.h

📁 我们的网管程序的后台软件,主要是网络方面的内容.
💻 H
字号:
 // CmdProtocol.h: interface for the CCmdProtocol class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CMDPROTOCOL_H__13B524DF_9977_4088_82D8_8F6746BB6AAB__INCLUDED_)
#define AFX_CMDPROTOCOL_H__13B524DF_9977_4088_82D8_8F6746BB6AAB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define CMD_GET_COPYRIGHT		1
#define CMD_GET_GW_ADDR			2
#define CMD_GET_GW_IP			3
#define CMD_GET_IS_GW			4
#define CMD_GET_SUBNET_NUM		5
#define CMD_GET_ORIGIN			6
#define CMD_GET_MANAGE_IP		7
#define CMD_GET_TRAP_PORT		8
#define CMD_GET_START_CONFIG	9
#define CMD_GET_CONFIG_VER		10
#define CMD_GET_CONFIG_OK		11
#define CMD_GET_KERNEL_VERSION	12

#define CMD_GET_CURRENT_PERF		13
#define CMD_GET_ALARM_MASK		14

#define CMD_SET_COPYRIGHT		101
#define CMD_SET_GW_ADDR			102
#define CMD_SET_GW_IP			103
#define CMD_SET_IS_GW			104
#define CMD_SET_SUBNET_NUM		105
#define CMD_SET_ORIGIN			106
#define CMD_SET_MANAGE_IP		107
#define CMD_SET_TRAP_PORT		108
#define CMD_SET_START_CONFIG	109
#define CMD_SET_CONFIG_VER		110
#define CMD_SET_CONFIG_OK		111
#define CMD_SET_KERNEL_UPGRADE	112
#define CMD_SET_REFRESH			113
#define CMD_SET_ROLE_CHANGE	114
#define CMD_SET_SIMPLE_OAM		115

#define CMD_SET_ALARM_MASK		116

#define CMD_ERROR				1000

extern _TCHAR* g_szCmdType[];
extern int g_szCmd[];

#define MAX_CMD_QUEUE_NUMBER 5
#define MAX_CMD_TIMEOUT		 10

class CCmdProtocol  
{
public:

	/* 代替Snmp之UDP绑定端口 */
	int			sockfd;

	// 队列数据保护
	HANDLE		hInUse;

	// 消息窗口
	HWND		hMsgWnd;

	// 当前处理请求在队列中位置
	int			m_SendPos;

	/* 请求服务队列 */
	QueryNMS	gQueryQueue[MAX_CMD_QUEUE_NUMBER];

	// Timer
	UINT		uIDTimer;

	// Send Sequence
	UINT		uSequence;	

public:
	CCmdProtocol();
	CCmdProtocol(HWND);
	virtual ~CCmdProtocol();

public:

	int Cmd_Protocol_init();

	// Normal Snmp Get/Set Action supersede (替代)
	int		Cmd_Send_Cmd(WPARAM wParam, LPARAM lParam);
	void	Cmd_Recv_Answer(WPARAM wParam , LPARAM lParam);
	void	ReportError();

	int CmdQueryNMS(PQueryNMS spQueryNMS);

	// Snmp Trap supersede (替代)
	static void Cmd_Recv_Trap(WPARAM wParam , LPARAM lParam);

};

#endif // !defined(AFX_CMDPROTOCOL_H__13B524DF_9977_4088_82D8_8F6746BB6AAB__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -