Vidalia
0.2.21
|
#include <NetworkSettings.h>
Public Types | |
enum | ProxyType { ProxyTypeMin = -1, NoProxy = -1, Socks4Proxy = 0, Socks5Proxy = 1, HttpHttpsProxy = 2, ProxyTypeMax = 2 } |
Public Member Functions | |
NetworkSettings (TorControl *torControl) | |
bool | apply (QString *errmsg=0) |
bool | getFascistFirewall () |
void | setFascistFirewall (bool fascistFirewall) |
QList< quint16 > | getReachablePorts () |
void | setReachablePorts (const QList< quint16 > &reachablePorts) |
ProxyType | getProxyType () |
void | setProxyType (ProxyType type) |
QString | getProxyAddress () |
void | setProxyAddress (const QString &addr) |
QString | getProxyUsername () |
void | setProxyUsername (const QString &user) |
QString | getProxyPassword () |
void | setProxyPassword (const QString &pass) |
bool | getUseBridges () |
void | setUseBridges (bool useBridges) |
QStringList | getBridgeList () |
void | setBridgeList (const QStringList &bridgeList) |
bool | getTunnelDirConns () |
![]() | |
AbstractTorSettings (const QString &group, TorControl *torControl=0) | |
void | setChanged (bool changed) |
virtual bool | changedSinceLastApply () const |
virtual void | revert () |
![]() | |
VSettings (const QString group=QString()) | |
virtual QVariant | value (const QString &key, const QVariant &defaultVal=QVariant()) const |
Private Member Functions | |
QString | proxyTypeToString (ProxyType type) |
ProxyType | proxyTypeFromString (const QString &type) |
Additional Inherited Members | |
![]() | |
static QString | settingsFile () |
static bool | settingsFileExists () |
static void | reset () |
![]() | |
virtual QVariant | value (const QString &key) const |
virtual QVariant | localValue (const QString &key) const |
virtual QVariant | torValue (const QString &key) const |
virtual void | setValue (const QString &key, const QVariant &value) |
bool | isEmptyValue (const QVariant &value) const |
TorControl * | torControl () const |
Definition at line 25 of file NetworkSettings.h.
Definition at line 30 of file NetworkSettings.h.
NetworkSettings::NetworkSettings | ( | TorControl * | torControl | ) |
Default constructor.
Default constructor
Definition at line 44 of file NetworkSettings.cpp.
References NoProxy, VSettings::setDefault(), SETTING_BRIDGE_LIST, SETTING_FASCIST_FIREWALL, SETTING_PROXY_ADDRESS, SETTING_PROXY_PASSWORD, SETTING_PROXY_TYPE, SETTING_PROXY_USERNAME, SETTING_REACHABLE_ADDRESSES, SETTING_TUNNEL_DIR_CONNS, and SETTING_USE_BRIDGES.
|
virtual |
Applies the current network configuration settings to Tor. If
errmsg is specified and an error occurs while applying the settings, it will be set to a string describing the error.
Applies the current network configuration settings to Tor. If errmsg is specified and an error occurs while applying the settings, it will be set to a string describing the error.
Implements AbstractTorSettings.
Definition at line 63 of file NetworkSettings.cpp.
References getFascistFirewall(), getProxyType(), TorControl::getTorVersion(), getUseBridges(), HttpHttpsProxy, AbstractTorSettings::localValue(), NoProxy, TorControl::setConf(), SETTING_BRIDGE_LIST, SETTING_HTTPS_PROXY, SETTING_HTTPS_PROXY_AUTH, SETTING_PREFER_TUNNELED_DIR_CONNS, SETTING_PROXY_ADDRESS, SETTING_PROXY_PASSWORD, SETTING_PROXY_USERNAME, SETTING_REACHABLE_ADDRESSES, SETTING_SOCKS4_PROXY, SETTING_SOCKS5_PASSWORD, SETTING_SOCKS5_PROXY, SETTING_SOCKS5_USERNAME, SETTING_TUNNEL_DIR_CONNS, SETTING_UPDATE_BRIDGES, SETTING_USE_BRIDGES, Socks4Proxy, Socks5Proxy, and AbstractTorSettings::torControl().
Referenced by NetworkPage::apply().
QStringList NetworkSettings::getBridgeList | ( | ) |
Returns a list of bridge nodes Tor should use.
Definition at line 267 of file NetworkSettings.cpp.
References SETTING_BRIDGE_LIST, and AbstractTorSettings::value().
Referenced by NetworkPage::load().
bool NetworkSettings::getFascistFirewall | ( | ) |
Returns true if we need to set ReachableAddresses because we're behind a restrictive firewall that limits the ports Tor can connect to.
Definition at line 141 of file NetworkSettings.cpp.
References AbstractTorSettings::localValue(), and SETTING_FASCIST_FIREWALL.
Referenced by apply(), and NetworkPage::load().
QString NetworkSettings::getProxyAddress | ( | ) |
Returns the address of the proxy server Tor makes connections through.
Definition at line 209 of file NetworkSettings.cpp.
References SETTING_PROXY_ADDRESS, and AbstractTorSettings::value().
Referenced by NetworkPage::load().
QString NetworkSettings::getProxyPassword | ( | ) |
Returns the password used to login to the proxy server.
Definition at line 237 of file NetworkSettings.cpp.
References SETTING_PROXY_PASSWORD, and AbstractTorSettings::value().
Referenced by NetworkPage::load().
NetworkSettings::ProxyType NetworkSettings::getProxyType | ( | ) |
Returns the proxy type Tor is using, or NoProxy if it makes direct connections.
Definition at line 194 of file NetworkSettings.cpp.
References proxyTypeFromString(), SETTING_PROXY_TYPE, and AbstractTorSettings::value().
Referenced by apply(), and NetworkPage::load().
QString NetworkSettings::getProxyUsername | ( | ) |
Returns the username used to login to the proxy server.
Definition at line 223 of file NetworkSettings.cpp.
References SETTING_PROXY_USERNAME, and AbstractTorSettings::value().
Referenced by NetworkPage::load().
QList< quint16 > NetworkSettings::getReachablePorts | ( | ) |
Returns a list of ports to be specified in ReachableAddresses.
Definition at line 157 of file NetworkSettings.cpp.
References SETTING_REACHABLE_ADDRESSES, and AbstractTorSettings::value().
Referenced by NetworkPage::load().
bool NetworkSettings::getTunnelDirConns | ( | ) |
Returns true if Tor is configured to try to tunnel its directory connections through a one-hop circuit.
Definition at line 282 of file NetworkSettings.cpp.
References SETTING_TUNNEL_DIR_CONNS, and AbstractTorSettings::value().
bool NetworkSettings::getUseBridges | ( | ) |
Returns true if Tor should try to use bridge nodes to access the Tor network.
Definition at line 252 of file NetworkSettings.cpp.
References SETTING_USE_BRIDGES, and AbstractTorSettings::value().
Referenced by apply(), and NetworkPage::load().
|
private |
Converts the proxy type string type to its ProxyType counterpart.
Definition at line 315 of file NetworkSettings.cpp.
References HttpHttpsProxy, NoProxy, Socks4Proxy, and Socks5Proxy.
Referenced by getProxyType().
|
private |
Converts the ProxyType type to a string to store in the configuration file.
Definition at line 290 of file NetworkSettings.cpp.
References HttpHttpsProxy, NoProxy, Socks4Proxy, and Socks5Proxy.
Referenced by setProxyType().
void NetworkSettings::setBridgeList | ( | const QStringList & | bridgeList | ) |
Sets to bridgeList the list of bridge nodes Tor should use.
Definition at line 274 of file NetworkSettings.cpp.
References SETTING_BRIDGE_LIST, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setFascistFirewall | ( | bool | fascistFirewall | ) |
Sets to fascistFirewall whether Tor should only create outgoing connections to the list of ports specified to setReachablePorts().
Sets to fascistFirewall whether Tor should only create outgoing connections to the list of ports specified in setReachablePorts().
Definition at line 150 of file NetworkSettings.cpp.
References SETTING_FASCIST_FIREWALL, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setProxyAddress | ( | const QString & | addr | ) |
Sets the proxy address and port to addr.
Definition at line 216 of file NetworkSettings.cpp.
References SETTING_PROXY_ADDRESS, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setProxyPassword | ( | const QString & | pass | ) |
Sets the proxy server password to pass.
Definition at line 244 of file NetworkSettings.cpp.
References SETTING_PROXY_PASSWORD, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setProxyType | ( | ProxyType | type | ) |
Set the type of proxy Tor should use to type.
Definition at line 202 of file NetworkSettings.cpp.
References proxyTypeToString(), SETTING_PROXY_TYPE, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setProxyUsername | ( | const QString & | user | ) |
Sets the proxy server username to user.
Definition at line 230 of file NetworkSettings.cpp.
References SETTING_PROXY_USERNAME, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setReachablePorts | ( | const QList< quint16 > & | reachablePorts | ) |
Sets the list of ports that will be specified in ReachableAddresses to reachablePorts.
Definition at line 180 of file NetworkSettings.cpp.
References SETTING_REACHABLE_ADDRESSES, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().
void NetworkSettings::setUseBridges | ( | bool | useBridges | ) |
Sets to useBridges whether Tor should try to use bridge nodes to access the Tor network.
Definition at line 260 of file NetworkSettings.cpp.
References SETTING_USE_BRIDGES, and AbstractTorSettings::setValue().
Referenced by NetworkPage::save().