My Project
D:/source/c++/Programme/sally/sally/sallyAPI/Ping.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #pragma  once
00029 
00030 #pragma comment( lib, "Ws2_32.lib" )
00031 
00032 #include "Define.h"
00033 #include <stdio.h>
00034 #include <string>
00035 
00036 namespace SallyAPI
00037 {
00038         namespace Network
00039         {
00048 
00049                 typedef struct tagIPINFO 
00050                 { 
00051                         u_char Ttl;                // Time To Live 
00052                         u_char Tos;                // Type Of Service 
00053                         u_char IPFlags;            // IP flags 
00054                         u_char OptSize;            // Size of options data 
00055                         u_char FAR *Options;    // Options data buffer 
00056                         
00057                 }IPINFO; 
00058 
00059                 typedef IPINFO* PIPINFO; 
00060 
00069 
00070                 typedef struct tagICMPECHO 
00071                 { 
00072                         u_long Source;            // Quelladresse
00073                         u_long Status;            // IP status 
00074                         u_long RTTime;             
00075                         u_short DataSize;        // Größe der Antwort 
00076                         u_short Reserved;        
00077                         void FAR *pData;        // Buffer für die Antwort 
00078                         IPINFO    ipInfo;             
00079                 }ICMPECHO; 
00080 
00081                 typedef ICMPECHO* PICMPECHO; 
00082 
00091 
00092                 class DLL_API_SALLY CPing 
00093                 { 
00094                 public: 
00095                         CPing(); 
00096                         ~CPing(); 
00097                         BOOL Ping(char* strHost); 
00098                         int     GetPingSuccess();
00099                 private: 
00100                     
00101                         HANDLE (WINAPI *pIcmpCreateFile)(); 
00102                         BOOL (WINAPI *pIcmpCloseHandle)(HANDLE); 
00103                         DWORD (WINAPI *pIcmpSendEcho) 
00104                                 (HANDLE,DWORD,LPVOID,WORD,PIPINFO,LPVOID,DWORD,DWORD); 
00105                         HANDLE hndlIcmp;            // LoadLibrary() handle 
00106                         BOOL bValid;
00107                         int PingSuccess;
00108                 }; 
00109         }
00110 }
00111 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines