📄 mainfrm.h
字号:
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__DA82A361_8197_4371_BB46_B4128047E003__INCLUDED_)
#define AFX_MAINFRM_H__DA82A361_8197_4371_BB46_B4128047E003__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define DIR_AB 1
#define DIR_BA 2
#define DIR_BOTH 0
#define TYPE_TCP 0
#define TYPE_UDP 1
#define TYPE_ICMP 2
#define TYPE_OSPF 3
#define TYPE_ARP 4
#define TYPE_RARP 5
#define TYPE_COUNT 6
#include "ProgBar.h"
#include <afxtempl.h>
#include "stdafx.h"
#include <list>
using namespace std;
class CMulPackView;
class CSinPackView;
class CStcView;
class CContentView;
class TCPGram;
class pacp_if_t;
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
CMulPackView *mulPackView;//显示所有抓到的包的简要信息
CSinPackView *sinPackView;//显示选中的包的具体信息,用解析树表达
CStcView *stcView;//显示某个选中的包的内容,以十六进制显示每个字节,再以文本形式显示所有内容
CContentView *conView;//已经不使用
CStatusBar m_wndStatusBar;
CProgStatusBar m_progStatusBar;//网络流量进度条
pcap_if_t *alldevs;
pcap_if_t *dev;
bool isStart;//是否开始抓包
bool isStop;//是否停止抓包
//char filter_opt[100];
BOOL isAddrA;//是否对A地址进行筛选
BOOL isAddrB;//是否对B地址进行筛选
//BOOL isDown;
int addrA;//记录A地址
int addrB;//记录B地址
int dirmode;//传输方向(A->B,B->A,A<->B)
BOOL filtertype[6];//记录每种包是否筛选,TCP,UDP,ICMP,ARP,RARP,OSPF
//CArray <TCPGram*,TCPGram*> tcps;
CArray <Founder,Founder> founders;//用于重组TCP时,记录满足条件的TCP包
//FILE *fp;
// Operations
public:
BOOL Filter(const unsigned char *pkt_data);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CToolBar m_wndToolBar;
CSplitterWnd m_wndSplitter1;
CSplitterWnd m_wndSplitter2;
//CSplitterWnd m_wndSplitter3;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnOptAdpater();
afx_msg void OnFileStart();
afx_msg void OnFileStop();
afx_msg void OnUpdateFileStart(CCmdUI* pCmdUI);
afx_msg void OnUpdateFileStop(CCmdUI* pCmdUI);
afx_msg void OnOptFilter();
afx_msg void OnClose();
afx_msg void OnFileReassembly();
afx_msg void OnUpdateFileReassembly(CCmdUI* pCmdUI);
afx_msg void OnFileDown();
afx_msg void OnUpdateFileDown(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptAdpater(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptFilter(CCmdUI* pCmdUI);
afx_msg void OnFileAdvance();
afx_msg void OnUpdateFileAdvance(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
void pcap_handle(u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data);
UINT ReceivePacket(LPVOID param);
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__DA82A361_8197_4371_BB46_B4128047E003__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -