ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/vendor/pxys2-2.1.0/pxyscand/src/PXMSocks.h
Revision: 3253
Committed: Wed Apr 2 20:46:18 2014 UTC (9 years, 11 months ago) by michael
Content type: text/x-chdr
File size: 1842 byte(s)
Log Message:
- Imported pxys2-2.1.0

File Contents

# Content
1 // Copyright (C) 2003-2005 Stephane Thiell
2 //
3 // This file is part of pxyscand (from pxys)
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // $Id: PXMSocks.h,v 1.3 2005/05/19 00:49:38 mbuna Exp $
20 //
21 #ifndef INCLUDED_PXMSOCKS_H_
22 #define INCLUDED_PXMSOCKS_H_
23
24 #include <map>
25
26 #include "PXScanModule.h"
27
28 #include <peak/peak.h>
29
30 using std::map;
31
32 class PXMSocks : public PXScanModule
33 {
34 // Status
35 enum { SCAN_NOSOCKS, SCAN_SOCKS4, SCAN_SOCKS5 };
36
37 public:
38 PXMSocks(PXScan *inScan, int inPort);
39 virtual ~PXMSocks();
40
41 void InitModule();
42 bool StartScan();
43
44 // Convenience redefinition
45 virtual void ProxyNotFound();
46
47 protected:
48 void Cleanup();
49 void SendSocks4Request(peak_stream s);
50 void SendSocks5Request(peak_stream s);
51 void ProcessEvent(peak_stream s, int type);
52 static void EventCallback(peak_stream s, int type, void *context);
53
54 peak_stream mStream;
55 int mStatus;
56 int mLinesTry;
57 int mPort;
58
59 static map<uint16_t, uint32_t*> sConn4CountMap;
60 static map<uint16_t, uint32_t*> sConn5CountMap;
61 static map<uint16_t, uint32_t*> sProxy4CountMap;
62 static map<uint16_t, uint32_t*> sProxy5CountMap;
63 };
64
65 #endif // INCLUDED_PXMSOCKS_H_