00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file networksettings.h 00013 ** \version $Id: networksettings.h 2362 2008-02-29 04:30:11Z edmanm $ 00014 ** \brief Settings for configuring an HTTP/HTTPS proxy or bridges 00015 */ 00016 00017 #ifndef _NETWORKSETTINGS_H 00018 #define _NETWORKSETTINGS_H 00019 00020 #include <QList> 00021 #include <QStringList> 00022 00023 #include "abstracttorsettings.h" 00024 00025 00026 class NetworkSettings : public AbstractTorSettings 00027 { 00028 Q_OBJECT 00029 00030 public: 00031 /** Default constructor. */ 00032 NetworkSettings(TorControl *torControl); 00033 00034 /** Applies the current network configuration settings to Tor. If 00035 * * <b>errmsg</b> is specified and an error occurs while applying the 00036 * settings, it will be set to a string describing the error. */ 00037 bool apply(QString *errmsg = 0); 00038 00039 /** Returns true if we need to set ReachableAddresses because we're behind a 00040 * restrictive firewall that limits the ports Tor can connect to. */ 00041 bool getFascistFirewall(); 00042 /** Sets to <b>fascistFirewall</b> whether Tor should only create outgoing 00043 * connections to the list of ports specified to setReachablePorts(). 00044 * \sa setReachablePorts() */ 00045 void setFascistFirewall(bool fascistFirewall); 00046 00047 /** Returns a list of ports to be specified in ReachableAddresses. */ 00048 QList<quint16> getReachablePorts(); 00049 /** Sets the list of ports that will be specified in ReachableAddresses to 00050 * <b>reachablePorts</b>. */ 00051 void setReachablePorts(const QList<quint16> &reachablePorts); 00052 00053 /** Returns true if Tor should make all its directory requests through a 00054 * proxy. */ 00055 bool getUseHttpProxy(); 00056 /** Sets to <b>useHttpProxy</b> whether Tor should make all its directory 00057 * requests through the proxy specified to setHttpProxy() 00058 * \sa setHttpProxy() */ 00059 void setUseHttpProxy(bool useHttpProxy); 00060 00061 /** Returns the proxy used for making Tor's directory requests, in the form 00062 * of <i>host[:port]</i>. */ 00063 QString getHttpProxy(); 00064 /** Sets the proxy used for making Tor's directory requests. <b>proxy</b> 00065 * should be in the form <i>host[:port]</i>. If <i>:port</i> is not 00066 * specified, then Tor will use its default of port 80. */ 00067 void setHttpProxy(const QString &proxy); 00068 00069 /** Returns the authentication information Tor should use to authenticate to 00070 * an Http proxy. The returned value is in the form 00071 * <i>username:password</i>. */ 00072 QString getHttpProxyAuthenticator(); 00073 /** Sets the authentication information required by an Http proxy. 00074 * <b>authenticator</b> should be in the form <i>username:password</i>. */ 00075 void setHttpProxyAuthenticator(const QString &authenticator); 00076 00077 /** Returns true if Tor should make all its OR connections through a 00078 * proxy. */ 00079 bool getUseHttpsProxy(); 00080 /** Sets to <b>useHttpsProxy</b> whether Tor should make all its OR 00081 * connections through the proxy specified to setHttpsProxy. 00082 * \sa setHttpsProxy() */ 00083 void setUseHttpsProxy(bool useHttpsProxy); 00084 00085 /** Returns the proxy used for making Tor's OR connections, in the form 00086 * of <i>host[:port]</i>. */ 00087 QString getHttpsProxy(); 00088 /** Sets the proxy used for making Tor's OR connections. <b>proxy</b> 00089 * should be in the form <i>host[:port]</i>. If <i>:port</i> is not 00090 * specified, then Tor will use its default of port 443. */ 00091 void setHttpsProxy(const QString &proxy); 00092 00093 /** Returns the authentication information Tor should use to authenticate to 00094 * an Https proxy. The returned value is in the form 00095 * <i>username:password</i>. */ 00096 QString getHttpsProxyAuthenticator(); 00097 /** Sets the authentication information required by an Https proxy. 00098 * <b>authenticator</b> should be in the form <i>username:password</i>. */ 00099 void setHttpsProxyAuthenticator(const QString &authenticator); 00100 00101 /** Returns true if Tor should try to use bridge nodes to access the Tor 00102 * network. */ 00103 bool getUseBridges(); 00104 /** Sets to <b>useBridges</b> whether Tor should try to use bridge nodes 00105 * to access the Tor network. */ 00106 void setUseBridges(bool useBridges); 00107 00108 /** Returns a list of bridge nodes Tor should use. */ 00109 QStringList getBridgeList(); 00110 /** Sets to <b>bridgeList</b> the list of bridge nodes Tor should use. */ 00111 void setBridgeList(const QStringList &bridgeList); 00112 00113 /** Returns true if Tor is configured to try to tunnel its directory 00114 * connections through a one-hop circuit. */ 00115 bool getTunnelDirConns(); 00116 }; 00117 00118 #endif 00119