summaryrefslogtreecommitdiff
path: root/ping/icmp.h
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-31 05:07:21 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-31 05:07:21 +0000
commit0ff1d601dfadfd19e286c021fd1288e8b8b4b7c2 (patch)
treeaafe89e4f6870ad528f00e081d31432cdfbb8d32 /ping/icmp.h
parent87a314a0f8b3aa138601963c0e98d339997b9d6e (diff)
use yapp api for popup classes
use fontservice for fame background colour add beta changelog url link to svn log use IPHLPAPI.dll if available, and use only one icmp file handle git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@316 4f64403b-2f21-0410-a795-97e2b3489a10
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;