// ipmonDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ipmon.h"
#include "ipmonDlg.h"
#include "mstcpip.h"
#include "afxsock.h"
#include "Iphlpapi.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
PROTN2T aOfProto [ PROTO_NUM + 1] =
{
{ IPPROTO_IP , "IP" },
{ IPPROTO_ICMP , "ICMP" },
{ IPPROTO_IGMP , "IGMP" },
{ IPPROTO_GGP , "GGP" },
{ IPPROTO_TCP , "TCP" },
{ IPPROTO_PUP , "PUP" },
{ IPPROTO_UDP , "UDP" },
{ IPPROTO_IDP , "IDP" },
{ IPPROTO_ND , "NP" },
{ IPPROTO_RAW , "RAW" },
{ IPPROTO_MAX , "MAX" },
{ NULL , "" }
} ;
char *get_proto_name( unsigned char proto )
{
BOOL bFound = FALSE ;
for( int i = 0 ; i < PROTO_NUM ; i++ )
{
if( aOfProto[i].proto == proto )
{
bFound = TRUE ;
break ;
}
}
if( bFound )
return aOfProto[i].pprototext ;
return aOfProto[PROTO_NUM].pprototext ;
}
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CIpmonDlg dialog
CIpmonDlg::CIpmonDlg(CWnd* pParent /*=NULL*/)
: CDialog(CIpmonDlg::IDD, pP
1