diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-17 12:33:39 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-17 12:33:39 +0000 |
commit | afb51347b493a6ab54fcc8595b4a3f46972ce18f (patch) | |
tree | 809920b42a5a6e6c0e421703a9d9863331cd0339 /docs/module-doc/connection_8h-source.html | |
parent | ea5e22a8416e66e8ebce1b1260d786820808491a (diff) |
Added new documentation to cover ircd_connector
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@629 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/module-doc/connection_8h-source.html')
-rw-r--r-- | docs/module-doc/connection_8h-source.html | 195 |
1 files changed, 136 insertions, 59 deletions
diff --git a/docs/module-doc/connection_8h-source.html b/docs/module-doc/connection_8h-source.html index 13f3b5169..d0c8b9ff6 100644 --- a/docs/module-doc/connection_8h-source.html +++ b/docs/module-doc/connection_8h-source.html @@ -21,65 +21,142 @@ 00013 <span class="preprocessor">#include <unistd.h></span> 00014 <span class="preprocessor">#include <errno.h></span> 00015 <span class="preprocessor">#include <time.h></span> -00016 -00017 <span class="preprocessor">#ifndef __CONNECTION_H__</span> -00018 <span class="preprocessor"></span><span class="preprocessor">#define __CONNECTION_H__</span> -00019 <span class="preprocessor"></span> -<a name="l00020"></a><a class="code" href="connection_8h.html#a0">00020</a> <span class="preprocessor">#define PT_SYN_ONLY 0</span> -<a name="l00021"></a><a class="code" href="connection_8h.html#a1">00021</a> <span class="preprocessor"></span><span class="preprocessor">#define PT_ACK_ONLY 1</span> -<a name="l00022"></a><a class="code" href="connection_8h.html#a2">00022</a> <span class="preprocessor"></span><span class="preprocessor">#define PT_SYN_WITH_DATA 2</span> -<a name="l00023"></a><a class="code" href="connection_8h.html#a3">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define PT_KEY_EXCHANGE 3</span> -00024 <span class="preprocessor"></span> -00025 -<a name="l00026"></a><a class="code" href="classpacket.html">00026</a> <span class="keyword">class </span><a class="code" href="classpacket.html">packet</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> -00027 { -00028 <span class="keyword">public</span>: -<a name="l00029"></a><a class="code" href="classpacket.html#m0">00029</a> <span class="keywordtype">long</span> <a class="code" href="classpacket.html#m0">key</a>; -<a name="l00030"></a><a class="code" href="classpacket.html#m1">00030</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classpacket.html#m1">id</a>; -<a name="l00031"></a><a class="code" href="classpacket.html#m2">00031</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classpacket.html#m2">type</a>; -<a name="l00032"></a><a class="code" href="classpacket.html#m3">00032</a> <span class="keywordtype">char</span> <a class="code" href="classpacket.html#m3">data</a>[MAXBUF]; -00033 -00034 <a class="code" href="classpacket.html#a0">packet</a>(); -00035 <a class="code" href="classpacket.html#a1">~packet</a>(); -00036 }; -00037 -00038 -<a name="l00039"></a><a class="code" href="classconnection.html">00039</a> <span class="keyword">class </span><a class="code" href="classconnection.html">connection</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> -00040 { -00041 <span class="keyword">public</span>: -<a name="l00042"></a><a class="code" href="classconnection.html#m0">00042</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m0">key</a>; -<a name="l00043"></a><a class="code" href="classconnection.html#m1">00043</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m1">fd</a>; <span class="comment">// file descriptor</span> -<a name="l00044"></a><a class="code" href="classconnection.html#m2">00044</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m2">host</a>[256]; <span class="comment">// hostname</span> -<a name="l00045"></a><a class="code" href="classconnection.html#m3">00045</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m3">ip</a>; <span class="comment">// ipv4 address</span> -<a name="l00046"></a><a class="code" href="classconnection.html#m4">00046</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m4">inbuf</a>[MAXBUF]; <span class="comment">// recvQ</span> -<a name="l00047"></a><a class="code" href="classconnection.html#m5">00047</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m5">bytes_in</a>; -<a name="l00048"></a><a class="code" href="classconnection.html#m6">00048</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m6">bytes_out</a>; -<a name="l00049"></a><a class="code" href="classconnection.html#m7">00049</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m7">cmds_in</a>; -<a name="l00050"></a><a class="code" href="classconnection.html#m8">00050</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m8">cmds_out</a>; -<a name="l00051"></a><a class="code" href="classconnection.html#m9">00051</a> <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#m9">haspassed</a>; -<a name="l00052"></a><a class="code" href="classconnection.html#m10">00052</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m10">port</a>; -<a name="l00053"></a><a class="code" href="classconnection.html#m11">00053</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m11">registered</a>; -<a name="l00054"></a><a class="code" href="classconnection.html#m12">00054</a> time_t <a class="code" href="classconnection.html#m12">lastping</a>; -<a name="l00055"></a><a class="code" href="classconnection.html#m13">00055</a> time_t <a class="code" href="classconnection.html#m13">signon</a>; -<a name="l00056"></a><a class="code" href="classconnection.html#m14">00056</a> time_t <a class="code" href="classconnection.html#m14">idle_lastmsg</a>; -<a name="l00057"></a><a class="code" href="classconnection.html#m15">00057</a> time_t <a class="code" href="classconnection.html#m15">nping</a>; -<a name="l00058"></a><a class="code" href="classconnection.html#m16">00058</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m16">internal_addr</a>[1024]; -00059 -00060 <a class="code" href="classconnection.html#a0">connection</a>(); -00061 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a1">CreateListener</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> p); -00062 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a2">BeginLink</a>(<span class="keywordtype">char</span>* targethost, <span class="keywordtype">int</span> port, <span class="keywordtype">char</span>* password); -00063 <span class="keywordtype">void</span> <a class="code" href="classconnection.html#a3">TerminateLink</a>(<span class="keywordtype">char</span>* targethost); -00064 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a4">SendPacket</a>(<span class="keywordtype">char</span> *message, <span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port, <span class="keywordtype">long</span> ourkey); -00065 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a5">RecvPacket</a>(<span class="keywordtype">char</span> *message, <span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> &prt, <span class="keywordtype">long</span> &theirkey); -00066 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a6">SendSYN</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port); -00067 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a7">SendACK</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port, <span class="keywordtype">int</span> reply_id); -00068 <span class="keywordtype">long</span> <a class="code" href="classconnection.html#a8">GenKey</a>(); -00069 }; -00070 -00071 -00072 <span class="preprocessor">#endif</span> -00073 <span class="preprocessor"></span> -</pre></div><hr><address style="align: right;"><small>Generated on Thu Apr 8 19:12:27 2004 for InspIRCd by +00016 <span class="preprocessor">#include <vector></span> +00017 <span class="preprocessor">#include <deque></span> +00018 +00019 <span class="preprocessor">#ifndef __CONNECTION_H__</span> +00020 <span class="preprocessor"></span><span class="preprocessor">#define __CONNECTION_H__</span> +00021 <span class="preprocessor"></span> +<a name="l00022"></a><a class="code" href="connection_8h.html#a0">00022</a> <span class="preprocessor">#define STATE_DISCONNECTED 0</span> +<a name="l00023"></a><a class="code" href="connection_8h.html#a1">00023</a> <span class="preprocessor"></span><span class="preprocessor">#define STATE_CONNECTED 1</span> +<a name="l00024"></a><a class="code" href="connection_8h.html#a2">00024</a> <span class="preprocessor"></span><span class="preprocessor">#define STATE_SYNC 2</span> +<a name="l00025"></a><a class="code" href="connection_8h.html#a3">00025</a> <span class="preprocessor"></span><span class="preprocessor">#define STATE_NOAUTH_INBOUND 3</span> +<a name="l00026"></a><a class="code" href="connection_8h.html#a4">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define STATE_NOAUTH_OUTBOUND 4</span> +00027 <span class="preprocessor"></span> +<a name="l00040"></a><a class="code" href="classircd__connector.html">00040</a> <span class="keyword">class </span><a class="code" href="classircd__connector.html">ircd_connector</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> +00041 { +00042 <span class="keyword">private</span>: +<a name="l00045"></a><a class="code" href="classircd__connector.html#o0">00045</a> sockaddr_in <a class="code" href="classircd__connector.html#o0">addr</a>; +00046 +<a name="l00049"></a><a class="code" href="classircd__connector.html#o1">00049</a> <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#o1">fd</a>; +00050 +<a name="l00053"></a><a class="code" href="classircd__connector.html#o2">00053</a> std::string <a class="code" href="classircd__connector.html#o2">servername</a>; +00054 +<a name="l00057"></a><a class="code" href="classircd__connector.html#o3">00057</a> std::string <a class="code" href="classircd__connector.html#o3">description</a>; +00058 +<a name="l00062"></a><a class="code" href="classircd__connector.html#o4">00062</a> <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#o4">state</a>; +00063 +00066 <span class="keywordtype">bool</span> <a class="code" href="classircd__connector.html#c0">SetHostAddress</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port); +00067 +00068 <span class="keyword">public</span>: +00069 +<a name="l00074"></a><a class="code" href="classircd__connector.html#m0">00074</a> <span class="keywordtype">char</span> <a class="code" href="classircd__connector.html#m0">host</a>[MAXBUF]; +00075 +<a name="l00080"></a><a class="code" href="classircd__connector.html#m1">00080</a> <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#m1">port</a>; +00081 +<a name="l00086"></a><a class="code" href="classircd__connector.html#m2">00086</a> std::vector<std::string> <a class="code" href="classircd__connector.html#m2">routes</a>; +00087 +00088 +00091 <span class="keywordtype">bool</span> <a class="code" href="classircd__connector.html#a0">MakeOutboundConnection</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port); +00092 +00095 std::string <a class="code" href="classircd__connector.html#a1">GetServerName</a>(); +00096 +00099 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a2">SetServerName</a>(std::string serv); +00100 +00103 <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#a3">GetDescriptor</a>(); +00104 +00107 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a4">SetDescriptor</a>(<span class="keywordtype">int</span> fd); +00108 +00111 <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#a5">GetState</a>(); +00112 +00115 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a6">SetState</a>(<span class="keywordtype">int</span> state); +00116 +00119 <span class="keywordtype">char</span>* <a class="code" href="classircd__connector.html#a7">GetServerIP</a>(); +00120 +00123 std::string <a class="code" href="classircd__connector.html#a8">GetDescription</a>(); +00124 +00127 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a9">SetDescription</a>(std::string desc); +00128 +00134 <span class="keywordtype">int</span> <a class="code" href="classircd__connector.html#a10">GetServerPort</a>(); +00135 +00138 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a11">SetServerPort</a>(<span class="keywordtype">int</span> p); +00139 +00142 <span class="keywordtype">bool</span> <a class="code" href="classircd__connector.html#a12">SetHostAndPort</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> port); +00143 +00147 <span class="keywordtype">void</span> <a class="code" href="classircd__connector.html#a13">CloseConnection</a>(); +00148 }; +00149 +00150 +<a name="l00151"></a><a class="code" href="classpacket.html">00151</a> <span class="keyword">class </span><a class="code" href="classpacket.html">packet</a> +00152 { +00156 }; +00157 +<a name="l00160"></a><a class="code" href="classconnection.html">00160</a> <span class="keyword">class </span><a class="code" href="classconnection.html">connection</a> : <span class="keyword">public</span> <a class="code" href="classclassbase.html">classbase</a> +00161 { +00162 <span class="keyword">public</span>: +<a name="l00165"></a><a class="code" href="classconnection.html#m0">00165</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m0">fd</a>; +00166 +<a name="l00169"></a><a class="code" href="classconnection.html#m1">00169</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m1">host</a>[256]; +00170 +<a name="l00173"></a><a class="code" href="classconnection.html#m2">00173</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m2">ip</a>; +00174 +<a name="l00177"></a><a class="code" href="classconnection.html#m3">00177</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m3">inbuf</a>[MAXBUF]; +00178 +<a name="l00181"></a><a class="code" href="classconnection.html#m4">00181</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m4">bytes_in</a>; +00182 +<a name="l00185"></a><a class="code" href="classconnection.html#m5">00185</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m5">bytes_out</a>; +00186 +<a name="l00189"></a><a class="code" href="classconnection.html#m6">00189</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m6">cmds_in</a>; +00190 +<a name="l00193"></a><a class="code" href="classconnection.html#m7">00193</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m7">cmds_out</a>; +00194 +<a name="l00197"></a><a class="code" href="classconnection.html#m8">00197</a> <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#m8">haspassed</a>; +00198 +<a name="l00203"></a><a class="code" href="classconnection.html#m9">00203</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m9">port</a>; +00204 +<a name="l00207"></a><a class="code" href="classconnection.html#m10">00207</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m10">registered</a>; +00208 +<a name="l00211"></a><a class="code" href="classconnection.html#m11">00211</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m11">state</a>; +00212 +<a name="l00215"></a><a class="code" href="classconnection.html#m12">00215</a> time_t <a class="code" href="classconnection.html#m12">lastping</a>; +00216 +<a name="l00219"></a><a class="code" href="classconnection.html#m13">00219</a> time_t <a class="code" href="classconnection.html#m13">signon</a>; +00220 +<a name="l00223"></a><a class="code" href="classconnection.html#m14">00223</a> time_t <a class="code" href="classconnection.html#m14">idle_lastmsg</a>; +00224 +<a name="l00227"></a><a class="code" href="classconnection.html#m15">00227</a> time_t <a class="code" href="classconnection.html#m15">nping</a>; +00228 +<a name="l00231"></a><a class="code" href="classconnection.html#m16">00231</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m16">internal_addr</a>[1024]; +00232 +<a name="l00235"></a><a class="code" href="classconnection.html#m17">00235</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m17">internal_port</a>; +00236 +<a name="l00240"></a><a class="code" href="classconnection.html#m18">00240</a> std::vector<ircd_connector> <a class="code" href="classconnection.html#m18">connectors</a>; +00241 +00244 <a class="code" href="classconnection.html#a0">connection</a>(); +00245 +00248 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a1">CreateListener</a>(<span class="keywordtype">char</span>* host, <span class="keywordtype">int</span> p); +00249 +00252 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a2">BeginLink</a>(<span class="keywordtype">char</span>* targethost, <span class="keywordtype">int</span> port, <span class="keywordtype">char</span>* password, <span class="keywordtype">char</span>* servername, <span class="keywordtype">int</span> myport); +00253 +00256 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a3">MeshCookie</a>(<span class="keywordtype">char</span>* targethost, <span class="keywordtype">int</span> port, <span class="keywordtype">long</span> cookie, <span class="keywordtype">char</span>* servername); +00257 +00260 <span class="keywordtype">void</span> <a class="code" href="classconnection.html#a4">TerminateLink</a>(<span class="keywordtype">char</span>* targethost); +00261 +00265 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a5">SendPacket</a>(<span class="keywordtype">char</span> *message, <span class="keyword">const</span> <span class="keywordtype">char</span>* host); +00266 +00271 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a6">RecvPacket</a>(std::deque<std::string> &messages, <span class="keywordtype">char</span>* host); +00272 +00275 <a class="code" href="classircd__connector.html">ircd_connector</a>* <a class="code" href="classconnection.html#a7">FindHost</a>(std::string host); +00276 +00280 <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#a8">AddIncoming</a>(<span class="keywordtype">int</span> fd,<span class="keywordtype">char</span>* targethost, <span class="keywordtype">int</span> sourceport); +00281 +00284 <span class="keywordtype">long</span> <a class="code" href="classconnection.html#a9">GenKey</a>(); +00285 }; +00286 +00287 +00288 <span class="preprocessor">#endif</span> +00289 <span class="preprocessor"></span> +</pre></div><hr><address style="align: right;"><small>Generated on Sat Apr 17 13:31:38 2004 for InspIRCd by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.3-rc3 </small></address> |