-
Notifications
You must be signed in to change notification settings - Fork 1
/
Icmp.h
113 lines (91 loc) · 2.57 KB
/
Icmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// Icmp.h: interface for the CIcmp class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ICMP_H__9C924670_C74C_4DAB_A81A_41DBD526BFC6__INCLUDED_)
#define AFX_ICMP_H__9C924670_C74C_4DAB_A81A_41DBD526BFC6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "common.h"
#include "IcmpPacket.h"
#include "IPPacket.h"
#include "ClassLib\sockets.h"
//#include "dbgHelp\BugsLayerutil.h"
class CIcmp
{
private:
CSocket m_Socket;
ULONG StartTimeTick;
DWORD FillResp(PBYTE pRecvBuffer,
int cbReceived,
struct sockaddr_in* dest,
CIcmpReply* pIcmpReply);
public:
CIcmp();
virtual ~CIcmp();
DWORD SendEcho(IPADDR DestinationAddress,
PBYTE RequestData,
WORD RequestSize,
BYTE Ttl,
BYTE Tos,
BYTE Flags,
DWORD Timeout,
CIcmpReply* pIcmpReply);
DWORD GetSubnetMask(IPADDR DestinationAddress,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout);
DWORD GetTimeStamp(IPADDR DestinationAddress,
LPVOID ReplyBuffer,
DWORD ReplySize,
DWORD Timeout);
DWORD Send(CIcmpPacket* pIcmpPacket,
IPADDR DestinationAddress,
BYTE Ttl,
BYTE Tos,
BYTE Flags,
DWORD Timeout,
CIcmpReply* pIcmpReply);
DWORD TraceRoute(IPADDR DestinationAddress,
DWORD Timeout,
BOOL fDNSResolution,
BYTE MaxHopNum,
LPBYTE lpData,
DWORD dwDataSize);
};
/*class CTracing
{
private:
CIcmp m_Icmp;
BYTE m_nCurrentHop;
IPADDR m_DestinationAddress;
DWORD m_dwTimeout;
BOOL m_fDNS;
BYTE m_nMaxHop;
LPBYTE m_lpData;
BOOL Terminated;
//VOID WINAPI DoNothingApc(ULONG_PTR dwParam) { }
public:
class CTraceResult
{
public:
INADDR InetAddress;
}
BOOL SetParams(IPADDR DestinationAddress,
DWORD dwTimeout,
BOOL fDNSResolve,
BYTE nMaxHop);
BOOL Start()
{
//Create the reply buffer
//set to zero the CurrentHop
//Create the Thread
//set Terminated to false
};
BOOL Stop();
static DWORD WINAPI TraceThread(PVOID pvUnused)
{
while(!Terminated &&
}
};*/
#endif // !defined(AFX_ICMP_H__9C924670_C74C_4DAB_A81A_41DBD526BFC6__INCLUDED_)