Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 221

vidalia-0.2.9-1mdv2010.1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Vidalia: NetworkSettings.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_b47abd1aad201a152869566145babb61.html">src</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_695ba8f8357372e02d38c40b3c6dbe81.html">vidalia</a>&nbsp;&raquo;&nbsp;<a class="el" href="dir_738aec08306f4b898e01f7a551299457.html">config</a>
  </div>
</div>
<div class="contents">
<h1>NetworkSettings.h</h1><a href="_network_settings_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">**  This file is part of Vidalia, and is subject to the license terms in the</span>
<a name="l00003"></a>00003 <span class="comment">**  LICENSE file, found in the top level directory of this distribution. If you</span>
<a name="l00004"></a>00004 <span class="comment">**  did not receive the LICENSE file with this file, you may obtain it from the</span>
<a name="l00005"></a>00005 <span class="comment">**  Vidalia source package distributed by the Vidalia Project at</span>
<a name="l00006"></a>00006 <span class="comment">**  http://www.vidalia-project.net/. No part of Vidalia, including this file,</span>
<a name="l00007"></a>00007 <span class="comment">**  may be copied, modified, propagated, or distributed except according to the</span>
<a name="l00008"></a>00008 <span class="comment">**  terms described in the LICENSE file.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">/*</span>
<a name="l00012"></a>00012 <span class="comment">** \file NetworkSettings.h</span>
<a name="l00013"></a>00013 <span class="comment">** \version $Id: NetworkSettings.h 4140 2009-10-03 21:49:21Z edmanm $</span>
<a name="l00014"></a>00014 <span class="comment">** \brief Settings for configuring an HTTP/HTTPS proxy or bridges</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _NETWORKSETTINGS_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _NETWORKSETTINGS_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="_abstract_tor_settings_8h.html">AbstractTorSettings.h</a>&quot;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;QStringList&gt;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="class_network_settings.html">00026</a> <span class="keyword">class </span><a class="code" href="class_network_settings.html">NetworkSettings</a> : <span class="keyword">public</span> <a class="code" href="class_abstract_tor_settings.html">AbstractTorSettings</a>
<a name="l00027"></a>00027 {
<a name="l00028"></a>00028   Q_OBJECT
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keyword">public</span>:
<a name="l00031"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">00031</a>   <span class="keyword">enum</span> <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">ProxyType</a>
<a name="l00032"></a>00032   {
<a name="l00033"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda5b50764aef2aa4f05075afe0de63509d">00033</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda5b50764aef2aa4f05075afe0de63509d">ProxyTypeMin</a> = -1,
<a name="l00034"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda8016bee11a07a8b24b6f6c06c194edfa">00034</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda8016bee11a07a8b24b6f6c06c194edfa">NoProxy</a> = -1, <span class="comment">/**&lt; Have Tor connect directly to the Internet. */</span>
<a name="l00035"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edaae81f36418020be4547de76aadf6887d">00035</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edaae81f36418020be4547de76aadf6887d">Socks4Proxy</a> = 0, <span class="comment">/**&lt; Use a SOCKS 4 proxy for OR connections. */</span>
<a name="l00036"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edabbb2566f258235e8985048d1e141afbf">00036</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edabbb2566f258235e8985048d1e141afbf">Socks5Proxy</a> = 1, <span class="comment">/**&lt; Use a SOCKS 5 proxy for OR connections. */</span>
<a name="l00037"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edad56662fa91458c01fb20aac4db49dca9">00037</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188edad56662fa91458c01fb20aac4db49dca9">HttpProxy</a> = 2, <span class="comment">/**&lt; Use an HTTP proxy for non-tunneled dir fetches. */</span>
<a name="l00038"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda18b8cb860d63626dea1a3ec5d0bb87bb">00038</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda18b8cb860d63626dea1a3ec5d0bb87bb">HttpHttpsProxy</a> = 3, <span class="comment">/**&lt; Use HTTP proxy for both dir and OR connections. */</span>
<a name="l00039"></a><a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda89685270b338234c94f51fa7d502ce7e">00039</a>     <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188eda89685270b338234c94f51fa7d502ce7e">ProxyTypeMax</a> = 3
<a name="l00040"></a>00040   };
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00043"></a>00043 <span class="comment">  /** Default constructor. */</span>
<a name="l00044"></a>00044   <a class="code" href="class_network_settings.html#a5563eac6a53715addf204d5d52e7cd1c">NetworkSettings</a>(<a class="code" href="class_tor_control.html">TorControl</a> *<a class="code" href="class_abstract_tor_settings.html#a1fd0bb636bfa8131f6261b1bc11aeee4">torControl</a>);
<a name="l00045"></a>00045 <span class="comment"></span>
<a name="l00046"></a>00046 <span class="comment">  /** Applies the current network configuration settings to Tor. If</span>
<a name="l00047"></a>00047 <span class="comment">   *  * &lt;b&gt;errmsg&lt;/b&gt; is specified and an error occurs while applying the</span>
<a name="l00048"></a>00048 <span class="comment">   *  settings, it will be set to a string describing the error. */</span>
<a name="l00049"></a>00049   <span class="keywordtype">bool</span> <a class="code" href="class_network_settings.html#a5cfe489933fe086357839a490ad7d7a9">apply</a>(QString *errmsg = 0);
<a name="l00050"></a>00050 <span class="comment"></span>
<a name="l00051"></a>00051 <span class="comment">  /** Returns true if we need to set ReachableAddresses because we&#39;re behind a</span>
<a name="l00052"></a>00052 <span class="comment">   * restrictive firewall that limits the ports Tor can connect to. */</span>
<a name="l00053"></a>00053   <span class="keywordtype">bool</span> <a class="code" href="class_network_settings.html#a2174af01ed475ccd2d8bdcdbc5ab8224">getFascistFirewall</a>();<span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">  /** Sets to &lt;b&gt;fascistFirewall&lt;/b&gt; whether Tor should only create outgoing</span>
<a name="l00055"></a>00055 <span class="comment">   * connections to the list of ports specified to setReachablePorts().</span>
<a name="l00056"></a>00056 <span class="comment">   * \sa setReachablePorts() */</span>
<a name="l00057"></a>00057   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#acd47f94ca232e19847cebf7b2c327999">setFascistFirewall</a>(<span class="keywordtype">bool</span> fascistFirewall);
<a name="l00058"></a>00058 <span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">  /** Returns a list of ports to be specified in ReachableAddresses. */</span>
<a name="l00060"></a>00060   QList&lt;quint16&gt; <a class="code" href="class_network_settings.html#a25a3bf9cbf78838b76acc745304bff3e">getReachablePorts</a>();<span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">  /** Sets the list of ports that will be specified in ReachableAddresses to</span>
<a name="l00062"></a>00062 <span class="comment">   * &lt;b&gt;reachablePorts&lt;/b&gt;. */</span>
<a name="l00063"></a>00063   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#a4dc84084b9adf7d18f8c40b457a9fce1">setReachablePorts</a>(<span class="keyword">const</span> QList&lt;quint16&gt; &amp;reachablePorts);
<a name="l00064"></a>00064 <span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">  /** Returns the proxy type Tor is using, or NoProxy if it makes direct</span>
<a name="l00066"></a>00066 <span class="comment">   * connections. */</span> 
<a name="l00067"></a>00067   <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">ProxyType</a> <a class="code" href="class_network_settings.html#a3b01aabfccb63628991fa53892b92e6a">getProxyType</a>();<span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">  /** Set the type of proxy Tor should use to &lt;b&gt;type&lt;/b&gt;. */</span>
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#ae4d73a95169ce0d97c6c921a37d1192f">setProxyType</a>(<a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">ProxyType</a> type);
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">  /** Returns the address of the proxy server Tor makes connections through. */</span>
<a name="l00072"></a>00072   QString <a class="code" href="class_network_settings.html#a164b86e903ecee31fa3d5e76e28c9373">getProxyAddress</a>();<span class="comment"></span>
<a name="l00073"></a>00073 <span class="comment">  /** Sets the proxy address and port to &lt;b&gt;addr&lt;/b&gt;. */</span>
<a name="l00074"></a>00074   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#acc05b7d7bc14c1e9ad0a91683baacefc">setProxyAddress</a>(<span class="keyword">const</span> QString &amp;addr);
<a name="l00075"></a>00075 <span class="comment"></span>
<a name="l00076"></a>00076 <span class="comment">  /** Returns the username used to login to the proxy server. */</span>
<a name="l00077"></a>00077   QString <a class="code" href="class_network_settings.html#a587246b09f4a3d4185b08f7b2410de97">getProxyUsername</a>();<span class="comment"></span>
<a name="l00078"></a>00078 <span class="comment">  /** Sets the proxy server username to &lt;b&gt;user&lt;/b&gt;. */</span> 
<a name="l00079"></a>00079   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#a444fb3c8e2998fc54b1256985e9737c5">setProxyUsername</a>(<span class="keyword">const</span> QString &amp;user);
<a name="l00080"></a>00080 <span class="comment"></span>
<a name="l00081"></a>00081 <span class="comment">  /** Returns the password used to login to the proxy server. */</span>
<a name="l00082"></a>00082   QString <a class="code" href="class_network_settings.html#abc8f9bb63d97bc74e5b40d5be91d249b">getProxyPassword</a>();<span class="comment"></span>
<a name="l00083"></a>00083 <span class="comment">  /** Sets the proxy server password to &lt;b&gt;pass&lt;/b&gt;. */</span> 
<a name="l00084"></a>00084   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#ad41947311b37876a8ab7390c96577ca1">setProxyPassword</a>(<span class="keyword">const</span> QString &amp;pass);
<a name="l00085"></a>00085  <span class="comment"></span>
<a name="l00086"></a>00086 <span class="comment">  /** Returns true if Tor should try to use bridge nodes to access the Tor</span>
<a name="l00087"></a>00087 <span class="comment">   * network. */</span>
<a name="l00088"></a>00088   <span class="keywordtype">bool</span> <a class="code" href="class_network_settings.html#a0134b7a3b1f92f1d923d5866aa19aa33">getUseBridges</a>();<span class="comment"></span>
<a name="l00089"></a>00089 <span class="comment">  /** Sets to &lt;b&gt;useBridges&lt;/b&gt; whether Tor should try to use bridge nodes</span>
<a name="l00090"></a>00090 <span class="comment">   * to access the Tor network. */</span>
<a name="l00091"></a>00091   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#a82d762b9ab3f4dbc8b344cf5adeadfa2">setUseBridges</a>(<span class="keywordtype">bool</span> useBridges);
<a name="l00092"></a>00092 <span class="comment"></span>
<a name="l00093"></a>00093 <span class="comment">  /** Returns a list of bridge nodes Tor should use. */</span>
<a name="l00094"></a>00094   QStringList <a class="code" href="class_network_settings.html#a3fdeb020e11705d0bea8a79857ea2741">getBridgeList</a>();<span class="comment"></span>
<a name="l00095"></a>00095 <span class="comment">  /** Sets to &lt;b&gt;bridgeList&lt;/b&gt; the list of bridge nodes Tor should use. */</span>
<a name="l00096"></a>00096   <span class="keywordtype">void</span> <a class="code" href="class_network_settings.html#a6097f3473caa35ef08097db577984520">setBridgeList</a>(<span class="keyword">const</span> QStringList &amp;bridgeList);
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment">  /** Returns true if Tor is configured to try to tunnel its directory</span>
<a name="l00099"></a>00099 <span class="comment">   * connections through a one-hop circuit. */</span>
<a name="l00100"></a>00100   <span class="keywordtype">bool</span> <a class="code" href="class_network_settings.html#a8514746f2519a0e2f1e9b6c68c4e1e35">getTunnelDirConns</a>();
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00103"></a>00103 <span class="comment">  /** Converts the ProxyType &lt;b&gt;type&lt;/b&gt; to a string to store in the</span>
<a name="l00104"></a>00104 <span class="comment">   * configuration file. */</span>
<a name="l00105"></a>00105   QString <a class="code" href="class_network_settings.html#a78573ac3a57ebcf990253ac005e71b48">proxyTypeToString</a>(<a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">ProxyType</a> type);
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment">  /** Converts the proxy type string &lt;b&gt;type&lt;/b&gt; to its ProxyType counterpart. */</span>
<a name="l00108"></a>00108   <a class="code" href="class_network_settings.html#ad716228c2e5cb51a41889702589188ed">ProxyType</a> <a class="code" href="class_network_settings.html#a9d4dc3be450cc12eb8386bbd49ea99ab">proxyTypeFromString</a>(<span class="keyword">const</span> QString &amp;type);
<a name="l00109"></a>00109 };
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 <span class="preprocessor">#endif</span>
<a name="l00112"></a>00112 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:54 2010 for Vidalia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>