MainFrm.h
上传用户:hbytqc8
上传日期:2014-07-31
资源大小:527k
文件大小:4k
- // MainFrm.h : interface of the CMainFrame class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_)
- #define AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "MyStringArray.h"
- #include "MapView.h"
- #include "NetMapView.h"
- #include "VlanView.h"
- #include "MyImage.h"
- #include <AfxTempl.h>
- class CMainFrame : public CFrameWnd
- {
-
- protected: // create from serialization only
- CMainFrame();
- DECLARE_DYNCREATE(CMainFrame)
- // Attributes
- public:
- HTREEITEM HRoot;
- HTREEITEM HCurrent;
- HTREEITEM HSelect;
- CArray <HTREEITEM,HTREEITEM> NodeArray;
- //为简化树的遍历,维护一个树中所有节点句柄组成的动态数组;
- CSplitterWnd h,v;
- //分割主窗口;
- CMapView *pListView;
- CNetMapView *pNetMapView;
- CVlanView *pVlanView;
- //保存指向三个视图的指针;
- MyStringArray m_snmp,m_temp;
- struct neighbor
- {
- HTREEITEM Id;
- //邻居节点的句柄;
- CString localport;
- CString remoteport;
- };
- //保存连接信息的结构,一个节点的每个物理连接对应这样的一个结构。
- //由于一个节点的连接数目不确定,因此下面的结构中将这个结构作为
- //一个动态数组中的元素定义;
- struct NodeData
- {
- CString ip;
- CString sysDescr;
- bool scan;
- int level;
- int position;
- bool router;
- CMyImage *pImage;
- CArray <neighbor,neighbor&> m_neighbor;
- };
- //用来存放节点信息的结构;
- NodeData *pNodeData;
- //指向该结构的指针;
- ///////////Valn Added Data//////////////////////
- int SeletedIndex;
- CMapStringToString M2I,Name2Id,TempMap;
- //保存主机物理地址与IP地址的影射表;
- struct port
- {
- CString PortName;
- CString PortIndex;
- };
- //保存每个VLAN中的端口信息;
- struct Vlan
- {
- CString Id;
- CString Name;
- CString State;
- CArray <port,port&> PortArray;
- };
- Vlan *pVlanData;
- struct AddMap
- {
- CString hIp;
- CString hAdd;
- };
- //保存交换机每个端口连接主机的物理,IP地址,可能有多个;
- struct SwitchPort
- {
- bool trunk;
- CString SwitchIP;
- CString Vlans;
- CString PortName;
- CString PortIndex;
- CString PortVlan;
- CString PortStatus;
- CMyImage * pPortImage;
- CMyImage * pHostImage;
- CArray <AddMap,AddMap&> HostAdd;
- };
- SwitchPort *pSP;
- CTypedPtrArray <CPtrArray,SwitchPort *> SwitchPortArray;
- //端口数据结构组成的动态数组;
- // Operations
- public:
- CString FindVlan(int index);
- CString HexTo01(CString &s);
- HTREEITEM FindNode(HTREEITEM hSubRoot,const CString &text);
- bool Findport(CString &port,NodeData *p);
- CString HtoIP(CString Hex);
- //将16进制的IP地址转化为正常格式的函数;
- void ScanNode(CString &add,CString &community,HTREEITEM hparent);
- //扫描一个节点,并处理所得到的CDP条目的函数;
- BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
- //分割窗口需要的函数;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CMainFrame)
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CMainFrame();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected: // control bar embedded members
- CStatusBar m_wndStatusBar;
- CToolBar m_wndToolBar;
- // Generated message map functions
- protected:
- //{{AFX_MSG(CMainFrame)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnScan();
- afx_msg void OnGraph();
- afx_msg void OnShowinformation();
- afx_msg void OnNodeModify();
- afx_msg void OnVlan();
- afx_msg void OnPort();
- afx_msg void OnAddMap();
- afx_msg void OnValnTopo();
- afx_msg void OnAddVlan();
- afx_msg void OnDeleteVlan();
- afx_msg void OnPortMore();
- afx_msg void OnToVlan();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_MAINFRM_H__E6C940E7_31C3_4826_8A9D_B01184F08820__INCLUDED_)