Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 9601c7beb4ff23e834bfa171795ed560 > files > 321

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: TorControl.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_67a2ce25601334632bdc5ef4a72c0f17.html">torcontrol</a>
  </div>
</div>
<div class="contents">
<h1>TorControl.h</h1><a href="_tor_control_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 </span>
<a name="l00004"></a>00004 <span class="comment">**  you did not receive the LICENSE file with this file, you may obtain it</span>
<a name="l00005"></a>00005 <span class="comment">**  from the 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</span>
<a name="l00008"></a>00008 <span class="comment">**  the 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 TorControl.h</span>
<a name="l00013"></a>00013 <span class="comment">** \version $Id: TorControl.h 4060 2009-08-20 03:41:13Z edmanm $</span>
<a name="l00014"></a>00014 <span class="comment">** \brief Object for interacting with the Tor process and control interface</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _TORCONTROL_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _TORCONTROL_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="tcglobal_8h.html">tcglobal.h</a>&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="_control_connection_8h.html">ControlConnection.h</a>&quot;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;<a class="code" href="_tor_process_8h.html">TorProcess.h</a>&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="_tor_events_8h.html">TorEvents.h</a>&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;<a class="code" href="_tor_signal_8h.html">TorSignal.h</a>&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="_router_descriptor_8h.html">RouterDescriptor.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="_router_status_8h.html">RouterStatus.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="_bootstrap_status_8h.html">BootstrapStatus.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="_circuit_8h.html">Circuit.h</a>&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="_stream_8h.html">Stream.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="_address_map_8h.html">AddressMap.h</a>&quot;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#if defined(Q_OS_WIN32)</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="_tor_service_8h.html">TorService.h</a>&quot;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#endif</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;QObject&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;QHash&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00039"></a>00039 <span class="preprocessor">#include &lt;QStringList&gt;</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;QVariantMap&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="_tor_control_8h.html#a53ee5ca0a1f990092916e579bb23103a">00042</a> <span class="keyword">class </span><a class="code" href="class_protocol_info.html">ProtocolInfo</a>;
<a name="l00043"></a>00043 <span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">/** DescriptorAnnotations stores a map of annotation keys to (possibly empty)</span>
<a name="l00045"></a>00045 <span class="comment"> * annotation values. */</span>
<a name="l00046"></a>00046 <span class="keyword">typedef</span> QHash&lt;QString,QString&gt; <a class="code" href="_tor_control_8h.html#a53ee5ca0a1f990092916e579bb23103a">DescriptorAnnotations</a>;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 
<a name="l00049"></a><a class="code" href="class_tor_control.html">00049</a> <span class="keyword">class </span><a class="code" href="class_tor_control.html">TorControl</a> : <span class="keyword">public</span> QObject
<a name="l00050"></a>00050 {
<a name="l00051"></a>00051   Q_OBJECT
<a name="l00052"></a>00052   
<a name="l00053"></a>00053 <span class="keyword">public</span>:<span class="comment"></span>
<a name="l00054"></a>00054 <span class="comment">  /** Default constructor */</span>
<a name="l00055"></a>00055   <a class="code" href="class_tor_control.html#a3bcb4b2f38f0ddb34d45b417c847082e">TorControl</a>();<span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">  /** Default destructor */</span>
<a name="l00057"></a>00057   <a class="code" href="class_tor_control.html#aeb845e44a8ceadf02d6df31cbf93e819">~TorControl</a>();
<a name="l00058"></a>00058 <span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">  /** Start the Tor process */</span>
<a name="l00060"></a>00060   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a473cddffe582b00988f58a7e8cd8d12d">start</a>(<span class="keyword">const</span> QString &amp;tor, <span class="keyword">const</span> QStringList &amp;args);<span class="comment"></span>
<a name="l00061"></a>00061 <span class="comment">  /** Stop the Tor process */</span>
<a name="l00062"></a>00062   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ae4a495462e3aa5db88502c58d1fa771f">stop</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00063"></a>00063 <span class="comment">  /** Detect if the Tor process is running */</span>
<a name="l00064"></a>00064   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#abe44c7f9281547aab2d317972519bd49">isRunning</a>();<span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">  /** Detects if the Tor process is running under Vidalia. */</span>
<a name="l00066"></a>00066   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a3b8daa188aa325d28d75c62219c56c71">isVidaliaRunningTor</a>();<span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">  /** Stops reading log messages from the Tor process&#39;s stdout. This has no</span>
<a name="l00068"></a>00068 <span class="comment">   * effect if isVidaliaRunningTor() is false. */</span>
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aff3b0c7fe437bbfc27c0705b5ac569ee">closeTorStdout</a>();
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">  /** Connect to Tor&#39;s control socket */</span>
<a name="l00072"></a>00072   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a5395e9f73ba5686b50763f23b63c2741">connect</a>(<span class="keyword">const</span> QHostAddress &amp;address, quint16 port);<span class="comment"></span>
<a name="l00073"></a>00073 <span class="comment">  /** Disconnect from Tor&#39;s control socket */</span>
<a name="l00074"></a>00074   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a60f52470bbc94d0939b08e0d022e138e">disconnect</a>();<span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment">  /** Check if we&#39;re connected to Tor&#39;s control socket */</span>
<a name="l00076"></a>00076   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a5e39e327ca6c4ef5b4e2ce770a81a59f">isConnected</a>();<span class="comment"></span>
<a name="l00077"></a>00077 <span class="comment">  /** Sends an authentication cookie to Tor. */</span>
<a name="l00078"></a>00078   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a2aa1d6903e8180eb685963bbf8f62b19">authenticate</a>(<span class="keyword">const</span> QByteArray cookie, QString *errmsg = 0);<span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">  /** Sends an authentication password to Tor. */</span>
<a name="l00080"></a>00080   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a2aa1d6903e8180eb685963bbf8f62b19">authenticate</a>(<span class="keyword">const</span> QString &amp;password = QString(), QString *errmsg = 0);
<a name="l00081"></a>00081   <span class="comment"></span>
<a name="l00082"></a>00082 <span class="comment">  /** Sends a PROTOCOLINFO command to Tor and parses the response. */</span>
<a name="l00083"></a>00083   <a class="code" href="class_protocol_info.html">ProtocolInfo</a> <a class="code" href="class_tor_control.html#ae8585adc887fffe1aa2ce276b01dd99d">protocolInfo</a>(QString *errmsg = 0);
<a name="l00084"></a>00084 <span class="comment"></span>
<a name="l00085"></a>00085 <span class="comment">  /** Returns the Tor software&#39;s current bootstrap phase and status. */</span>
<a name="l00086"></a>00086   <a class="code" href="class_bootstrap_status.html">BootstrapStatus</a> <a class="code" href="class_tor_control.html#a1f43146b9e125f2229a23f3509f73cf7">bootstrapStatus</a>(QString *errmsg = 0);
<a name="l00087"></a>00087 <span class="comment"></span>
<a name="l00088"></a>00088 <span class="comment">  /** Returns true if Tor either has an open circuit or (on Tor &gt;= </span>
<a name="l00089"></a>00089 <span class="comment">   * 0.2.0.1-alpha) has previously decided it&#39;s able to establish a circuit. */</span>
<a name="l00090"></a>00090   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a2b389a9436a6beb699dac04b95ace7ac">isCircuitEstablished</a>();
<a name="l00091"></a>00091 <span class="comment"></span>
<a name="l00092"></a>00092 <span class="comment">  /** Sends a GETINFO message to Tor based on the given keys */</span>
<a name="l00093"></a>00093   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a7bb6236b41505b30e8708c9f5cf8e8f7">getInfo</a>(QHash&lt;QString,QString&gt; &amp;map, QString *errmsg = 0);<span class="comment"></span>
<a name="l00094"></a>00094 <span class="comment">  /** Sends a GETINFO message for a single info value to Tor */</span>
<a name="l00095"></a>00095   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a7bb6236b41505b30e8708c9f5cf8e8f7">getInfo</a>(QString key, QString &amp;val, QString *errmsg = 0);
<a name="l00096"></a>00096 <span class="comment"></span>
<a name="l00097"></a>00097 <span class="comment">  /** Sends a GETINFO message to Tor using the given list of &lt;b&gt;keys&lt;/b&gt; and</span>
<a name="l00098"></a>00098 <span class="comment">   * returns a QVariantMap containing the specified keys and their values as</span>
<a name="l00099"></a>00099 <span class="comment">   * returned by Tor. Returns a default constructed QVariantMap on failure. */</span>
<a name="l00100"></a>00100   QVariantMap <a class="code" href="class_tor_control.html#a7bb6236b41505b30e8708c9f5cf8e8f7">getInfo</a>(<span class="keyword">const</span> QStringList &amp;keys, QString *errmsg = 0);<span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment">  /** Sends a GETINFO message to Tor with a single &lt;b&gt;key&lt;/b&gt; and returns a</span>
<a name="l00102"></a>00102 <span class="comment">   * QVariant containing the value returned by Tor. Returns a default</span>
<a name="l00103"></a>00103 <span class="comment">   * constructed QVariant on failure. */</span>
<a name="l00104"></a>00104   QVariant <a class="code" href="class_tor_control.html#a7bb6236b41505b30e8708c9f5cf8e8f7">getInfo</a>(<span class="keyword">const</span> QString &amp;key, QString *errmsg = 0);
<a name="l00105"></a>00105 <span class="comment"></span>
<a name="l00106"></a>00106 <span class="comment">  /** Sends a signal to Tor */</span>
<a name="l00107"></a>00107   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a373ecec8dbb7af273099d72a82a4d797">signal</a>(<a class="code" href="class_tor_signal.html#ab1820803604813483f918d131bcf281f">TorSignal::Signal</a> sig, QString *errmsg = 0);
<a name="l00108"></a>00108  <span class="comment"></span>
<a name="l00109"></a>00109 <span class="comment">  /** Returns an address on which Tor is listening for application</span>
<a name="l00110"></a>00110 <span class="comment">   * requests. If none are available, a null QHostAddress is returned. */</span>
<a name="l00111"></a>00111   QHostAddress <a class="code" href="class_tor_control.html#a2fb569a54bd8c0e73e81ba76a28f47fc">getSocksAddress</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00112"></a>00112 <span class="comment">  /** Returns a (possibly empty) list of all currently configured </span>
<a name="l00113"></a>00113 <span class="comment">   * SocksListenAddress entries. */</span>
<a name="l00114"></a>00114   QStringList <a class="code" href="class_tor_control.html#af00e73ae83a68ff12f076244356d6913">getSocksAddressList</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00115"></a>00115 <span class="comment">  /** Returns a valid SOCKS port for Tor, or 0 if Tor is not accepting</span>
<a name="l00116"></a>00116 <span class="comment">   * application requests. */</span>
<a name="l00117"></a>00117   quint16 <a class="code" href="class_tor_control.html#ac58ed8ff6dc3a7fdf7fe16779e444b9a">getSocksPort</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00118"></a>00118 <span class="comment">  /** Returns a list of all currently configured SOCKS ports. If Tor is not</span>
<a name="l00119"></a>00119 <span class="comment">   * accepting any application connections, an empty list will be returned. */</span>
<a name="l00120"></a>00120   QList&lt;quint16&gt; <a class="code" href="class_tor_control.html#a927de53d699f7a8fe44d91672240b8e0">getSocksPortList</a>(QString *errmsg = 0);
<a name="l00121"></a>00121 <span class="comment"></span>
<a name="l00122"></a>00122 <span class="comment">  /** Returns Tor&#39;s version as a string. */</span>
<a name="l00123"></a>00123   QString <a class="code" href="class_tor_control.html#aea1d9b4599cd0c5800f7c063f03a5262">getTorVersionString</a>();<span class="comment"></span>
<a name="l00124"></a>00124 <span class="comment">  /** Returns Tor&#39;s version as a numeric value. */</span>
<a name="l00125"></a>00125   quint32 <a class="code" href="class_tor_control.html#acd37862e652425dec4329acef6df4f3e">getTorVersion</a>();
<a name="l00126"></a>00126 <span class="comment"></span>
<a name="l00127"></a>00127 <span class="comment">  /** Sets an event and its handler. If add is true, then the event is added,</span>
<a name="l00128"></a>00128 <span class="comment">   * otherwise it is removed. If set is true, then the given event will be</span>
<a name="l00129"></a>00129 <span class="comment">   * registered with Tor. */</span>
<a name="l00130"></a>00130   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ab3dd744e5f82c562ef380a8ca447c3a3">setEvent</a>(<a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">TorEvents::Event</a> e, <span class="keywordtype">bool</span> add = <span class="keyword">true</span>, <span class="keywordtype">bool</span> <span class="keyword">set</span> = <span class="keyword">true</span>,
<a name="l00131"></a>00131                 QString *errmsg = 0);<span class="comment"></span>
<a name="l00132"></a>00132 <span class="comment">  /** Register events of interest with Tor */</span>
<a name="l00133"></a>00133   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a303b58f6d75569ee54478d55ede26464">setEvents</a>(QString *errmsg = 0);
<a name="l00134"></a>00134 <span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment">  /** Sets each configuration key in &lt;b&gt;map&lt;/b&gt; to the value associated with its key. */</span>
<a name="l00136"></a>00136   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#acd33beb0663b2a464a101c4efb425708">setConf</a>(QHash&lt;QString,QString&gt; map, QString *errmsg = 0);<span class="comment"></span>
<a name="l00137"></a>00137 <span class="comment">  /** Sets a single configuration key to the given value. */</span>
<a name="l00138"></a>00138   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#acd33beb0663b2a464a101c4efb425708">setConf</a>(QString key, QString value, QString *errmsg = 0);<span class="comment"></span>
<a name="l00139"></a>00139 <span class="comment">  /** Sets a single configuration string that is formatted &lt;key=escaped value&gt;. */</span>
<a name="l00140"></a>00140   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#acd33beb0663b2a464a101c4efb425708">setConf</a>(QString keyAndValue, QString *errmsg = 0);<span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment">  /** Gets values for a set of configuration keys, each of which has a single</span>
<a name="l00142"></a>00142 <span class="comment">   * value. */</span>
<a name="l00143"></a>00143   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(QHash&lt;QString,QString&gt; &amp;map, QString *errmsg = 0);<span class="comment"></span>
<a name="l00144"></a>00144 <span class="comment">  /** Gets a set of configuration keyvalues and stores them in &lt;b&gt;map&lt;/b&gt;. */</span>
<a name="l00145"></a>00145   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(QHash&lt;QString,QStringList&gt; &amp;map, QString *errmsg = 0);<span class="comment"></span>
<a name="l00146"></a>00146 <span class="comment">  /** Gets a single configuration value for &lt;b&gt;key&lt;/b&gt;. */</span>
<a name="l00147"></a>00147   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(QString key, QString &amp;value, QString *errmsg = 0);<span class="comment"></span>
<a name="l00148"></a>00148 <span class="comment">  /** Gets a list of configuration values for &lt;b&gt;key&lt;/b&gt;. */</span>
<a name="l00149"></a>00149   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(QString key, QStringList &amp;value, QString *errmsg = 0);
<a name="l00150"></a>00150 <span class="comment"></span>
<a name="l00151"></a>00151 <span class="comment">  /** Sends a GETCONF message to Tor using the given list of &lt;b&gt;keys&lt;/b&gt; and</span>
<a name="l00152"></a>00152 <span class="comment">   * returns a QVariantMap containing the specified keys and their values as</span>
<a name="l00153"></a>00153 <span class="comment">   * returned by Tor. Returns a default constructed QVariantMap on failure. */</span>
<a name="l00154"></a>00154   QVariantMap <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(<span class="keyword">const</span> QStringList &amp;keys, QString *errmsg = 0);<span class="comment"></span>
<a name="l00155"></a>00155 <span class="comment">  /** Sends a GETCONF message to Tor with a single &lt;b&gt;key&lt;/b&gt; and returns a</span>
<a name="l00156"></a>00156 <span class="comment">   * QVariant containing the value returned by Tor. Returns a default</span>
<a name="l00157"></a>00157 <span class="comment">   * constructed QVariant on failure. */</span>
<a name="l00158"></a>00158   QVariant <a class="code" href="class_tor_control.html#ace854634f48d61319bcfd73b134aeba1">getConf</a>(<span class="keyword">const</span> QString &amp;key, QString *errmsg = 0);<span class="comment"></span>
<a name="l00159"></a>00159 <span class="comment">  /** Sends a GETCONF message to Tor with the single key and returns a QString</span>
<a name="l00160"></a>00160 <span class="comment">   * containing the value returned by Tor */</span>
<a name="l00161"></a>00161   QString <a class="code" href="class_tor_control.html#a75f4cc50bb7c17f3cedc2822a47bcd0c">getHiddenServiceConf</a>(<span class="keyword">const</span> QString &amp;key, QString *errmsg = 0);
<a name="l00162"></a>00162   <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">  /** Asks Tor to save the current configuration to its torrc */</span>
<a name="l00164"></a>00164   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a020ad2cfbd1adbfeda679aebb4bac966">saveConf</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00165"></a>00165 <span class="comment">  /** Tells Tor to reset the given configuration keys back to defaults. */</span>
<a name="l00166"></a>00166   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#aba22570eab1b0ca3735d1a32dbcd3de9">resetConf</a>(QStringList keys, QString *errmsg = 0);<span class="comment"></span>
<a name="l00167"></a>00167 <span class="comment">  /** Tells Tor to reset a configuration key back to its default value. */</span>
<a name="l00168"></a>00168   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#aba22570eab1b0ca3735d1a32dbcd3de9">resetConf</a>(QString key, QString *errmsg = 0);
<a name="l00169"></a>00169 <span class="comment"></span>
<a name="l00170"></a>00170 <span class="comment">  /** Returns an unparsed router descriptor for the router whose fingerprint</span>
<a name="l00171"></a>00171 <span class="comment">   * matches &lt;b&gt;id&lt;/b&gt;. The returned text can later be parsed by the</span>
<a name="l00172"></a>00172 <span class="comment">   * RouterDescriptor class. If &lt;b&gt;id&lt;/b&gt; is invalid, then an empty</span>
<a name="l00173"></a>00173 <span class="comment">   * QStringList is returned. */</span>
<a name="l00174"></a>00174   QStringList <a class="code" href="class_tor_control.html#a4e1892fd5e35f076ac199936c3446b53">getRouterDescriptorText</a>(<span class="keyword">const</span> QString &amp;<span class="keywordtype">id</span>, QString *errmsg = 0);<span class="comment"></span>
<a name="l00175"></a>00175 <span class="comment">  /** Returns the descriptor for the router whose fingerprint matches</span>
<a name="l00176"></a>00176 <span class="comment">   * &lt;b&gt;id&lt;/b&gt;. If &lt;b&gt;id&lt;/b&gt; is invalid or the router&#39;s descriptor cannot be</span>
<a name="l00177"></a>00177 <span class="comment">   * parsed, then an invalid RouterDescriptor is returned. */</span>
<a name="l00178"></a>00178   <a class="code" href="class_router_descriptor.html">RouterDescriptor</a> <a class="code" href="class_tor_control.html#ad308e247d95f72400da3dfaf107477e0">getRouterDescriptor</a>(<span class="keyword">const</span> QString &amp;<span class="keywordtype">id</span>, QString *errmsg = 0);<span class="comment"></span>
<a name="l00179"></a>00179 <span class="comment">  /** Returns the status of the router whose fingerprint matches &lt;b&gt;id&lt;/b&gt;. If</span>
<a name="l00180"></a>00180 <span class="comment">   * &lt;b&gt;id&lt;/b&gt; is invalid or the router&#39;s status cannot be parsed, then an</span>
<a name="l00181"></a>00181 <span class="comment">   * invalid RouterStatus is returned. */</span>
<a name="l00182"></a>00182   <a class="code" href="class_router_status.html">RouterStatus</a> <a class="code" href="class_tor_control.html#a25362380480443a5c1cbe37b64efee1c">getRouterStatus</a>(<span class="keyword">const</span> QString &amp;<span class="keywordtype">id</span>, QString *errmsg = 0);<span class="comment"></span>
<a name="l00183"></a>00183 <span class="comment">  /** Returns a RouterStatus object for every known router in the network. If</span>
<a name="l00184"></a>00184 <span class="comment">   * the network status document cannot be parsed, then an empty NetworkStatus</span>
<a name="l00185"></a>00185 <span class="comment">   * is returned. */</span>
<a name="l00186"></a>00186   <a class="code" href="_router_status_8h.html#a0043af5f764cd62f178e35cbd74f494b">NetworkStatus</a> <a class="code" href="class_tor_control.html#a43e60487d83b03bf401afddb0a17a60a">getNetworkStatus</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00187"></a>00187 <span class="comment">  /** Returns the annotations for the router whose fingerprint matches</span>
<a name="l00188"></a>00188 <span class="comment">   * &lt;b&gt;id&lt;/b&gt;. If &lt;b&gt;id&lt;/b&gt; is invalid or the router&#39;s descriptor cannot be</span>
<a name="l00189"></a>00189 <span class="comment">   * parsed, then an empty DescriptorAnnotations is returned and</span>
<a name="l00190"></a>00190 <span class="comment">   * &lt;b&gt;errmsg&lt;/b&gt; is set if it&#39;s not NULL. (Tor &gt;= 0.2.0.13-alpha only) */</span>
<a name="l00191"></a>00191   <a class="code" href="_tor_control_8h.html#a53ee5ca0a1f990092916e579bb23103a">DescriptorAnnotations</a> <a class="code" href="class_tor_control.html#a98b04340a13e19df051c5d533a4419b1">getDescriptorAnnotations</a>(<span class="keyword">const</span> QString &amp;<span class="keywordtype">id</span>,
<a name="l00192"></a>00192                                                  QString *errmsg = 0);
<a name="l00193"></a>00193 <span class="comment"></span>
<a name="l00194"></a>00194 <span class="comment">  /** Gets a list of current circuits. */</span>
<a name="l00195"></a>00195   <a class="code" href="_circuit_8h.html#a5c7c01bcee10c15862fdf844c3d1538c">CircuitList</a> <a class="code" href="class_tor_control.html#ab2180f731d4e74f83441618a62c036d6">getCircuits</a>(QString *errmsg = 0);<span class="comment"></span>
<a name="l00196"></a>00196 <span class="comment">  /** Gets a list of current streams. */</span>
<a name="l00197"></a>00197   <a class="code" href="_stream_8h.html#ab96e42e030d3b02d7f4a4d69cf7a98e0">StreamList</a> <a class="code" href="class_tor_control.html#ada4852a5804eafaebfd26eaaee3859ab">getStreams</a>(QString *errmsg = 0);
<a name="l00198"></a>00198   <span class="comment"></span>
<a name="l00199"></a>00199 <span class="comment">  /** Gets a list of address mappings of the type specified by &lt;b&gt;type&lt;/b&gt;</span>
<a name="l00200"></a>00200 <span class="comment">   * (defaults to &lt;i&gt;AddressMapAll&lt;/i&gt;. */</span>
<a name="l00201"></a>00201   <a class="code" href="class_address_map.html">AddressMap</a> <a class="code" href="class_tor_control.html#a3fa594dd2b11b0451fdeca36bbd7c18d">getAddressMap</a>(
<a name="l00202"></a>00202     <a class="code" href="class_address_map.html#a06fbb154318e85e74c8f910bc919c699">AddressMap::AddressMapType</a> type = <a class="code" href="class_address_map.html#a06fbb154318e85e74c8f910bc919c699a51c09671b349aa01898a627a03932c39">AddressMap::AddressMapAll</a>,
<a name="l00203"></a>00203     QString *errmsg = 0);
<a name="l00204"></a>00204 
<a name="l00205"></a>00205 <span class="keyword">public</span> slots:<span class="comment"></span>
<a name="l00206"></a>00206 <span class="comment">  /** Closes the circuit specified by &lt;b&gt;circId&lt;/b&gt;. If &lt;b&gt;ifUnused&lt;/b&gt; is</span>
<a name="l00207"></a>00207 <span class="comment">   * true, then the circuit will not be closed unless it is unused. */</span>
<a name="l00208"></a>00208   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a7a1234a058e1c09c9c30fc77b41ba1ea">closeCircuit</a>(<span class="keyword">const</span> <a class="code" href="_circuit_8h.html#a8b7b0182a6d1ff0aab7ab31df9c3f83d">CircuitId</a> &amp;circId, <span class="keywordtype">bool</span> ifUnused = <span class="keyword">false</span>,
<a name="l00209"></a>00209                     QString *errmsg = 0);<span class="comment"></span>
<a name="l00210"></a>00210 <span class="comment">  /** Closes the stream specified by &lt;b&gt;streamId&lt;/b&gt;. */</span>
<a name="l00211"></a>00211   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#aa93a27e4936ed77d45aab1eaf16539ed">closeStream</a>(<span class="keyword">const</span> <a class="code" href="_stream_8h.html#a90d94d8a7b979b4c7e07f5869a431064">StreamId</a> &amp;streamId, QString *errmsg = 0);
<a name="l00212"></a>00212 
<a name="l00213"></a>00213 signals:<span class="comment"></span>
<a name="l00214"></a>00214 <span class="comment">  /** Emitted when the Tor process has started */</span>
<a name="l00215"></a>00215   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ab4e8473e774ba83aeb3f031628d5b8f8">started</a>();<span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">  /** Emitted when the Tor process fails to start. */</span>
<a name="l00217"></a>00217   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a783be13ea1c7bece803f085cc65e3272">startFailed</a>(QString errmsg);<span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment">  /** Emitted when the Tor process has stopped */</span>
<a name="l00219"></a>00219   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a3a43d3d21293f2238ac19eec9262837c">stopped</a>(<span class="keywordtype">int</span> exitCode, QProcess::ExitStatus exitStatus);<span class="comment"></span>
<a name="l00220"></a>00220 <span class="comment">  /** Emitted when the Tor process has stopped. */</span>
<a name="l00221"></a>00221   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a3a43d3d21293f2238ac19eec9262837c">stopped</a>();<span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">  /** Emitted when the controller has connected to Tor */</span>
<a name="l00223"></a>00223   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a3ad15312fbcaaec7436602d8f3905b43">connected</a>();<span class="comment"></span>
<a name="l00224"></a>00224 <span class="comment">  /** Emitted when the controller failed to connect to Tor. */</span>
<a name="l00225"></a>00225   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a5aa616427f91b9d28b7e6ab2631eca88">connectFailed</a>(QString errmsg);<span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment">  /** Emitted when the controller has disconnected from Tor */</span>
<a name="l00227"></a>00227   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ac1558d714cedb526cb8996059a9b6f05">disconnected</a>();<span class="comment"></span>
<a name="l00228"></a>00228 <span class="comment">  /** Emitted when the control socket is connected and authenticated. */</span>
<a name="l00229"></a>00229   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a5233d923de9e4c5220c54bf88affcce2">authenticated</a>();<span class="comment"></span>
<a name="l00230"></a>00230 <span class="comment">  /** Emitted when Tor rejects our authentication attempt. */</span>
<a name="l00231"></a>00231   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a89b5f36c6fc54e84c39002443a929a1c">authenticationFailed</a>(QString errmsg);
<a name="l00232"></a>00232 <span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">  /** Emitted when Tor writes the message &lt;b&gt;msg&lt;/b&gt; to the control port</span>
<a name="l00234"></a>00234 <span class="comment">   * with message severity &lt;b&gt;level&lt;/b&gt;.</span>
<a name="l00235"></a>00235 <span class="comment">   */</span>
<a name="l00236"></a>00236   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a9c881f31a2afc32ba6c488f247c20bc8">logMessage</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> level, <span class="keyword">const</span> QString &amp;msg);
<a name="l00237"></a>00237 <span class="comment"></span>
<a name="l00238"></a>00238 <span class="comment">  /** Emitted when Tor sends a bandwidth usage update (roughly once every</span>
<a name="l00239"></a>00239 <span class="comment">   * second). &lt;b&gt;bytesReceived&lt;/b&gt; is the number of bytes read by Tor over</span>
<a name="l00240"></a>00240 <span class="comment">   * the previous second and &lt;b&gt;bytesWritten&lt;/b&gt; is the number of bytes</span>
<a name="l00241"></a>00241 <span class="comment">   * sent over the same interval.</span>
<a name="l00242"></a>00242 <span class="comment">   */</span>
<a name="l00243"></a>00243   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a85ad0e4ccd9c7b37ddf91c694f5c3651">bandwidthUpdate</a>(quint64 bytesReceived, quint64 bytesSent);
<a name="l00244"></a>00244 <span class="comment"></span>
<a name="l00245"></a>00245 <span class="comment">  /** Emitted when the stream status of &lt;b&gt;stream&lt;/b&gt; has changed.</span>
<a name="l00246"></a>00246 <span class="comment">   */</span>
<a name="l00247"></a>00247   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aa8bbc2d13f1e8c1c4f564172b5db6a5b">streamStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_stream.html">Stream</a> &amp;stream);
<a name="l00248"></a>00248 <span class="comment"></span>
<a name="l00249"></a>00249 <span class="comment">  /** Emitted when the circuit status of &lt;b&gt;circuit&lt;/b&gt; has changed.</span>
<a name="l00250"></a>00250 <span class="comment">   */</span>
<a name="l00251"></a>00251   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a607627fbee13b0292408f558994634a5">circuitStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_circuit.html">Circuit</a> &amp;circuit);
<a name="l00252"></a>00252 <span class="comment"></span>
<a name="l00253"></a>00253 <span class="comment">  /** Emitted when Tor has mapped the address &lt;b&gt;from&lt;/b&gt; to the address</span>
<a name="l00254"></a>00254 <span class="comment">   * &lt;b&gt;to&lt;/b&gt;. &lt;b&gt;expires&lt;/b&gt; indicates the time at which when the address</span>
<a name="l00255"></a>00255 <span class="comment">   * mapping will no longer be considered valid.</span>
<a name="l00256"></a>00256 <span class="comment">   */</span>
<a name="l00257"></a>00257   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a472410fd4c295304639dfa3191b78530">addressMapped</a>(<span class="keyword">const</span> QString &amp;from, <span class="keyword">const</span> QString &amp;to,
<a name="l00258"></a>00258                      <span class="keyword">const</span> QDateTime &amp;expires);
<a name="l00259"></a>00259 <span class="comment"></span>
<a name="l00260"></a>00260 <span class="comment">  /** Emitted when Tor has received one or more new router descriptors.</span>
<a name="l00261"></a>00261 <span class="comment">   * &lt;b&gt;ids&lt;/b&gt; contains a list of digests of the new descriptors.</span>
<a name="l00262"></a>00262 <span class="comment">   */</span>
<a name="l00263"></a>00263   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a352852cedb94e6e753a62035a1c73535">newDescriptors</a>(<span class="keyword">const</span> QStringList &amp;ids);
<a name="l00264"></a>00264 <span class="comment"></span>
<a name="l00265"></a>00265 <span class="comment">  /** Indicates Tor has been able to successfully establish one or more</span>
<a name="l00266"></a>00266 <span class="comment">   * circuits.</span>
<a name="l00267"></a>00267 <span class="comment">   */</span>
<a name="l00268"></a>00268   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a28b4b60a0092a39dbe1484e3193dcb83">circuitEstablished</a>();
<a name="l00269"></a>00269 <span class="comment"></span>
<a name="l00270"></a>00270 <span class="comment">  /** Indicates that Tor has decided the user&#39;s Tor software &lt;b&gt;version&lt;/b&gt;</span>
<a name="l00271"></a>00271 <span class="comment">   * is no longer recommended for some &lt;b&gt;reason&lt;/b&gt;. &lt;b&gt;recommended&lt;/b&gt; is</span>
<a name="l00272"></a>00272 <span class="comment">   * a list of Tor software versions that are considered current.</span>
<a name="l00273"></a>00273 <span class="comment">   */</span>
<a name="l00274"></a>00274   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a564b2d92a1107cee2280966c67fd847f">dangerousTorVersion</a>(<a class="code" href="namespacetc.html#a8389db682e80cb6921e26b529e2ec52c">tc::TorVersionStatus</a> reason,
<a name="l00275"></a>00275                            <span class="keyword">const</span> QString &amp;version,
<a name="l00276"></a>00276                            <span class="keyword">const</span> QStringList &amp;recommended);
<a name="l00277"></a>00277 <span class="comment"></span>
<a name="l00278"></a>00278 <span class="comment">  /** Emitted during Tor&#39;s startup process to indicate how far in its</span>
<a name="l00279"></a>00279 <span class="comment">   * bootstrapping process it has progressed. &lt;b&gt;status&lt;/b&gt; may indicate</span>
<a name="l00280"></a>00280 <span class="comment">   * the current bootstrapping stage or an error during bootstrapping.</span>
<a name="l00281"></a>00281 <span class="comment">   */</span>
<a name="l00282"></a>00282   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aa2fc6aab78e45f29cd2366a62cd937d6">bootstrapStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_bootstrap_status.html">BootstrapStatus</a> &amp;status);
<a name="l00283"></a>00283 <span class="comment"></span>
<a name="l00284"></a>00284 <span class="comment">  /** Emitted when the user attempts to establish a connection to some</span>
<a name="l00285"></a>00285 <span class="comment">   * destination on port &lt;b&gt;port&lt;/b&gt;, which is a port known to use</span>
<a name="l00286"></a>00286 <span class="comment">   * plaintext connections (as determined by Tor&#39;s WarnPlaintextPorts and</span>
<a name="l00287"></a>00287 <span class="comment">   * RejectPlaintextPorts torrc options). &lt;b&gt;rejected&lt;/b&gt; indicates whether</span>
<a name="l00288"></a>00288 <span class="comment">   * Tor rejected the connection or permitted it to connect anyway.</span>
<a name="l00289"></a>00289 <span class="comment">   */</span>
<a name="l00290"></a>00290   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aa21eaeb2d515025ab7b96f039c88a696">dangerousPort</a>(quint16 port, <span class="keywordtype">bool</span> rejected);
<a name="l00291"></a>00291 <span class="comment"></span>
<a name="l00292"></a>00292 <span class="comment">  /** Emitted when Tor detects a problem with a SOCKS connection from the</span>
<a name="l00293"></a>00293 <span class="comment">   * user, such as a bad hostname, dangerous SOCKS protocol type, or a bad</span>
<a name="l00294"></a>00294 <span class="comment">   * hostname. &lt;b&gt;type&lt;/b&gt; indicates the type of error encountered and</span>
<a name="l00295"></a>00295 <span class="comment">   * &lt;b&gt;destination&lt;/b&gt; (if non-empty) specifies the attempted connection</span>
<a name="l00296"></a>00296 <span class="comment">   * destination address or hostname.</span>
<a name="l00297"></a>00297 <span class="comment">   */</span>
<a name="l00298"></a>00298   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a7acccb4dc3af3bd2d9b1d71abfb67a8d">socksError</a>(<a class="code" href="namespacetc.html#ab29556af3a71a9c8768ab9ae1e822191">tc::SocksError</a> type, <span class="keyword">const</span> QString &amp;destination);
<a name="l00299"></a>00299 <span class="comment"></span>
<a name="l00300"></a>00300 <span class="comment">  /** Emitted when Tor decides the client&#39;s external IP address has changed</span>
<a name="l00301"></a>00301 <span class="comment">   * to &lt;b&gt;ip&lt;/b&gt;. If &lt;b&gt;hostname&lt;/b&gt; is non-empty, Tor obtained the new</span>
<a name="l00302"></a>00302 <span class="comment">   * value for &lt;b&gt;ip&lt;/b&gt; by resolving &lt;b&gt;hostname&lt;/b&gt;. </span>
<a name="l00303"></a>00303 <span class="comment">   */</span>
<a name="l00304"></a>00304   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a075796a1fd07b635de4650b35caa1c72">externalAddressChanged</a>(<span class="keyword">const</span> QHostAddress &amp;ip, <span class="keyword">const</span> QString &amp;hostname);
<a name="l00305"></a>00305 <span class="comment"></span>
<a name="l00306"></a>00306 <span class="comment">  /** Indicates that Tor has determined the client&#39;s clock is potentially</span>
<a name="l00307"></a>00307 <span class="comment">   * skewed by &lt;b&gt;skew&lt;/b&gt; seconds relative to &lt;b&gt;source&lt;/b&gt;.</span>
<a name="l00308"></a>00308 <span class="comment">   */</span>
<a name="l00309"></a>00309   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#acfa0a2e89f5a23da5f20119a40e7f030">clockSkewed</a>(<span class="keywordtype">int</span> skew, <span class="keyword">const</span> QString &amp;source);
<a name="l00310"></a>00310 <span class="comment"></span>
<a name="l00311"></a>00311 <span class="comment">  /** Emitted when Tor has encountered an internal bug. &lt;b&gt;reason&lt;/b&gt; is</span>
<a name="l00312"></a>00312 <span class="comment">   * Tor&#39;s description of the bug.</span>
<a name="l00313"></a>00313 <span class="comment">   */</span>
<a name="l00314"></a>00314   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aa53c9a7d4520ba1096c4c79d2caa6040">bug</a>(<span class="keyword">const</span> QString &amp;reason);
<a name="l00315"></a>00315 <span class="comment"></span>
<a name="l00316"></a>00316 <span class="comment">  /** Emitted when Tor determines that the user&#39;s DNS provider is providing</span>
<a name="l00317"></a>00317 <span class="comment">   * an address for non-existent domains when it should really be saying</span>
<a name="l00318"></a>00318 <span class="comment">   * &quot;NXDOMAIN&quot;.</span>
<a name="l00319"></a>00319 <span class="comment">   */</span>
<a name="l00320"></a>00320   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#abea0a2e32ce3d4ce21acd7550b99240e">dnsHijacked</a>();
<a name="l00321"></a>00321 <span class="comment"></span>
<a name="l00322"></a>00322 <span class="comment">  /** Emitted when Tor determines that the user&#39;s DNS provider is providing</span>
<a name="l00323"></a>00323 <span class="comment">   * a hijacked address even for well-known websites.</span>
<a name="l00324"></a>00324 <span class="comment">   */</span>
<a name="l00325"></a>00325   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a01e5e24bf02df357e0f4fb29199a8076">dnsUseless</a>();
<a name="l00326"></a>00326 <span class="comment"></span>
<a name="l00327"></a>00327 <span class="comment">  /** Indicates Tor has started testing the reachability of its OR port </span>
<a name="l00328"></a>00328 <span class="comment">   * using the IP address &lt;b&gt;ip&lt;/b&gt; and port &lt;b&gt;port&lt;/b&gt;.</span>
<a name="l00329"></a>00329 <span class="comment">   */</span>
<a name="l00330"></a>00330   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a836851a0ca43a810d46db7e5d5652b0c">checkingOrPortReachability</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00331"></a>00331 <span class="comment"></span>
<a name="l00332"></a>00332 <span class="comment">  /** Tor has completed testing the reachability of its OR port using</span>
<a name="l00333"></a>00333 <span class="comment">   * the IP address &lt;b&gt;ip&lt;/b&gt; and port &lt;b&gt;port&lt;/b&gt;. If the user&#39;s OR port</span>
<a name="l00334"></a>00334 <span class="comment">   * was reachable, &lt;b&gt;reachable&lt;/b&gt; will be set to true.</span>
<a name="l00335"></a>00335 <span class="comment">   */</span>
<a name="l00336"></a>00336   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ad859922c242da4d04724f1401933d9d7">orPortReachabilityFinished</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00337"></a>00337                                   <span class="keywordtype">bool</span> reachable);
<a name="l00338"></a>00338 <span class="comment"></span>
<a name="l00339"></a>00339 <span class="comment">  /** Indicates Tor has started testing the reachability of its directory</span>
<a name="l00340"></a>00340 <span class="comment">   * port using the IP address &lt;b&gt;ip&lt;/b&gt; and port &lt;b&gt;port&lt;/b&gt;.</span>
<a name="l00341"></a>00341 <span class="comment">   */</span>
<a name="l00342"></a>00342   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a2ab0973067a4bbfd1d330ab19fa9e740">checkingDirPortReachability</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00343"></a>00343 <span class="comment"></span>
<a name="l00344"></a>00344 <span class="comment">  /** Tor has completed testing the reachability of its directory port using</span>
<a name="l00345"></a>00345 <span class="comment">   * the IP address &lt;b&gt;ip&lt;/b&gt; and port &lt;b&gt;port&lt;/b&gt;. If the user&#39;s directory</span>
<a name="l00346"></a>00346 <span class="comment">   * port was reachable, &lt;b&gt;reachable&lt;/b&gt; will be set to true.</span>
<a name="l00347"></a>00347 <span class="comment">   */</span>
<a name="l00348"></a>00348   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#aef409a918c06974076095d947aa942cf">dirPortReachabilityFinished</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00349"></a>00349                                    <span class="keywordtype">bool</span> reachable);
<a name="l00350"></a>00350 <span class="comment"></span>
<a name="l00351"></a>00351 <span class="comment">  /** Emitted when the directory authority with IP address &lt;b&gt;ip&lt;/b&gt; and</span>
<a name="l00352"></a>00352 <span class="comment">   * port &lt;b&gt;port&lt;/b&gt; rejected the user&#39;s server descriptor. &lt;b&gt;reason&lt;/b&gt;</span>
<a name="l00353"></a>00353 <span class="comment">   * describes why the descriptor was rejected (e.g., malformed, skewed</span>
<a name="l00354"></a>00354 <span class="comment">   * clock, etc.).</span>
<a name="l00355"></a>00355 <span class="comment">   */</span>
<a name="l00356"></a>00356   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ae9663b94a72a6a120ece2b4671577262">serverDescriptorRejected</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00357"></a>00357                                 <span class="keyword">const</span> QString &amp;reason);
<a name="l00358"></a>00358 <span class="comment"></span>
<a name="l00359"></a>00359 <span class="comment">  /** Emitted when the directory authority with IP address &lt;b&gt;ip&lt;/b&gt; and</span>
<a name="l00360"></a>00360 <span class="comment">   * port &lt;b&gt;port&lt;/b&gt; accepted the user&#39;s server descriptor.</span>
<a name="l00361"></a>00361 <span class="comment">   */</span>
<a name="l00362"></a>00362   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ab70abe10e1362bc181ac6075d30f66bb">serverDescriptorAccepted</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00363"></a>00363 <span class="comment"></span>
<a name="l00364"></a>00364 <span class="comment">  /** Emitted when at least one directory authority has accepted the user&#39;s</span>
<a name="l00365"></a>00365 <span class="comment">   * server descriptor.</span>
<a name="l00366"></a>00366 <span class="comment">   */</span>
<a name="l00367"></a>00367   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ab70abe10e1362bc181ac6075d30f66bb">serverDescriptorAccepted</a>();
<a name="l00368"></a>00368 
<a name="l00369"></a>00369 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00370"></a>00370 <span class="comment">  /** Instantiates a connection used to talk to Tor&#39;s control port */</span>
<a name="l00371"></a><a class="code" href="class_tor_control.html#ac6ddb7eea451a3f7fd26188cdf18c1ef">00371</a>   <a class="code" href="class_control_connection.html">ControlConnection</a>* <a class="code" href="class_tor_control.html#ac6ddb7eea451a3f7fd26188cdf18c1ef">_controlConn</a>;<span class="comment"></span>
<a name="l00372"></a>00372 <span class="comment">  /** Manages and monitors the Tor process */</span>
<a name="l00373"></a><a class="code" href="class_tor_control.html#a611caf8981a576fc33ab2705b8435fa3">00373</a>   <a class="code" href="class_tor_process.html">TorProcess</a>* <a class="code" href="class_tor_control.html#a611caf8981a576fc33ab2705b8435fa3">_torProcess</a>;<span class="comment"></span>
<a name="l00374"></a>00374 <span class="comment">  /** Keep track of which events we&#39;re interested in */</span>
<a name="l00375"></a><a class="code" href="class_tor_control.html#ae5f6211f798be2e442b5fc3fb6f3d09e">00375</a>   <a class="code" href="class_tor_events.html">TorEvents</a>* <a class="code" href="class_tor_control.html#ae5f6211f798be2e442b5fc3fb6f3d09e">_eventHandler</a>;
<a name="l00376"></a><a class="code" href="class_tor_control.html#aecf9cf541ec32de0e7206b9a17a409f5">00376</a>   TorEvents::Events <a class="code" href="class_tor_control.html#aecf9cf541ec32de0e7206b9a17a409f5">_events</a>;<span class="comment"></span>
<a name="l00377"></a>00377 <span class="comment">  /** The version of Tor we&#39;re currently talking to. */</span>
<a name="l00378"></a><a class="code" href="class_tor_control.html#aa27560cf64f335477f0404ec28d24051">00378</a>   QString <a class="code" href="class_tor_control.html#aa27560cf64f335477f0404ec28d24051">_torVersion</a>;
<a name="l00379"></a>00379 <span class="preprocessor">#if defined(Q_OS_WIN32)</span>
<a name="l00380"></a>00380 <span class="preprocessor"></span><span class="comment">  /** Manages the Tor service, if supported and enabled */</span>
<a name="l00381"></a>00381   <a class="code" href="class_tor_service.html">TorService</a>* _torService;
<a name="l00382"></a>00382 <span class="preprocessor">#endif</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00384"></a>00384 <span class="comment">  /** Send a message to Tor and read the response */</span>
<a name="l00385"></a>00385   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a2f2b9eb90d984ae4cfdafb777897e322">send</a>(<a class="code" href="class_control_command.html">ControlCommand</a> cmd, <a class="code" href="class_control_reply.html">ControlReply</a> &amp;reply, QString *errmsg = 0);<span class="comment"></span>
<a name="l00386"></a>00386 <span class="comment">  /** Send a message to Tor and discard the response */</span>
<a name="l00387"></a>00387   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#a2f2b9eb90d984ae4cfdafb777897e322">send</a>(<a class="code" href="class_control_command.html">ControlCommand</a> cmd, QString *errmsg = 0);<span class="comment"></span>
<a name="l00388"></a>00388 <span class="comment">  /** Tells Tor the controller wants to enable &lt;b&gt;feature&lt;/b&gt; via the</span>
<a name="l00389"></a>00389 <span class="comment">   * USEFEATURE control command. Returns true if the given feature was</span>
<a name="l00390"></a>00390 <span class="comment">   * successfully enabled. */</span>
<a name="l00391"></a>00391   <span class="keywordtype">bool</span> <a class="code" href="class_tor_control.html#ac347e773fee2f68f16b445f131e164cf">useFeature</a>(<span class="keyword">const</span> QString &amp;feature, QString *errmsg = 0);
<a name="l00392"></a>00392 
<a name="l00393"></a>00393 <span class="comment">/* The slots below simply relay signals from the appropriate member objects */</span>
<a name="l00394"></a>00394 <span class="keyword">private</span> slots:
<a name="l00395"></a>00395   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a97b802a813f0f925d04a959a581ea939">onStopped</a>(<span class="keywordtype">int</span> exitCode, QProcess::ExitStatus exitStatus);
<a name="l00396"></a>00396   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ad5ce0ff3c3d2a316ef32a3758e170e39">onDisconnected</a>();
<a name="l00397"></a>00397   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#ae262d8b5b5eeebadf36fa14fe1cffe4e">onLogStdout</a>(<span class="keyword">const</span> QString &amp;severity, <span class="keyword">const</span> QString &amp;message);
<a name="l00398"></a>00398   <span class="keywordtype">void</span> <a class="code" href="class_tor_control.html#a197532cfd0b755b2ba5dad58cd043f59">onAuthenticated</a>();
<a name="l00399"></a>00399 };
<a name="l00400"></a>00400 
<a name="l00401"></a>00401 <span class="preprocessor">#endif</span>
<a name="l00402"></a>00402 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Aug 30 22:58:55 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>