Sophie

Sophie

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

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: TorEvents.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>TorEvents.h</h1><a href="_tor_events_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 TorEvents.h</span>
<a name="l00013"></a>00013 <span class="comment">** \version $Id: TorEvents.h 4060 2009-08-20 03:41:13Z edmanm $</span>
<a name="l00014"></a>00014 <span class="comment">** \brief Parses and dispatches events from Tor</span>
<a name="l00015"></a>00015 <span class="comment">*/</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef _TOREVENTS_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define _TOREVENTS_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 
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;QObject&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;QMultiHash&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;QFlags&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">class </span><a class="code" href="class_circuit.html">Circuit</a>;
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="class_stream.html">Stream</a>;
<a name="l00029"></a>00029 <span class="keyword">class </span><a class="code" href="class_bootstrap_status.html">BootstrapStatus</a>;
<a name="l00030"></a>00030 <span class="keyword">class </span><a class="code" href="class_control_reply.html">ControlReply</a>;
<a name="l00031"></a>00031 <span class="keyword">class </span><a class="code" href="class_reply_line.html">ReplyLine</a>;
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">class </span>QString;
<a name="l00034"></a>00034 <span class="keyword">class </span>QDateTime;
<a name="l00035"></a>00035 <span class="keyword">class </span>QHostAddress;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="class_tor_events.html">00038</a> <span class="keyword">class </span><a class="code" href="class_tor_events.html">TorEvents</a> : <span class="keyword">public</span> QObject
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040   Q_OBJECT
<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">  /** Asynchronous events sent from Tor to the controller */</span>
<a name="l00044"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">00044</a>   <span class="keyword">enum</span> <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> {
<a name="l00045"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfacd780c024e79d1b356c6338fcbfbb9c6">00045</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfacd780c024e79d1b356c6338fcbfbb9c6">Unknown</a>       = 0,
<a name="l00046"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa37aa333e6b9acdb8cf240fbafeba4e38">00046</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa37aa333e6b9acdb8cf240fbafeba4e38">Bandwidth</a>     = (1u &lt;&lt; 0),
<a name="l00047"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa4920e9d8dc81811068c197c2dcb4661a">00047</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa4920e9d8dc81811068c197c2dcb4661a">LogDebug</a>      = (1u &lt;&lt; 1),
<a name="l00048"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf829e003d41f5c29746c593273107013">00048</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf829e003d41f5c29746c593273107013">LogInfo</a>       = (1u &lt;&lt; 2),
<a name="l00049"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf6c5726f1703ac0dbefb3753383d1c54">00049</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf6c5726f1703ac0dbefb3753383d1c54">LogNotice</a>     = (1u &lt;&lt; 3),
<a name="l00050"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaecfea72c14b492ec436d71991b11a4f4">00050</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaecfea72c14b492ec436d71991b11a4f4">LogWarn</a>       = (1u &lt;&lt; 4),
<a name="l00051"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa1588b65cd76aad1ada9925be377eee27">00051</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa1588b65cd76aad1ada9925be377eee27">LogError</a>      = (1u &lt;&lt; 5),
<a name="l00052"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf51a978d8fb4a086d815518b13c6ccc4">00052</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfaf51a978d8fb4a086d815518b13c6ccc4">CircuitStatus</a> = (1u &lt;&lt; 6),
<a name="l00053"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa92d48f0cdb62ea444713b7574ab31d34">00053</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa92d48f0cdb62ea444713b7574ab31d34">StreamStatus</a>  = (1u &lt;&lt; 7),
<a name="l00054"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa046a2028ee80393d2b895cce20c15038">00054</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa046a2028ee80393d2b895cce20c15038">OrConnStatus</a>  = (1u &lt;&lt; 8),
<a name="l00055"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfad4e1c3f57606b56d335885d3f36bf20c">00055</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfad4e1c3f57606b56d335885d3f36bf20c">NewDescriptor</a> = (1u &lt;&lt; 9),
<a name="l00056"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa4e71b10927d887d682ded74d160a5a2a">00056</a>     <a class="code" href="class_address_map.html">AddressMap</a>    = (1u &lt;&lt; 10),
<a name="l00057"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa0f4ce116650cb34661bfe23344562765">00057</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa0f4ce116650cb34661bfe23344562765">GeneralStatus</a> = (1u &lt;&lt; 11),
<a name="l00058"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa5f1d41f1693f31d72e3e6c037cf7ff01">00058</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa5f1d41f1693f31d72e3e6c037cf7ff01">ClientStatus</a>  = (1u &lt;&lt; 12),
<a name="l00059"></a><a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa1a28286d958ff505ab63722214395e8f">00059</a>     <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa1a28286d958ff505ab63722214395e8f">ServerStatus</a>  = (1u &lt;&lt; 13)
<a name="l00060"></a>00060   };
<a name="l00061"></a><a class="code" href="class_tor_events.html#a7153bf04e68d4f74e16efe2c9dcb1787">00061</a>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> <a class="code" href="class_tor_events.html#a7153bf04e68d4f74e16efe2c9dcb1787">EVENT_MIN</a> = <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa37aa333e6b9acdb8cf240fbafeba4e38">TorEvents::Bandwidth</a>;
<a name="l00062"></a><a class="code" href="class_tor_events.html#a49369e2a61ceae0feffd8987c40d8d84">00062</a>   <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> <a class="code" href="class_tor_events.html#a49369e2a61ceae0feffd8987c40d8d84">EVENT_MAX</a> = <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bfa1a28286d958ff505ab63722214395e8f">TorEvents::ServerStatus</a>;
<a name="l00063"></a>00063   <a class="code" href="class_tor_events.html#aad6644a66c82bc64e07f1e4c3a7a3810">Q_DECLARE_FLAGS</a>(Events, <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a>);
<a name="l00064"></a>00064 <span class="comment"></span>
<a name="l00065"></a>00065 <span class="comment">  /** Default Constructor */</span>
<a name="l00066"></a>00066   <a class="code" href="class_tor_events.html#a7640c5e646ac7c699995b2e046028749">TorEvents</a>(QObject *parent = 0);
<a name="l00067"></a>00067 <span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">  /** Parses an event message and emits the proper signal */</span>
<a name="l00069"></a>00069   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a0b5f60ca782a3d0af243ce77c7189379">handleEvent</a>(<span class="keyword">const</span> <a class="code" href="class_control_reply.html">ControlReply</a> &amp;reply);
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">  /** Converts an Event to a string */</span>
<a name="l00072"></a>00072   <span class="keyword">static</span> QString <a class="code" href="class_tor_events.html#a8c62c55a950118cdeba5a7de34ac157b">toString</a>(<a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">TorEvents::Event</a> e);
<a name="l00073"></a>00073 
<a name="l00074"></a>00074 signals:<span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment">  /** Emitted when Tor writes the message &lt;b&gt;msg&lt;/b&gt; to the control port</span>
<a name="l00076"></a>00076 <span class="comment">   * with message severity &lt;b&gt;level&lt;/b&gt;.</span>
<a name="l00077"></a>00077 <span class="comment">   */</span>
<a name="l00078"></a>00078   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a39a5f40a4793ee05e0622dd781a204d3">logMessage</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> level, <span class="keyword">const</span> QString &amp;msg);
<a name="l00079"></a>00079 <span class="comment"></span>
<a name="l00080"></a>00080 <span class="comment">  /** Emitted when Tor sends a bandwidth usage update (roughly once every</span>
<a name="l00081"></a>00081 <span class="comment">   * second). &lt;b&gt;bytesReceived&lt;/b&gt; is the number of bytes read by Tor over</span>
<a name="l00082"></a>00082 <span class="comment">   * the previous second and &lt;b&gt;bytesWritten&lt;/b&gt; is the number of bytes</span>
<a name="l00083"></a>00083 <span class="comment">   * sent over the same interval.</span>
<a name="l00084"></a>00084 <span class="comment">   */</span>
<a name="l00085"></a>00085   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#afaa9d5d1de4fbdd2236980569c22b3ba">bandwidthUpdate</a>(quint64 bytesReceived, quint64 bytesSent);
<a name="l00086"></a>00086 <span class="comment"></span>
<a name="l00087"></a>00087 <span class="comment">  /** Emitted when the stream status of &lt;b&gt;stream&lt;/b&gt; has changed.</span>
<a name="l00088"></a>00088 <span class="comment">   */</span>
<a name="l00089"></a>00089   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a1249b178f2b514979ce5407659cfdd24">streamStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_stream.html">Stream</a> &amp;stream);
<a name="l00090"></a>00090 <span class="comment"></span>
<a name="l00091"></a>00091 <span class="comment">  /** Emitted when the circuit status of &lt;b&gt;circuit&lt;/b&gt; has changed.</span>
<a name="l00092"></a>00092 <span class="comment">   */</span>
<a name="l00093"></a>00093   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ace5346dc0a16406d1955f785d078df69">circuitStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_circuit.html">Circuit</a> &amp;circuit);
<a name="l00094"></a>00094 <span class="comment"></span>
<a name="l00095"></a>00095 <span class="comment">  /** Emitted when Tor has mapped the address &lt;b&gt;from&lt;/b&gt; to the address</span>
<a name="l00096"></a>00096 <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="l00097"></a>00097 <span class="comment">   * mapping will no longer be considered valid.</span>
<a name="l00098"></a>00098 <span class="comment">   */</span>
<a name="l00099"></a>00099   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a4a92733016b756111b95e51c335d269c">addressMapped</a>(<span class="keyword">const</span> QString &amp;from, <span class="keyword">const</span> QString &amp;to,
<a name="l00100"></a>00100                      <span class="keyword">const</span> QDateTime &amp;expires);
<a name="l00101"></a>00101 <span class="comment"></span>
<a name="l00102"></a>00102 <span class="comment">  /** Emitted when Tor has received one or more new router descriptors.</span>
<a name="l00103"></a>00103 <span class="comment">   * &lt;b&gt;ids&lt;/b&gt; contains a list of digests of the new descriptors.</span>
<a name="l00104"></a>00104 <span class="comment">   */</span>
<a name="l00105"></a>00105   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#aafd39f6ef97ff4bc0537776148529606">newDescriptors</a>(<span class="keyword">const</span> QStringList &amp;ids);
<a name="l00106"></a>00106 <span class="comment"></span>
<a name="l00107"></a>00107 <span class="comment">  /** Indicates Tor has been able to successfully establish one or more</span>
<a name="l00108"></a>00108 <span class="comment">   * circuits.</span>
<a name="l00109"></a>00109 <span class="comment">   */</span>
<a name="l00110"></a>00110   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a49355793c98b0bc802be587d7db1a318">circuitEstablished</a>();
<a name="l00111"></a>00111 <span class="comment"></span>
<a name="l00112"></a>00112 <span class="comment">  /** Indicates that Tor has decided the user&#39;s Tor software &lt;b&gt;version&lt;/b&gt;</span>
<a name="l00113"></a>00113 <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="l00114"></a>00114 <span class="comment">   * a list of Tor software versions that are considered current.</span>
<a name="l00115"></a>00115 <span class="comment">   */</span>
<a name="l00116"></a>00116   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a79a575fba25756532a78ab48276c3283">dangerousTorVersion</a>(<a class="code" href="namespacetc.html#a8389db682e80cb6921e26b529e2ec52c">tc::TorVersionStatus</a> reason,
<a name="l00117"></a>00117                            <span class="keyword">const</span> QString &amp;version,
<a name="l00118"></a>00118                            <span class="keyword">const</span> QStringList &amp;recommended);
<a name="l00119"></a>00119 <span class="comment"></span>
<a name="l00120"></a>00120 <span class="comment">  /** Emitted during Tor&#39;s startup process to indicate how far in its</span>
<a name="l00121"></a>00121 <span class="comment">   * bootstrapping process it has progressed. &lt;b&gt;status&lt;/b&gt; may indicate</span>
<a name="l00122"></a>00122 <span class="comment">   * the current bootstrapping stage or an error during bootstrapping.</span>
<a name="l00123"></a>00123 <span class="comment">   */</span>
<a name="l00124"></a>00124   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a77bb1fb761e4ad941a56a046bc0d0cf4">bootstrapStatusChanged</a>(<span class="keyword">const</span> <a class="code" href="class_bootstrap_status.html">BootstrapStatus</a> &amp;status);
<a name="l00125"></a>00125 <span class="comment"></span>
<a name="l00126"></a>00126 <span class="comment">  /** Emitted when the user attempts to establish a connection to some</span>
<a name="l00127"></a>00127 <span class="comment">   * destination on port &lt;b&gt;port&lt;/b&gt;, which is a port known to use</span>
<a name="l00128"></a>00128 <span class="comment">   * plaintext connections (as determined by Tor&#39;s WarnPlaintextPorts and</span>
<a name="l00129"></a>00129 <span class="comment">   * RejectPlaintextPorts torrc options). &lt;b&gt;rejected&lt;/b&gt; indicates whether</span>
<a name="l00130"></a>00130 <span class="comment">   * Tor rejected the connection or permitted it to connect anyway.</span>
<a name="l00131"></a>00131 <span class="comment">   */</span>
<a name="l00132"></a>00132   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a25fdc7f80b893ecdf9fd66776fd09170">dangerousPort</a>(quint16 port, <span class="keywordtype">bool</span> rejected);
<a name="l00133"></a>00133 <span class="comment"></span>
<a name="l00134"></a>00134 <span class="comment">  /** Emitted when Tor detects a problem with a SOCKS connection from the</span>
<a name="l00135"></a>00135 <span class="comment">   * user, such as a bad hostname, dangerous SOCKS protocol type, or a bad</span>
<a name="l00136"></a>00136 <span class="comment">   * hostname. &lt;b&gt;type&lt;/b&gt; indicates the type of error encountered and</span>
<a name="l00137"></a>00137 <span class="comment">   * &lt;b&gt;destination&lt;/b&gt; (if non-empty) specifies the attempted connection</span>
<a name="l00138"></a>00138 <span class="comment">   * destination address or hostname.</span>
<a name="l00139"></a>00139 <span class="comment">   */</span>
<a name="l00140"></a>00140   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a79fded852c2c70fa0c8539b2e9441fc0">socksError</a>(<a class="code" href="namespacetc.html#ab29556af3a71a9c8768ab9ae1e822191">tc::SocksError</a> <a class="code" href="namespacetc.html#aa7353218fd7baef0876bbb422ce818af">error</a>, <span class="keyword">const</span> QString &amp;destination);
<a name="l00141"></a>00141 <span class="comment"></span>
<a name="l00142"></a>00142 <span class="comment">  /** Emitted when Tor has encountered an internal bug. &lt;b&gt;reason&lt;/b&gt; is</span>
<a name="l00143"></a>00143 <span class="comment">   * Tor&#39;s description of the bug.</span>
<a name="l00144"></a>00144 <span class="comment">   */</span>
<a name="l00145"></a>00145   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a90f62a5621b32c182b2a786807392902">bug</a>(<span class="keyword">const</span> QString &amp;reason);
<a name="l00146"></a>00146 <span class="comment"></span>
<a name="l00147"></a>00147 <span class="comment">  /** Emitted when Tor decides the client&#39;s external IP address has changed</span>
<a name="l00148"></a>00148 <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="l00149"></a>00149 <span class="comment">   * value for &lt;b&gt;ip&lt;/b&gt; by resolving &lt;b&gt;hostname&lt;/b&gt;. </span>
<a name="l00150"></a>00150 <span class="comment">   */</span>
<a name="l00151"></a>00151   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a4a7eb62b180f3706301d201fa5f18de4">externalAddressChanged</a>(<span class="keyword">const</span> QHostAddress &amp;ip, <span class="keyword">const</span> QString &amp;hostname);
<a name="l00152"></a>00152 <span class="comment"></span>
<a name="l00153"></a>00153 <span class="comment">  /** Indicates that Tor has determined the client&#39;s clock is potentially</span>
<a name="l00154"></a>00154 <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="l00155"></a>00155 <span class="comment">   */</span>
<a name="l00156"></a>00156   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a6e7c92749d962b11441563b19d713148">clockSkewed</a>(<span class="keywordtype">int</span> skew, <span class="keyword">const</span> QString &amp;source);
<a name="l00157"></a>00157 <span class="comment"></span>
<a name="l00158"></a>00158 <span class="comment">  /** Emitted when Tor determines that the user&#39;s DNS provider is providing</span>
<a name="l00159"></a>00159 <span class="comment">   * an address for non-existent domains when it should really be saying</span>
<a name="l00160"></a>00160 <span class="comment">   * &quot;NXDOMAIN&quot;.</span>
<a name="l00161"></a>00161 <span class="comment">   */</span>
<a name="l00162"></a>00162   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a9598447c031fa8886b71b6d860f098d5">dnsHijacked</a>();
<a name="l00163"></a>00163 <span class="comment"></span>
<a name="l00164"></a>00164 <span class="comment">  /** Emitted when Tor determines that the user&#39;s DNS provider is providing</span>
<a name="l00165"></a>00165 <span class="comment">   * a hijacked address even for well-known websites.</span>
<a name="l00166"></a>00166 <span class="comment">   */</span>
<a name="l00167"></a>00167   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ac911333c453887fdffd74e2a074864ca">dnsUseless</a>();
<a name="l00168"></a>00168 <span class="comment"></span>
<a name="l00169"></a>00169 <span class="comment">  /** Indicates Tor has started testing the reachability of its OR port </span>
<a name="l00170"></a>00170 <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="l00171"></a>00171 <span class="comment">   */</span>
<a name="l00172"></a>00172   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a84d5c8946323cdd327a883958fc549de">checkingOrPortReachability</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00173"></a>00173 <span class="comment"></span>
<a name="l00174"></a>00174 <span class="comment">  /** Tor has completed testing the reachability of its OR port using</span>
<a name="l00175"></a>00175 <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="l00176"></a>00176 <span class="comment">   * was reachable, &lt;b&gt;reachable&lt;/b&gt; will be set to true.</span>
<a name="l00177"></a>00177 <span class="comment">   */</span>
<a name="l00178"></a>00178   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a32a9aaa46971b5f301ad76a68a96803d">orPortReachabilityFinished</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00179"></a>00179                                   <span class="keywordtype">bool</span> reachable);
<a name="l00180"></a>00180 <span class="comment"></span>
<a name="l00181"></a>00181 <span class="comment">  /** Indicates Tor has started testing the reachability of its directory</span>
<a name="l00182"></a>00182 <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="l00183"></a>00183 <span class="comment">   */</span>
<a name="l00184"></a>00184   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ad0f0f00e1cdd9cdfcf65029059ac7f15">checkingDirPortReachability</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00185"></a>00185 <span class="comment"></span>
<a name="l00186"></a>00186 <span class="comment">  /** Tor has completed testing the reachability of its directory port using</span>
<a name="l00187"></a>00187 <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="l00188"></a>00188 <span class="comment">   * port was reachable, &lt;b&gt;reachable&lt;/b&gt; will be set to true.</span>
<a name="l00189"></a>00189 <span class="comment">   */</span>
<a name="l00190"></a>00190   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ae2cb999a7c9fbbb416cbac396ce9877b">dirPortReachabilityFinished</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00191"></a>00191                                    <span class="keywordtype">bool</span> reachable);
<a name="l00192"></a>00192 <span class="comment"></span>
<a name="l00193"></a>00193 <span class="comment">  /** Emitted when the directory authority with IP address &lt;b&gt;ip&lt;/b&gt; and</span>
<a name="l00194"></a>00194 <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="l00195"></a>00195 <span class="comment">   * describes why the descriptor was rejected (e.g., malformed, skewed</span>
<a name="l00196"></a>00196 <span class="comment">   * clock, etc.).</span>
<a name="l00197"></a>00197 <span class="comment">   */</span>
<a name="l00198"></a>00198   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a0a0344391536bd8757d2a4f3a81a4ab5">serverDescriptorRejected</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port,
<a name="l00199"></a>00199                                 <span class="keyword">const</span> QString &amp;reason);
<a name="l00200"></a>00200 <span class="comment"></span>
<a name="l00201"></a>00201 <span class="comment">  /** Emitted when the directory authority with IP address &lt;b&gt;ip&lt;/b&gt; and</span>
<a name="l00202"></a>00202 <span class="comment">   * port &lt;b&gt;port&lt;/b&gt; accepted the user&#39;s server descriptor.</span>
<a name="l00203"></a>00203 <span class="comment">   */</span>
<a name="l00204"></a>00204   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a72175cc254e18a1cedb2e0231749645f">serverDescriptorAccepted</a>(<span class="keyword">const</span> QHostAddress &amp;ip, quint16 port);
<a name="l00205"></a>00205 <span class="comment"></span>
<a name="l00206"></a>00206 <span class="comment">  /** Emitted when at least one directory authority has accepted the user&#39;s</span>
<a name="l00207"></a>00207 <span class="comment">   * server descriptor.</span>
<a name="l00208"></a>00208 <span class="comment">   */</span>
<a name="l00209"></a>00209   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a72175cc254e18a1cedb2e0231749645f">serverDescriptorAccepted</a>();
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 <span class="keyword">private</span>:<span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment">  /** Parses the event type from the event message */</span>
<a name="l00213"></a>00213   <span class="keyword">static</span> <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> <a class="code" href="class_tor_events.html#a6f2415a207877518622e3a4c3259b571">parseEventType</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00214"></a>00214 <span class="comment">  /** Converts a string to an Event */</span>
<a name="l00215"></a>00215   <span class="keyword">static</span> <a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> <a class="code" href="class_tor_events.html#aab44fb9ba9b80d85b95ebe7ac9bc25f9">toTorEvent</a>(<span class="keyword">const</span> QString &amp;event);<span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">  /** Splits a string in the form &quot;IP:PORT&quot; into a QHostAddress and quint16</span>
<a name="l00217"></a>00217 <span class="comment">   * pair. If either portion is invalid, a default-constructed QPair() is</span>
<a name="l00218"></a>00218 <span class="comment">   * returned. */</span>
<a name="l00219"></a>00219    <span class="keyword">static</span> QPair&lt;QHostAddress,quint16&gt; <a class="code" href="class_tor_events.html#a50b675f00d56916ed7997191ca3d06cb">splitAddress</a>(<span class="keyword">const</span> QString &amp;address);
<a name="l00220"></a>00220   <span class="comment"></span>
<a name="l00221"></a>00221 <span class="comment">  /** Handle a bandwidth update event */</span>
<a name="l00222"></a>00222   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a789ec0c0e8662d8b05b0bb3e85333464">handleBandwidthUpdate</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00223"></a>00223 <span class="comment">  /** Handle a circuit status event */</span>
<a name="l00224"></a>00224   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ae7ae522be9c3671f3ea705fb436b0b1e">handleCircuitStatus</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00225"></a>00225 <span class="comment">  /** Handle a stream status event */</span>
<a name="l00226"></a>00226   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a94672855e722c561fff41d25b2fcddfe">handleStreamStatus</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00227"></a>00227 <span class="comment">  /** Handle a log message event */</span>
<a name="l00228"></a>00228   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#ae83a736104b606ccad26daaa657b4ae2">handleLogMessage</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00229"></a>00229 <span class="comment">  /** Handle an OR connection status event. */</span>
<a name="l00230"></a>00230   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#affc963ec10fddf988ead655cc5e15105">handleOrConnStatus</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00231"></a>00231 <span class="comment">  /** Handles a new list of descriptors event. */</span>
<a name="l00232"></a>00232   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a7ace5ed4fcac504482c18f63b1e21348">handleNewDescriptor</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00233"></a>00233 <span class="comment">  /** Handles a new or updated address map event. */</span>
<a name="l00234"></a>00234   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a162d8b646b47cc3f66d3db437d103bca">handleAddressMap</a>(<span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);
<a name="l00235"></a>00235 <span class="comment"></span>
<a name="l00236"></a>00236 <span class="comment">  /** Handles a Tor status event. */</span>
<a name="l00237"></a>00237   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#aef7e7863cf6d8ce36018bbdccca3a1f8">handleStatusEvent</a>(<a class="code" href="class_tor_events.html#a08aed30fd27832e89f96114617da72bf">Event</a> type, <span class="keyword">const</span> <a class="code" href="class_reply_line.html">ReplyLine</a> &amp;line);<span class="comment"></span>
<a name="l00238"></a>00238 <span class="comment">  /** Parses and posts a general Tor status event. */</span>
<a name="l00239"></a>00239   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a2289790fffbb6b224a135359d337a8dc">handleGeneralStatusEvent</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> severity,
<a name="l00240"></a>00240                                 <span class="keyword">const</span> QString &amp;action,
<a name="l00241"></a>00241                                 <span class="keyword">const</span> QHash&lt;QString,QString&gt; &amp;args);<span class="comment"></span>
<a name="l00242"></a>00242 <span class="comment">  /** Parses and posts a Tor client status event. */</span>
<a name="l00243"></a>00243   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#a3a7aad7a92cf95b351712af01649a636">handleClientStatusEvent</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> severity,
<a name="l00244"></a>00244                                <span class="keyword">const</span> QString &amp;action,
<a name="l00245"></a>00245                                <span class="keyword">const</span> QHash&lt;QString,QString&gt; &amp;args);<span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">  /** Parses and posts a Tor server status event. */</span>
<a name="l00247"></a>00247   <span class="keywordtype">void</span> <a class="code" href="class_tor_events.html#afbbd10a91a6a7b71a7b40ef4194f35fa">handleServerStatusEvent</a>(<a class="code" href="namespacetc.html#abb893107129c283d2eb0238e46eb3d4c">tc::Severity</a> severity,
<a name="l00248"></a>00248                                <span class="keyword">const</span> QString &amp;action,
<a name="l00249"></a>00249                                <span class="keyword">const</span> QHash&lt;QString,QString&gt; &amp;args);
<a name="l00250"></a>00250 };
<a name="l00251"></a>00251 
<a name="l00252"></a>00252 Q_DECLARE_OPERATORS_FOR_FLAGS(TorEvents::Events)
<a name="l00253"></a>00253 
<a name="l00254"></a>00254 <span class="preprocessor">#endif</span>
<a name="l00255"></a>00255 <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>