summaryrefslogtreecommitdiff
path: root/ping/icmp.h
diff options
context:
space:
mode:
Diffstat (limited to 'ping/icmp.h')
-rw-r--r--ping/icmp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/ping/icmp.h b/ping/icmp.h
index 902942e..95efc28 100644
--- a/ping/icmp.h
+++ b/ping/icmp.h
@@ -4,9 +4,11 @@
#define _ICMP_H
//#include <windows.h>
+#include <iphlpapi.h>
+#include <icmpapi.h>
// Structures required to use functions in ICMP.DLL
-
+/*
typedef struct {
unsigned char Ttl; // Time To Live
unsigned char Tos; // Type Of Service
@@ -26,16 +28,16 @@ typedef struct {
unsigned char ReplyData[8];
} IP_ECHO_REPLY, * PIP_ECHO_REPLY;
-
+*/
typedef HANDLE (WINAPI* pfnHV)(VOID);
typedef BOOL (WINAPI* pfnBH)(HANDLE);
-typedef DWORD (WINAPI* pfnDHDPWPipPDD)(HANDLE, DWORD, LPVOID, WORD, PIP_OPTION_INFORMATION, LPVOID, DWORD, DWORD); // evil, no?
+typedef DWORD (WINAPI* pfnDHDPWPipPDD)(HANDLE, HANDLE, FARPROC, PVOID, IPAddr, LPVOID, WORD, PIP_OPTION_INFORMATION, LPVOID, DWORD, DWORD);
class ICMP {
protected:
pfnHV pIcmpCreateFile;
pfnBH pIcmpCloseHandle;
- pfnDHDPWPipPDD pIcmpSendEcho;
+ pfnDHDPWPipPDD pIcmpSendEcho2;
HMODULE hDLL;
@@ -46,13 +48,16 @@ protected:
// protected constructor - singleton class
ICMP();
- static ICMP instance;
+ static ICMP *instance;
+
+ char *buff;
public:
~ICMP();
- static ICMP *get_instance() {return &instance;}
+ static ICMP *get_instance();
+ static void cleanup();
- bool ping(char *host, IP_ECHO_REPLY &reply);
+ bool ping(char *host, ICMP_ECHO_REPLY &reply);
void set_timeout(unsigned int t) {
timeout = t;