blob: cfce346f5b98c731fa7e0deb5128ee8941e5f376 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>connection.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3-rc2 -->
<center>
<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
<hr><h1>connection.h</h1><a href="connection_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
00002 <span class="comment"></span>
00003 <span class="comment">*/</span>
00004
00005 <span class="preprocessor">#include "inspircd_config.h"</span>
00006 <span class="preprocessor">#include "<a class="code" href="base_8h.html">base.h</a>"</span>
00007 <span class="preprocessor">#include <string></span>
00008 <span class="preprocessor">#include <map.h></span>
00009 <span class="preprocessor">#include <sys/socket.h></span>
00010 <span class="preprocessor">#include <sys/types.h></span>
00011 <span class="preprocessor">#include <netdb.h></span>
00012 <span class="preprocessor">#include <netinet/in.h></span>
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>
00023 <span class="preprocessor"></span>
00024
<a name="l00025"></a><a class="code" href="classpacket.html">00025</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>
00026 {
00027 <span class="keyword">public</span>:
<a name="l00028"></a><a class="code" href="classpacket.html#m0">00028</a> <span class="keywordtype">long</span> <a class="code" href="classpacket.html#m0">key</a>;
<a name="l00029"></a><a class="code" href="classpacket.html#m1">00029</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classpacket.html#m1">id</a>;
<a name="l00030"></a><a class="code" href="classpacket.html#m2">00030</a> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="classpacket.html#m2">type</a>;
<a name="l00031"></a><a class="code" href="classpacket.html#m3">00031</a> <span class="keywordtype">char</span> <a class="code" href="classpacket.html#m3">data</a>[MAXBUF];
00032
00033 <a class="code" href="classpacket.html#a0">packet</a>();
00034 <a class="code" href="classpacket.html#a1">~packet</a>();
00035 };
00036
00037
<a name="l00038"></a><a class="code" href="classconnection.html">00038</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>
00039 {
00040 <span class="keyword">public</span>:
<a name="l00041"></a><a class="code" href="classconnection.html#m0">00041</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m0">key</a>;
<a name="l00042"></a><a class="code" href="classconnection.html#m1">00042</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m1">fd</a>; <span class="comment">// file descriptor</span>
<a name="l00043"></a><a class="code" href="classconnection.html#m2">00043</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m2">host</a>[256]; <span class="comment">// hostname</span>
<a name="l00044"></a><a class="code" href="classconnection.html#m3">00044</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m3">ip</a>; <span class="comment">// ipv4 address</span>
<a name="l00045"></a><a class="code" href="classconnection.html#m4">00045</a> <span class="keywordtype">char</span> <a class="code" href="classconnection.html#m4">inbuf</a>[MAXBUF]; <span class="comment">// recvQ</span>
<a name="l00046"></a><a class="code" href="classconnection.html#m5">00046</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m5">bytes_in</a>;
<a name="l00047"></a><a class="code" href="classconnection.html#m6">00047</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m6">bytes_out</a>;
<a name="l00048"></a><a class="code" href="classconnection.html#m7">00048</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m7">cmds_in</a>;
<a name="l00049"></a><a class="code" href="classconnection.html#m8">00049</a> <span class="keywordtype">long</span> <a class="code" href="classconnection.html#m8">cmds_out</a>;
<a name="l00050"></a><a class="code" href="classconnection.html#m9">00050</a> <span class="keywordtype">bool</span> <a class="code" href="classconnection.html#m9">haspassed</a>;
<a name="l00051"></a><a class="code" href="classconnection.html#m10">00051</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m10">port</a>;
<a name="l00052"></a><a class="code" href="classconnection.html#m11">00052</a> <span class="keywordtype">int</span> <a class="code" href="classconnection.html#m11">registered</a>;
<a name="l00053"></a><a class="code" href="classconnection.html#m12">00053</a> time_t <a class="code" href="classconnection.html#m12">lastping</a>;
<a name="l00054"></a><a class="code" href="classconnection.html#m13">00054</a> time_t <a class="code" href="classconnection.html#m13">signon</a>;
<a name="l00055"></a><a class="code" href="classconnection.html#m14">00055</a> time_t <a class="code" href="classconnection.html#m14">idle_lastmsg</a>;
<a name="l00056"></a><a class="code" href="classconnection.html#m15">00056</a> time_t <a class="code" href="classconnection.html#m15">nping</a>;
00057
00058 <a class="code" href="classconnection.html#a0">connection</a>();
00059 <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);
00060 <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);
00061 <span class="keywordtype">void</span> <a class="code" href="classconnection.html#a3">TerminateLink</a>(<span class="keywordtype">char</span>* targethost);
00062 <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);
00063 <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);
00064 <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);
00065 <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);
00066 <span class="keywordtype">long</span> <a class="code" href="classconnection.html#a8">GenKey</a>();
00067 };
00068
00069
00070 <span class="preprocessor">#endif</span>
00071 <span class="preprocessor"></span>
</pre></div><hr><address style="align: right;"><small>Generated on Sun Feb 9 12:48:16 2003 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-rc2 </small></address>
</body>
</html>
|