File: proxyhandler.h

package info (click to toggle)
havp 0.92a-4%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,568 kB
  • sloc: cpp: 7,473; sh: 474; makefile: 100
file content (102 lines) | stat: -rw-r--r-- 2,655 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/***************************************************************************
                          proxyhandler.h  -  description
                             -------------------
    begin                : So Feb 20 2005
    copyright            : (C) 2005 by Christian Hilgers
    email                : christian@hilgers.ag
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PROXYHANDLER_H
#define PROXYHANDLER_H

#include "default.h"
#include "connectiontobrowser.h"
#include "connectiontohttp.h"
#include "scannerhandler.h"

#include <string>

using namespace std;

class ProxyDetails {
private:
    bool UseParentProxy;
	string ParentHost;
	int ParentPort;
	bool UseParentProxyAuth;
	string ParentUser;
	string ParentPassword;
public:
	ProxyDetails();
	bool useProxy() {return UseParentProxy;};
	bool useProxyAuth() {return UseParentProxyAuth;};
	string getHost() {return ParentHost;};
	int getPort() {return ParentPort;};
	string getUser() {return ParentUser;};
	string getPassword() {return ParentPassword;};
};

class ProxyHandler {
private:

bool HeaderSend;
bool BrowserDropped;
bool DropBrowser;
bool ScannerUsed;
bool UnlockDone;
bool AnswerDone;
bool ReinitDone;
bool ServerClosed;
bool ServerConnected;
bool DropServer;
int alivecount;
string ConnectedHost;
int ConnectedPort;

string Header;

ConnectionToBrowser ToBrowser;
ConnectionToHTTP ToServer;
ProxyDetails parentProxy;

int MaxDownloadSize;
int KeepBackTime;
int TricklingTime;
unsigned int TricklingBytes;
int KeepBackBuffer;

int TransferredHeader;
long long TransferredBody;

bool DontLock;
bool DontLockBINHEX;
bool DontLockPDF;
bool DontLockZIP;

bool ProxyMessage( int CommunicationAnswerT, string Answer );
int CommunicationHTTP( ScannerHandler &Scanners, bool ScannerOff );
int CommunicationFTP( ScannerHandler &Scanners, bool ScannerOff );

#ifdef SSLTUNNEL
int CommunicationSSL();
#endif

public:

void Proxy( SocketHandler &ProxyServerT, ScannerHandler &Scanners );
 
ProxyHandler();
~ProxyHandler();

};

#endif