Vidalia  0.2.17
Public Types | Public Member Functions | Private Member Functions
NetworkSettings Class Reference

#include <NetworkSettings.h>

Inheritance diagram for NetworkSettings:
AbstractTorSettings VSettings

List of all members.

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 ()

Private Member Functions

QString proxyTypeToString (ProxyType type)
ProxyType proxyTypeFromString (const QString &type)

Detailed Description

Definition at line 25 of file NetworkSettings.h.


Member Enumeration Documentation

Enumerator:
ProxyTypeMin 
NoProxy 

Have Tor connect directly to the Internet.

Socks4Proxy 

Use a SOCKS 4 proxy for OR connections.

Socks5Proxy 

Use a SOCKS 5 proxy for OR connections.

HttpHttpsProxy 

Use HTTP proxy for both dir and OR connections.

ProxyTypeMax 

Definition at line 30 of file NetworkSettings.h.


Constructor & Destructor Documentation


Member Function Documentation

bool NetworkSettings::apply ( QString *  errmsg = 0) [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().

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().

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().

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().

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().

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().

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().

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().

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().

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().

QString NetworkSettings::proxyTypeToString ( ProxyType  type) [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().

See also:
setReachablePorts()

Sets to fascistFirewall whether Tor should only create outgoing connections to the list of ports specified in setReachablePorts().

See also:
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().

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().


The documentation for this class was generated from the following files: