author | Michael Krelin <hacker@klever.net> | 2012-12-08 21:19:17 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2012-12-11 21:59:29 (UTC) |
commit | 8808689fe340bec6e90ab13dd502292b0579cf1f (patch) (unidiff) | |
tree | 45b7c863151341f687b74e40bffcbd7ab5468783 /shared-code/kICMP.h | |
parent | 6e7e413ca364d79673e523c09767c18e7cff1bec (diff) | |
download | pumpkin-osx/0.0.zip pumpkin-osx/0.0.tar.gz pumpkin-osx/0.0.tar.bz2 |
initial osx portosx/0.0
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | shared-code/kICMP.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/shared-code/kICMP.h b/shared-code/kICMP.h deleted file mode 100644 index 7a5ceaa..0000000 --- a/shared-code/kICMP.h +++ b/dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | #ifndef__KICMP_H | ||
2 | #define __KICMP_H | ||
3 | |||
4 | class CICMP { | ||
5 | enum _mechanismus { | ||
6 | _icmpUndetermined = -1, | ||
7 | _icmpWinsock = 0, _icmpDLL | ||
8 | }; | ||
9 | static _mechanismus m_mechanismus; | ||
10 | static void GuessMechanismus(); | ||
11 | public: | ||
12 | static | ||
13 | CICMP* CreateICMP(); | ||
14 | |||
15 | enum { | ||
16 | ipSuccess = 0, | ||
17 | ipBuffTooSmall, ipDestNetUnreachable, ipDestHostUnreachable, | ||
18 | ipDestProtUnreachable, ipDestPortUnreachable, ipNoResources, | ||
19 | ipBadOption, ipHWError, ipPacketTooBig, ipTimeOut, ipBadRequest, | ||
20 | ipBadRoute, ipTTLExpiredInTransit, ipTTLExpiredInReasm, | ||
21 | ipParamProblem, ipSourceQuench, ipOptionTooBig, ipBadDest, | ||
22 | ipUnknown = -1, | ||
23 | icmpNotInitialized = -2, | ||
24 | icmpSocketError = -3 | ||
25 | }; | ||
26 | |||
27 | virtual BOOL Initialize() = 0; | ||
28 | virtual void Deinitialize() = 0; | ||
29 | |||
30 | virtual LONG Ping(const in_addr host,const UINT packetSize=0, | ||
31 | const UINT timeOut=10000,LPINT pStatus=NULL) = 0; | ||
32 | }; | ||
33 | |||
34 | class CICMPDll : public CICMP { | ||
35 | HANDLE(WINAPI *m_icmpCF)(VOID); | ||
36 | BOOL(WINAPI *m_icmpSE)(HANDLE,ULONG,LPVOID,WORD, | ||
37 | PIPINFO,LPVOID,DWORD,DWORD); | ||
38 | BOOL(WINAPI *m_icmpCH)(HANDLE); | ||
39 | public: | ||
40 | HINSTANCE m_hICMPDLL; | ||
41 | HANDLE m_hICMP; | ||
42 | LPBYTE m_bsIn, m_bsOut; | ||
43 | UINT m_sizeIn, m_sizeOut; | ||
44 | |||
45 | CICMPDll() : m_hICMP(INVALID_HANDLE_VALUE), m_hICMPDLL(NULL), | ||
46 | m_bsIn(NULL), m_bsOut(NULL), m_sizeIn(0), m_sizeOut(0) {} | ||
47 | virtual ~CICMPDll() { Deinitialize(); } | ||
48 | |||
49 | virtual BOOL Initialize(); | ||
50 | virtual void Deinitialize(); | ||
51 | |||
52 | virtual LONG Ping(const in_addr host,const UINT packetSize=0, | ||
53 | const UINT timeOut=10000,LPINT pStatus=NULL); | ||
54 | |||
55 | BOOL AdjustBuffers(UINT packetSize=0); | ||
56 | }; | ||
57 | |||
58 | class CICMPWS : public CICMP { | ||
59 | static | ||
60 | WORD m_icmpSeq; | ||
61 | public: | ||
62 | SOCKET m_socket; | ||
63 | LPBYTE m_bsIn, m_bsOut; | ||
64 | UINT m_sizeIn, m_sizeOut; | ||
65 | |||
66 | CICMPWS() : m_socket(INVALID_SOCKET), m_bsIn(NULL), m_bsOut(NULL), | ||
67 | m_sizeIn(0), m_sizeOut(0) {} | ||
68 | virtual ~CICMPWS() { Deinitialize(); } | ||
69 | |||
70 | virtual BOOL Initialize(); | ||
71 | virtual void Deinitialize(); | ||
72 | |||
73 | virtual LONG Ping(const in_addr host,const UINT packetSize=0, | ||
74 | const UINT timeOut=10000,LPINT pStatus=NULL); | ||
75 | |||
76 | BOOL AdjustBuffers(UINT packetSize=0); | ||
77 | WORD cksum(LPVOID data,int count); | ||
78 | }; | ||
79 | |||
80 | #endif // __KICMP_H \ No newline at end of file | ||