📄 ipmondlg.h
字号:
// ipmonDlg.h : header file
//
#if !defined(AFX_IPMONDLG_H__47076949_0324_11D5_924F_00010219EDF4__INCLUDED_)
#define AFX_IPMONDLG_H__47076949_0324_11D5_924F_00010219EDF4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Part of winsock2.h
/*
* Protocols
#define IPPROTO_IP 0 dummy for IP
#define IPPROTO_ICMP 1 control message protocol
#define IPPROTO_IGMP 2 internet group management protocol
#define IPPROTO_GGP 3 gateway^2 (deprecated)
#define IPPROTO_TCP 6 tcp
#define IPPROTO_PUP 12 pup
#define IPPROTO_UDP 17 user datagram protocol
#define IPPROTO_IDP 22 xns idp
#define IPPROTO_ND 77 UNOFFICIAL net disk proto
#define IPPROTO_RAW 255 raw IP packet
#define IPPROTO_MAX 256
*/
typedef struct _PROTN2T
{
int proto ;
char *pprototext ;
}PROTN2T ;
#define PROTO_NUM 11
/* The IP header */
typedef struct _IPHEADER {
unsigned char header_len:4;
unsigned char version:4;
unsigned char tos; // type of service
unsigned short total_len; // length of the packet
unsigned short ident; // unique identifier
unsigned short flags;
unsigned char ttl;
unsigned char proto; // protocol ( IP , TCP, UDP etc)
unsigned short checksum;
unsigned int sourceIP;
unsigned int destIP;
}IPHEADER;
/*-------------------zhuwei add(2002.11.9)-----------------------------*/
#define IP_VER 4 /* IP version */
#define IP_HEAD_LEN 5 /* IP head length */
#define IP_SERV_TYPE 0 /* IP service type */
#define IP_PROTO_TCP 6 /* TCP protocol */
#define IP_PROTO_UDP 17 /* UDP protocol */
#define IP_PROTO_ICMP 1 /* ICMP protocol */
#define IP_PAD 0 /* IP pseudohead padding */
#define IP_MF 0x4000 /* IP MF */
#define IP_DF 0x2000 /* IP DF */
#define IP_FLAG_MASK 0x1fff /* IP flagoffset mask */
#define IP_HEAD_BYTE_LEN 20 /* IP head length in byte */
#define TCP_HEAD_LEN 5 /* TCP head length */
#define TCP_URG 0x20 /* TCP URG */
#define TCP_ACK 0x10 /* TCP ACK */
#define TCP_PSH 0x08 /* TCP PSH */
#define TCP_RST 0x04 /* TCP RST */
#define TCP_SYN 0x02 /* TCP SYN */
#define TCP_FIN 0x01 /* TCP FIN */
#define TCP_HEAD_BYTE_LEN 20 /* TCP head length in byte */
#define UDP_HEAD_LEN 8 /* UDP head length */
#define PSEUDO_HEAD_LEN 12 /* Pseudo head length */
#define ICMP_HEAD_LEN 4 /* ICMP head length */
struct TCPPacketHead {
WORD SourPort;
WORD DestPort;
DWORD SeqNo;
DWORD AckNo;
BYTE HLen;
BYTE Flag;
WORD WndSize;
WORD ChkSum;
WORD UrgPtr;
};
struct ICMPPacketHead {
BYTE Type;
BYTE Code;
WORD ChkSum;
};
struct UDPPacketHead {
WORD SourPort;
WORD DestPort;
WORD Len;
WORD ChkSum;
};
/*
struct IPAddrArray {
unsigned char AddrByte[4];
};
struct PseudoHead {
struct IPAddrArray SourIP;
struct IPAddrArray DestIP;
BYTE Pad;
BYTE Proto;
WORD Len;
};
*/
/*---------------------------------------------------------------------*/
/////////////////////////////////////////////////////////////////////////////
// CIpmonDlg dialog
class CIpmonDlg : public CDialog
{
// Construction
public:
void AddData(CString s0,CString s1,CString s2,CString s3,CString s4,CString s5,CString s6);
CIpmonDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CIpmonDlg)
enum { IDD = IDD_IPMON_DIALOG };
CListCtrl m_ctrList;
CButton m_start;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CIpmonDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// AF added members and methods
DWORD m_ipsource ; // IP in net format
DWORD m_iphostsource ; // same IP in host format
DWORD m_iphost;
DWORD m_ipcheckedhost;
SOCKET m_s ;
DWORD m_threadID ;
BOOL m_Multihomed ;
BOOL m_Local ;
CDWordArray m_IPArr ;
void close_thread() ;
friend UINT threadFunc ( LPVOID p ) ;
// Generated message map functions
//{{AFX_MSG(CIpmonDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButton1();
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IPMONDLG_H__47076949_0324_11D5_924F_00010219EDF4__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -