Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / doc / p10.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <HTML>
3 <HEAD>
4    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
5    <META NAME="GENERATOR" CONTENT="Mozilla/4.07 [en] (X11; I; Linux 2.2.13 i586) [Netscape]">
6    <TITLE>Undernet P10 Protocol and Interface Specification</TITLE>
7 </HEAD>
8 <BODY>
9
10 <H2>
11 <A NAME="top"></A><FONT SIZE=+3>Undernet P10 Protocol and Interface Specification</FONT></H2>
12 <I>(As of ircu 2.10.10)</I>
13 <H2>
14 Undernet Coder-com, <TT>coder-com@undernet.org</TT></H2>
15 v0.10, 2nd March 2000.
16 <P>
17 <HR ALIGN=CENTER WIDTH=100% SIZE=2><I>This document aims to be a practical
18 guide for implementing and maintaining the protocol, not just a reference
19 manual.</I>
20 <P>This document is "work in progress" and being continually updated :)
21 <HR 
22   ALIGN=CENTER WIDTH=100% SIZE=2>
23 <BR><FONT SIZE=+2>1. <B><A HREF="#chap1">Introduction</A></B></FONT>
24 <P><FONT SIZE=+2>2. <B><A HREF="#chap2">General concepts and background</A></B></FONT>
25 <BLOCKQUOTE><FONT SIZE=+0>2.1 <A HREF="#chap2.1">Concepts</A>.</FONT>
26 <BR><FONT SIZE=+0>2.2 <A HREF="#chap2.2">Token Table</A>.</FONT></BLOCKQUOTE>
27
28 <H2>
29 3. <A HREF="#chap3">Registration and syncronisation</A></H2>
30
31 <UL>
32 <LI>
33 <FONT SIZE=+0>3.1 <A HREF="#chap3.1">Server registration and authentication</A>.</FONT></LI>
34
35 <LI>
36 <FONT SIZE=+0>3.2 <A HREF="#chap3.2">Network database resyncronisation</A>.</FONT></LI>
37
38 <LI>
39 <FONT SIZE=+0>3.3 <A HREF="#chap3.3">Summary</A>.</FONT></LI>
40 </UL>
41
42 <H2>
43 4. <A HREF="#chap4">Continous operation</A></H2>
44
45 <UL>
46 <LI>
47 4.1 Channel operations.</LI>
48
49 <LI>
50 4.2 Messaging.</LI>
51
52 <LI>
53 4.3 Setting G-Lines.</LI>
54
55 <LI>
56 4.4 ...</LI>
57 </UL>
58
59 <H2>
60 4. Programmers reference: Function headers</H2>
61
62 <UL>
63 <LI>
64 <FONT SIZE=+0>4.1 ms_nick</FONT></LI>
65
66 <LI>
67 <FONT SIZE=+0>4.2 m_burst</FONT></LI>
68
69 <LI>
70 <FONT SIZE=+0>4.3 ..etc</FONT></LI>
71 </UL>
72
73 <H2>
74 5. <A HREF="#chap5">Programmers reference: Client/Server Structures</A></H2>
75
76 <H2>
77 6. <A HREF="#chap7">FAQ</A></H2>
78
79 <H2>
80 7. Acknowledgements and disclaimer</H2>
81
82 <H2>
83 8. <A HREF="#chap8">Update History</A></H2>
84
85 <BLOCKQUOTE>
86 <LI>
87 <A HREF="#chap8.1">TODO List</A></LI>
88 </BLOCKQUOTE>
89
90 <CENTER>
91 <HR ALIGN=CENTER WIDTH=100% SIZE=2></CENTER>
92
93 <P><A NAME="chap1"></A><B><FONT SIZE=+2>1. Introduction</FONT></B>
94 <P><FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
95 <BR>
96 <HR ALIGN=LEFT WIDTH=100% SIZE=2>
97 <P><A NAME="chap2"></A><B><FONT SIZE=+2>2. General concepts and background</FONT></B>
98 <P><A NAME="chap2.1"></A><B><FONT SIZE=+1>2.1 Concepts</FONT></B>
99 <P>The undernet P10 protocol uses a scheme of "Numerics" to uniquenly identify
100 a client or server within the network. Each server has its own unique numeric
101 (0 -> 4095) and each client has its own numeric within that server (0->262,143).
102 <P>The numerics are encoded into a Base64 stream to maintain human readable
103 data flow and reduce the size of the messages. The Base64 character set
104 used in ircu is included below, this defines all valid characters allowed
105 in a Base64 numeric with "A" representing 0 and "]" representing 63.
106 <BLOCKQUOTE>
107 <PRE><TT><FONT COLOR="#00007F">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789[]</FONT></TT></PRE>
108 </BLOCKQUOTE>
109 Server numerics consist of 2 characters, with the minimum, 0, being represented
110 by "AA", and the maximum, 4095, being represented by "]]". Client numerics
111 are 3 characters long, with the minimum, 0, being represented by "AAA",
112 and the maximum, 262,143, being represented by "]]]". The unique identifier
113 of a client on the network consists of a combination of both the server
114 and client numeric in the format SSCCC.
115 <P>As an example, consider a server "irc.undernet.org" which has a numeric
116 of 2, translating to "AC" in Base64. On this server exists a client, whom
117 has been allocated the numeric 63 (which translates to "AA]" in Base64).
118 Therefore, the unique identifier of this client on the network is "ACAA]".
119 From this, we can determine which server the message came from, aswell
120 as the client who sent it.
121 <P>These numerics are used to prefix every message issued on the stream
122 except for the initial "PASS" or "SERVER" message, which are not prefixed.
123 Therefore, every message that can be recieved from a server will consist
124 of the format:
125 <BLOCKQUOTE>
126 <PRE><FONT COLOR="#00007F">[NUMERIC PREFIX] [TOKEN] [DATA]</FONT></PRE>
127 </BLOCKQUOTE>
128 For Example:
129 <BLOCKQUOTE>
130 <PRE><FONT COLOR="#00007F">A[A5j P ABAAA :Foo.</FONT></PRE>
131 </BLOCKQUOTE>
132 <A NAME="chap2.2"></A><B><FONT SIZE=+1>2.2 Token Table</FONT></B>
133 <P>The following table lists all the acceptable messages, along with their
134 relevant "Token", which is used in the server&lt;>server protocol. The
135 aim of tokenisation is to reduce the bandwidth used during network communication
136 by reducing the length of common message identifiers.
137 <BR>&nbsp;
138 <CENTER><TABLE BORDER COLS=2 WIDTH="40%" >
139 <TR>
140 <TD><B>Message</B></TD>
141
142 <TD><B>Token</B></TD>
143 </TR>
144
145 <TR>
146 <TD><FONT SIZE=-1>PRIVMSG</FONT></TD>
147
148 <TD><FONT SIZE=-1>P</FONT></TD>
149 </TR>
150
151 <TR>
152 <TD><FONT SIZE=-1>WHO</FONT></TD>
153
154 <TD><FONT SIZE=-1>H</FONT></TD>
155 </TR>
156
157 <TR>
158 <TD><FONT SIZE=-1>WHOIS</FONT></TD>
159
160 <TD><FONT SIZE=-1>W</FONT></TD>
161 </TR>
162
163 <TR>
164 <TD><FONT SIZE=-1>WHOWAS</FONT></TD>
165
166 <TD><FONT SIZE=-1>X</FONT></TD>
167 </TR>
168
169 <TR>
170 <TD><FONT SIZE=-1>USER</FONT></TD>
171
172 <TD><FONT SIZE=-1>USER</FONT></TD>
173 </TR>
174
175 <TR>
176 <TD><FONT SIZE=-1>NICK</FONT></TD>
177
178 <TD><FONT SIZE=-1>N</FONT></TD>
179 </TR>
180
181 <TR>
182 <TD><FONT SIZE=-1>SERVER</FONT></TD>
183
184 <TD><FONT SIZE=-1>S</FONT></TD>
185 </TR>
186
187 <TR>
188 <TD><FONT SIZE=-1>LIST</FONT></TD>
189
190 <TD><FONT SIZE=-1>LIST</FONT></TD>
191 </TR>
192
193 <TR>
194 <TD><FONT SIZE=-1>TOPIC</FONT></TD>
195
196 <TD><FONT SIZE=-1>T</FONT></TD>
197 </TR>
198
199 <TR>
200 <TD><FONT SIZE=-1>INVITE</FONT></TD>
201
202 <TD><FONT SIZE=-1>I</FONT></TD>
203 </TR>
204
205 <TR>
206 <TD><FONT SIZE=-1>VERSION</FONT></TD>
207
208 <TD><FONT SIZE=-1>V</FONT></TD>
209 </TR>
210
211 <TR>
212 <TD><FONT SIZE=-1>QUIT</FONT></TD>
213
214 <TD><FONT SIZE=-1>Q</FONT></TD>
215 </TR>
216
217 <TR>
218 <TD><FONT SIZE=-1>SQUIT</FONT></TD>
219
220 <TD><FONT SIZE=-1>SQ</FONT></TD>
221 </TR>
222
223 <TR>
224 <TD><FONT SIZE=-1>KILL</FONT></TD>
225
226 <TD><FONT SIZE=-1>D</FONT></TD>
227 </TR>
228
229 <TR>
230 <TD><FONT SIZE=-1>INFO</FONT></TD>
231
232 <TD><FONT SIZE=-1>F</FONT></TD>
233 </TR>
234
235 <TR>
236 <TD><FONT SIZE=-1>LINKS</FONT></TD>
237
238 <TD><FONT SIZE=-1>LI</FONT></TD>
239 </TR>
240
241 <TR>
242 <TD><FONT SIZE=-1>STATS</FONT></TD>
243
244 <TD><FONT SIZE=-1>R</FONT></TD>
245 </TR>
246
247 <TR>
248 <TD><FONT SIZE=-1>HELP</FONT></TD>
249
250 <TD><FONT SIZE=-1>HELP</FONT></TD>
251 </TR>
252
253 <TR>
254 <TD><FONT SIZE=-1>ERROR</FONT></TD>
255
256 <TD><FONT SIZE=-1>Y</FONT></TD>
257 </TR>
258
259 <TR>
260 <TD><FONT SIZE=-1>AWAY</FONT></TD>
261
262 <TD><FONT SIZE=-1>A</FONT></TD>
263 </TR>
264
265 <TR>
266 <TD><FONT SIZE=-1>CONNECT</FONT></TD>
267
268 <TD><FONT SIZE=-1>CO</FONT></TD>
269 </TR>
270
271 <TR>
272 <TD><FONT SIZE=-1>MAP</FONT></TD>
273
274 <TD><FONT SIZE=-1>MAP</FONT></TD>
275 </TR>
276
277 <TR>
278 <TD><FONT SIZE=-1>PING</FONT></TD>
279
280 <TD><FONT SIZE=-1>G</FONT></TD>
281 </TR>
282
283 <TR>
284 <TD><FONT SIZE=-1>PONG</FONT></TD>
285
286 <TD><FONT SIZE=-1>Z</FONT></TD>
287 </TR>
288
289 <TR>
290 <TD><FONT SIZE=-1>OPER</FONT></TD>
291
292 <TD><FONT SIZE=-1>OPER</FONT></TD>
293 </TR>
294
295 <TR>
296 <TD><FONT SIZE=-1>PASS</FONT></TD>
297
298 <TD><FONT SIZE=-1>PA</FONT></TD>
299 </TR>
300
301 <TR>
302 <TD><FONT SIZE=-1>WALLOPS</FONT></TD>
303
304 <TD><FONT SIZE=-1>WA</FONT></TD>
305 </TR>
306
307 <TR>
308 <TD><FONT SIZE=-1>DESYNCH</FONT></TD>
309
310 <TD><FONT SIZE=-1>DS</FONT></TD>
311 </TR>
312
313 <TR>
314 <TD><FONT SIZE=-1>TIME</FONT></TD>
315
316 <TD><FONT SIZE=-1>TI</FONT></TD>
317 </TR>
318
319 <TR>
320 <TD><FONT SIZE=-1>SETTIME</FONT></TD>
321
322 <TD><FONT SIZE=-1>SE</FONT></TD>
323 </TR>
324
325 <TR>
326 <TD><FONT SIZE=-1>RPING</FONT></TD>
327
328 <TD><FONT SIZE=-1>RI</FONT></TD>
329 </TR>
330
331 <TR>
332 <TD><FONT SIZE=-1>RPONG</FONT></TD>
333
334 <TD><FONT SIZE=-1>RO</FONT></TD>
335 </TR>
336
337 <TR>
338 <TD><FONT SIZE=-1>NAMES</FONT></TD>
339
340 <TD><FONT SIZE=-1>E</FONT></TD>
341 </TR>
342
343 <TR>
344 <TD><FONT SIZE=-1>ADMIN</FONT></TD>
345
346 <TD><FONT SIZE=-1>AD</FONT></TD>
347 </TR>
348
349 <TR>
350 <TD><FONT SIZE=-1>TRACE</FONT></TD>
351
352 <TD><FONT SIZE=-1>TR</FONT></TD>
353 </TR>
354
355 <TR>
356 <TD><FONT SIZE=-1>NOTICE</FONT></TD>
357
358 <TD><FONT SIZE=-1>O</FONT></TD>
359 </TR>
360
361 <TR>
362 <TD><FONT SIZE=-1>WALLCHOPS</FONT></TD>
363
364 <TD><FONT SIZE=-1>WC</FONT></TD>
365 </TR>
366
367 <TR>
368 <TD><FONT SIZE=-1>CPRIVMSG</FONT></TD>
369
370 <TD><FONT SIZE=-1>CP</FONT></TD>
371 </TR>
372
373 <TR>
374 <TD><FONT SIZE=-1>CNOTICE</FONT></TD>
375
376 <TD><FONT SIZE=-1>CN</FONT></TD>
377 </TR>
378
379 <TR>
380 <TD><FONT SIZE=-1>JOIN</FONT></TD>
381
382 <TD><FONT SIZE=-1>J</FONT></TD>
383 </TR>
384
385 <TR>
386 <TD><FONT SIZE=-1>PART</FONT></TD>
387
388 <TD><FONT SIZE=-1>L</FONT></TD>
389 </TR>
390
391 <TR>
392 <TD><FONT SIZE=-1>LUSERS</FONT></TD>
393
394 <TD><FONT SIZE=-1>LU</FONT></TD>
395 </TR>
396
397 <TR>
398 <TD><FONT SIZE=-1>MOTD</FONT></TD>
399
400 <TD><FONT SIZE=-1>MO</FONT></TD>
401 </TR>
402
403 <TR>
404 <TD><FONT SIZE=-1>MODE</FONT></TD>
405
406 <TD><FONT SIZE=-1>M</FONT></TD>
407 </TR>
408
409 <TR>
410 <TD><FONT SIZE=-1>KICK</FONT></TD>
411
412 <TD><FONT SIZE=-1>K</FONT></TD>
413 </TR>
414
415 <TR>
416 <TD><FONT SIZE=-1>USERHOST</FONT></TD>
417
418 <TD><FONT SIZE=-1>USERHOST</FONT></TD>
419 </TR>
420
421 <TR>
422 <TD><FONT SIZE=-1>USERIP</FONT></TD>
423
424 <TD><FONT SIZE=-1>USERIP</FONT></TD>
425 </TR>
426
427 <TR>
428 <TD><FONT SIZE=-1>ISON</FONT></TD>
429
430 <TD><FONT SIZE=-1>ISON</FONT></TD>
431 </TR>
432
433 <TR>
434 <TD><I><FONT SIZE=-1>SQUERY</FONT></I></TD>
435
436 <TD><I><FONT SIZE=-1>SQUERY</FONT></I></TD>
437 </TR>
438
439 <TR>
440 <TD><I><FONT SIZE=-1>SERVLIST</FONT></I></TD>
441
442 <TD><I><FONT SIZE=-1>SERVLIST</FONT></I></TD>
443 </TR>
444
445 <TR>
446 <TD><I><FONT SIZE=-1>SERVSET</FONT></I></TD>
447
448 <TD><I><FONT SIZE=-1>SERVSET</FONT></I></TD>
449 </TR>
450
451 <TR>
452 <TD><FONT SIZE=-1>REHASH</FONT></TD>
453
454 <TD><FONT SIZE=-1>REHASH</FONT></TD>
455 </TR>
456
457 <TR>
458 <TD><FONT SIZE=-1>RESTART</FONT></TD>
459
460 <TD><FONT SIZE=-1>RESTART</FONT></TD>
461 </TR>
462
463 <TR>
464 <TD><FONT SIZE=-1>CLOSE</FONT></TD>
465
466 <TD><FONT SIZE=-1>CLOSE</FONT></TD>
467 </TR>
468
469 <TR>
470 <TD><FONT SIZE=-1>DIE</FONT></TD>
471
472 <TD><FONT SIZE=-1>DIE</FONT></TD>
473 </TR>
474
475 <TR>
476 <TD><FONT SIZE=-1>HASH</FONT></TD>
477
478 <TD><FONT SIZE=-1>HASH</FONT></TD>
479 </TR>
480
481 <TR>
482 <TD><FONT SIZE=-1>DNS</FONT></TD>
483
484 <TD><FONT SIZE=-1>DNS</FONT></TD>
485 </TR>
486
487 <TR>
488 <TD><FONT SIZE=-1>SILENCE</FONT></TD>
489
490 <TD><FONT SIZE=-1>U</FONT></TD>
491 </TR>
492
493 <TR>
494 <TD><FONT SIZE=-1>GLINE</FONT></TD>
495
496 <TD><FONT SIZE=-1>GL</FONT></TD>
497 </TR>
498
499 <TR>
500 <TD><FONT SIZE=-1>BURST</FONT></TD>
501
502 <TD><FONT SIZE=-1>B</FONT></TD>
503 </TR>
504
505 <TR>
506 <TD><FONT SIZE=-1>CREATE</FONT></TD>
507
508 <TD><FONT SIZE=-1>C</FONT></TD>
509 </TR>
510
511 <TR>
512 <TD><FONT SIZE=-1>DESTRUCT</FONT></TD>
513
514 <TD><FONT SIZE=-1>DE</FONT></TD>
515 </TR>
516
517 <TR>
518 <TD><FONT SIZE=-1>END_OF_BURST</FONT></TD>
519
520 <TD><FONT SIZE=-1>EB</FONT></TD>
521 </TR>
522
523 <TR>
524 <TD><FONT SIZE=-1>END_OF_BURST_ACK</FONT></TD>
525
526 <TD><FONT SIZE=-1>EA</FONT></TD>
527 </TR>
528
529 <TR>
530 <TD><FONT SIZE=-1>PROTO</FONT></TD>
531
532 <TD><FONT SIZE=-1>PROTO</FONT></TD>
533 </TR>
534
535 <TR>
536 <TD><FONT SIZE=-1>JUPE</FONT></TD>
537
538 <TD><FONT SIZE=-1>JU</FONT></TD>
539 </TR>
540
541 <TR>
542 <TD><FONT SIZE=-1>OPMODE</FONT></TD>
543
544 <TD><FONT SIZE=-1>OM</FONT></TD>
545 </TR>
546
547 <TR>
548 <TD><FONT SIZE=-1>CLEARMODE</FONT></TD>
549
550 <TD><FONT SIZE=-1>CM</FONT></TD>
551 </TR>
552 </TABLE></CENTER>
553 <FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
554 <BR>
555 <HR ALIGN=LEFT WIDTH=100% SIZE=2>
556 <P><A NAME="chap3"></A><B><FONT SIZE=+2>3. Registration and syncronisation</FONT></B>
557 <P><A NAME="chap3.1"></A><B><FONT SIZE=+1>3.1 Server registration and authentication</FONT></B>
558 <P>After a TCP connection has been established, the server initally introduces
559 itself via a "PASS" message as follows:
560 <BLOCKQUOTE>
561 <PRE><FONT COLOR="#00007F">PASS :[PASSWORD]</FONT></PRE>
562 </BLOCKQUOTE>
563 "PASSWORD" is simply compared with the password present in the destination
564 servers config file, and is used to confirm credentials after the "SERVER"
565 message has been recieved, as follows:
566 <BLOCKQUOTE>
567 <PRE><TT><FONT COLOR="#00007F">SERVER [SERVERNAME] [HOPCOUNT] [START TIME] [LINK TIME] [PROTOCOL] [NUMERIC/MAXCONN] :[DESCRIPTION]</FONT></TT></PRE>
568 </BLOCKQUOTE>
569 For Example:
570 <BLOCKQUOTE>
571 <PRE><B>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;
572 </B>SERVER irc.undernet.org 1 933022556 947908144 J10 AA]]] :[127.0.0.1] A Undernet Server.</PRE>
573 </BLOCKQUOTE>
574 <I>Notes:</I>
575 <OL>
576 <LI>
577 The SERVER message, indicating this connection wishes to introduce a new
578 server to the network.</LI>
579
580 <LI>
581 &nbsp;The name of the server you are introducing, a valid server name consists
582 of [..defn..].</LI>
583
584 <LI>
585 &nbsp;The hop count of the server you are introducing, this is always 1
586 when you are introducing yourself.</LI>
587
588 <LI>
589 &nbsp;The epoch timestamp specifying when the ircd was started.</LI>
590
591 <LI>
592 &nbsp;The epoch timestamp specifying the time the server initiated the
593 link to the network.</LI>
594
595 <LI>
596 &nbsp;The Protocol identifier of this server.</LI>
597
598 <OL>
599 <LI>
600 This token informs the network which protocol it is compliant with, eg:
601 If it is a P10 compliant server, then the token will be "P10".</LI>
602
603 <LI>
604 &nbsp;If the server being introduced has not yet successfully synced its
605 database with the network (Completed its net.burst - see 3.2), then the
606 Protocol token should be prefixed with a J, instead of a P (Eg: J10) to
607 indicate it is currently still <B>j</B>oining the network.</LI>
608
609 <LI>
610 &nbsp;The protocol token should always be JXX when the server is introducing
611 <B>itself</B>.</LI>
612 </OL>
613
614 <LI>
615 The numeric, and maximum connections identifier for this server.</LI>
616
617 <OL>
618 <LI>
619 This token is formatted exactly the same as a client numeric is formatted.
620 The first 2 characters identify the server's numeric, whilst in this situation,
621 the final 3 characters define the maximum number of clients that this server
622 can hold (and more importantly, the maximum number of numerics it will
623 generate).</LI>
624
625 <LI>
626 &nbsp;The example "AA]]]" shows that this is a server with numeric 0, which
627 will generate client numerics up to 262,143.</LI>
628 </OL>
629
630 <LI>
631 This final parameter simply consists of a textual description of the server
632 prefixed by a colon. This is displayed in a clients WHOIS line, aswell
633 as in the LINKS reply.</LI>
634 </OL>
635 <A NAME="chap3.2"></A><B><FONT SIZE=+1>3.2 Network Database resyncronisation</FONT></B>
636 <P>After the connection has been established and verified, the next step
637 is to syncronise the database of client/server/channel information between
638 the two servers.
639 <BLOCKQUOTE><B>3.2.1 - SERVER Messages</B></BLOCKQUOTE>
640
641 <BLOCKQUOTE>Server details are transmitted via "SERVER" messages similar
642 to the initial introduction message, with the following format:</BLOCKQUOTE>
643
644 <BLOCKQUOTE>
645 <BLOCKQUOTE><TT><FONT COLOR="#00007F">[OWNING SERVER PREFIX] S [SERVERNAME]
646 [HOPCOUNT] [START TIME] [LINK TIME] [PROTOCOL] [NUMERIC/MAXCONN] 0 :[DESCRIPTION]</FONT></TT></BLOCKQUOTE>
647 <FONT COLOR="#000000">The syntax of this message is almost identical to
648 the originally recieved server message, with the only exception being that
649 the message is numeric prefixed, to indicate which server sent this message
650 (and also therefore, which hub this new server is linked too). There is
651 also a fixed "0" present before the Description field, this is a placeholder
652 for future use and currently unused.</FONT>
653 <P><B>3.2.2 - NICK Messages</B></BLOCKQUOTE>
654
655 <BLOCKQUOTE>Client information is transmitted via "NICK" messages, of the
656 following format:</BLOCKQUOTE>
657
658 <BLOCKQUOTE>
659 <BLOCKQUOTE>
660 <PRE><TT><FONT COLOR="#00007F">[NUMERIC PREFIX] N [NICK] [HOPCOUNT] [TIMESTAMP] [USERNAME] [HOST] &lt;+modes> [BASE64 IP] [NUMERIC] :[USERINFO]</FONT></TT></PRE>
661 </BLOCKQUOTE>
662 <FONT COLOR="#00007F">For Example:</FONT>
663 <BLOCKQUOTE><TT><FONT COLOR="#000000">1&nbsp; 2 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
664 4 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp;
665 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;
666 9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp; 11</FONT></TT>
667 <BR><TT><FONT COLOR="#000000">AF N Client1 1 947957573 User userhost.net
668 +oiwg DAqAoB AFAAA :Generic Client.</FONT></TT></BLOCKQUOTE>
669 <I>Notes:</I>
670 <OL>
671 <LI>
672 The numeric of the server sending this message. (And hence, owning this
673 client).</LI>
674
675 <LI>
676 The "NICK" token.</LI>
677
678 <LI>
679 The nickname of this client, currently max 9 chars.</LI>
680
681 <LI>
682 The "Hopcount" of this client, Ie: how many servers away it is on.</LI>
683
684 <LI>
685 The epoch timestamp indicating when the user was created.</LI>
686
687 <LI>
688 The "User" part of the user@host mask.</LI>
689
690 <LI>
691 the "Host" part of the user@host mask.</LI>
692
693 <LI>
694 [<B>Optional</B>]: User modes. If present, this is always +&lt;user modes
695 for this client>.</LI>
696
697 <LI>
698 The real IP address of this client, a Base64 encoded 32bit int.</LI>
699
700 <LI>
701 This client's numeric, in SSCCC format.</LI>
702
703 <LI>
704 Free format user info line.</LI>
705
706 <BR>&nbsp;</OL>
707 </BLOCKQUOTE>
708
709 <BLOCKQUOTE><B>3.2.3 - BURST Messages</B></BLOCKQUOTE>
710
711 <BLOCKQUOTE>Channel details and membership information is synchronised
712 in one (or more) BURST messages for each channel that exists, formatted
713 as follows:</BLOCKQUOTE>
714
715 <BLOCKQUOTE>
716 <BLOCKQUOTE>
717 <PRE><TT><FONT COLOR="#00007F">[NUMERIC PREFIX] B [CHANNEL] [CREATION TIMESTAMP] &lt;+MODES> &lt;ARG1> &lt;ARG2> [MEMBER LIST] &lt;:%BANS></FONT></TT></PRE>
718 </BLOCKQUOTE>
719 </BLOCKQUOTE>
720
721 <BLOCKQUOTE>For Example:</BLOCKQUOTE>
722
723 <BLOCKQUOTE>
724 <BLOCKQUOTE>
725 <PRE>1&nbsp; 2 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp; 7&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9
726 AZ B #coder-com 949217470 +tinkl key 56 AAAAA,AAAAB,AAAAC,ABAAA,ABAAB,ABAAC,ACAAA :%*!*@*.net</PRE>
727 </BLOCKQUOTE>
728 </BLOCKQUOTE>
729
730 <BLOCKQUOTE><I>Notes:</I></BLOCKQUOTE>
731
732 <OL>
733 <LI>
734 The numeric of the server sending this message.</LI>
735
736 <LI>
737 The "BURST" token.</LI>
738
739 <LI>
740 The name of the channel to which this data belongs. Currently #Channel
741 and +Channel names can be sent in a BURST message, &amp;Channels are not
742 because by definition they are local to the server.</LI>
743
744 <LI>
745 The epoch timestamp indicating when the channel was created.</LI>
746
747 <LI>
748 [<B>Optional</B>]: Channel Modes.</LI>
749
750 <OL>
751 <LI>
752 The channel may have a number of modes set, aswell as relevant mode arguments
753 in the following 2 parameters.</LI>
754 </OL>
755
756 <LI>
757 [<B>Optional</B>]: Channel Key, this parameter is present if the channel
758 modes contain a "k" mode.</LI>
759
760 <LI>
761 [<B>Optional</B>]: Channel Limit, this parameter is present if the channel
762 modes contain a "l" mode.</LI>
763
764 <LI>
765 &nbsp;A <I>comma</I> seperated list of client numerics, with the following
766 specific formatting rules to indicate +o, +v and +ov channel members.</LI>
767
768 <OL>
769 <LI>
770 Numerics can have the following symbols appended on them; "<B>:ov</B>",
771 "<B>:v</B>" or "<B>:o</B>". These indicate that this numeric is either
772 Opped (<B>:o</B>), Voiced (<B>:v</B>) or both (<B>:ov</B>). This state
773 applies to the numeric it is attached too, and all subsequent numerics
774 until another state is encountered. <I>For Example:</I></LI>
775
776 <LI>
777 AAABA:ov, AAABB:o,AAABC,AAABD,AAABE:v,AAABZ</LI>
778
779 <BR>Here, AAABA is both opped, and voiced, AAABB, AAABC and AAABD are opped
780 leaving AAABE and AAABZ voiced.
781 <LI>
782 &nbsp;The first numeric of the member list will always contain a state
783 symbol.</LI>
784 </OL>
785
786 <LI>
787 A <I>space</I> seperated list of bans present in the channel. The start
788 of the ban stream is indicated by a ":%", everything following the ":%"
789 is the ban list.</LI>
790
791 <BR><I>For Example:</I>
792 <BR>:%*!*@*.foobar.net another!ban@*.com *!*fred@a.host.co.uk
793 <BR>Would add the following bans to the channel:
794 <P>*!*@*.foobar.net
795 <BR>another!ban@*.com
796 <BR>*!*fred@a.host.co.uk</OL>
797
798 <BLOCKQUOTE>If the length of a BURST message exceeds the maximum lenght
799 of a line (512 characters) then the remaining channel members/bans are
800 sent in subsequent BURST lines. The subsequent burst lines are <B>only</B>
801 used to add additional members to the channel, and if neccessary, channel
802 bans. There will be no "Mode" parameters present. A sample additional burst
803 line would be:</BLOCKQUOTE>
804
805 <BLOCKQUOTE>
806 <BLOCKQUOTE>
807 <PRE>AZ BURST #coder-com 949217470 ACAAB:o,ACAAD :%*!*another@*.ban.com</PRE>
808 </BLOCKQUOTE>
809 </BLOCKQUOTE>
810
811 <BLOCKQUOTE>Which adds two more opped members and a ban to the channel.</BLOCKQUOTE>
812
813 <BLOCKQUOTE><B>3.2.4 - JUPE Messages</B></BLOCKQUOTE>
814
815 <BLOCKQUOTE>Any currently unexpired JUPEs are transmitted via "JUPE"
816 messages with the following format:</BLOCKQUOTE>
817
818 <BLOCKQUOTE>
819 <BLOCKQUOTE><TT><FONT COLOR="#00007F">[NUMERIC PREFIX] JU * (+|-)[SERVER NAME]
820 [LIFETIME] [LAST MOD] :[REASON]</FONT></TT></BLOCKQUOTE>
821 </BLOCKQUOTE>
822 <BLOCKQUOTE><I>Notes:</I></BLOCKQUOTE>
823
824 <OL>
825 <LI>
826 The numeric of the server sending this message.</LI>
827
828 <LI>
829 The "JUPE" token.</LI>
830
831 <LI>
832 The target that should apply this JUPE (always "*" during bursts).</LI>
833
834 <LI>
835 The name of the server to JUPE, prefixed with a "+" if the JUPE is active,
836 or with a "-" if it is not.</LI>
837
838 <LI>
839 The remaining absolute lifetime of the JUPE, expressed in seconds.</LI>
840
841 <LI>
842 The last time the JUPE was modified.</LI>
843
844 <LI>
845 The reason the JUPE was applied.</LI>
846
847 </OL>
848
849 <A NAME="chap3.3"></A><B><FONT SIZE=+1>3.3 Summary</FONT></B>
850 <P>The following table summarises the sequence of events that occur when
851 a server connects to another server. S1 is our server, and S2 is a HUB
852 on the target network.
853 <P>S1: Sends Password.
854 <BR>S1: Sends initial SERVER message.
855 <P><I>S2 Confirms S1 has the correct credentials, and if so, proceeds.
856 If not, S1 is squit with a relevant reason.</I>
857 <P>S2: Sends Password.
858 <BR>S2: Sends initial SERVER message.
859 <P><I>S1 Confirms S2 has the correct credentials, and if so, proceeds.
860 If not, S2 is squit with a relevant reason.</I>
861 <P><B><I>The follow occur asynchronously, however they have been shown
862 seperately below for simplicity.</I></B>
863 <P>S1: Sends all the servers it is aware of as a stream of SERVER messages.
864 <BR>S1: Sends all the clients it is aware of as a stream of NICK messages.
865 <BR>S1: Sends the database of channel states on the network, as a stream
866 of BURST messages.
867 <BR>S1: Sends all the jupes it is aware of as a stream of JUPE messages.
868 <BR>S1: Sends a END_OF_BURST token (EB) to indicate it has finished sending.
869 <P>S2: Sends all the servers it is aware of as a stream of SERVER messages.
870 <BR>S2: Sends all the clients it is aware of as a stream of NICK messages.
871 <BR>S2: Sends the database of channel states on the network, as a stream
872 of BURST messages.
873 <BR>S2: Sends all the jupes it is aware of as a stream of JUPE messages.
874 <BR>S2: Sends a END_OF_BURST token (EB) to indicate it has finished sending.
875 <P>S2: Sends an EOB_ACK token (EA) to indicate it has succesfully recieved
876 the END_OF_BURST from S1
877 <BR>S1: Sends an EOB_ACK token (EA) to indicate it has succesfully recieved
878 the END_OF_BURST from S2
879 <P><I>Example Session:</I>
880 <PRE><FONT COLOR="#00007F">[WRITE]: PASS :54321
881 [WRITE]: SERVER irc.undernet.org 1 947957852 947957852 J10 AB]]] :Undernet Client Server.
882 [WRITE]: AB N MrFoo 1 947957852 ~me myhost.foobar.net +diksw DAqAoB ABAAA :Mr Foo (foo@bar.com).
883 [WRITE]: AB B #mychannel 946101324 ABAAA:o
884 [WRITE]: AB EB
885 [ READ]: PASS :54321
886 [ READ]: SERVER server1.undernet.org 1 947901540 947958150 J10 AFAD] :A Generic Server.
887 [ READ]: AF S server2.undernet.org 2 0 947957585 P10 AZAD] 0 :[192.168.10.3] A Generic Server.
888 [ READ]: AZ S server3.undernet.org 3 0 947957607 P10 AIAD] 0 :[192.168.10.5] A Generic Server.
889 [ READ]: AF N Client1 1 947957573 Ident userhost.net +oiwg DAqAoB AFAAA :Generic Client.
890 [ READ]: AZ N Client2 2 947957719 Ident userhost.net +iwg DAqAoB AZAAA :Generic Client.
891 [ READ]: AI N Client3 3 947957742 Ident userhost.net +iwg DAqAoB AIAAA :Generic Client.
892 [ READ]: AI N Client4 3 947958121 Ident userhost.net +iwg DAqAoB AIAAB :Generic Client.
893 [ READ]: AF B #foobar 947957734 +tink akey AIAAB,AIAAA:v,AZAAA:o :%*!*another@*.ban.com *!*foo@bar.net
894 [ READ]: AF B #coder-com 947957727 AIAAB,AZAAA:o
895 [ READ]: AF B #another 946101321 AFAAA
896 [ READ]: AF JU * +juped.undernet.org 3600 947958100 :Broken, please fix
897 [ READ]: AF EB
898 [WRITE]: AB EA
899 [ READ]: AF EA</FONT></PRE>
900 <FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
901 <BR>
902 <HR WIDTH="100%">
903 <BR><A NAME="chap4"></A><B><FONT SIZE=+2>4. Continuous Operation</FONT></B>
904 <P><FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
905 <BR>
906 <HR ALIGN=LEFT WIDTH=100% SIZE=2>
907 <P><A NAME="chap5"></A><B><FONT SIZE=+2>5. Programmers reference: Client/Server
908 Structures</FONT></B>
909 <P>This section provides information on the standard Client/Server structures,
910 for easy reference during development.
911 <P><I>[..Link to autogenerated struct.html..]</I>
912 <P><FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
913 <BR>
914 <HR ALIGN=LEFT WIDTH=100% SIZE=2>
915 <BR><A NAME="chap7"></A><B><FONT SIZE=+2>7. FAQ</FONT></B>
916 <P>Frequently asked questions.
917 <UL>
918 <LI>
919 Q. How..</LI>
920
921 <LI>
922 A. ...</LI>
923 </UL>
924 <FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
925 <BR>
926 <HR WIDTH="100%">
927 <P><A NAME="chap8"></A><B><FONT SIZE=+2>8. Update History</FONT></B>
928 <P>[20/01/2000]: Initial draft, structure, background info.
929 <BR>[13/02/2000]: Added initial BURST documentation.
930 <BR>[14/02/2000]: Continued BURST documentation / Begin NICK and SERVER
931 documentation.
932 <BR>[26/02/2000]: Continued chapter 5, few example fixes, added token table
933 from msg.h. --Gte.
934 <BR>[02/03/2000]: Added NICK spec. --Gte.
935 <BR>[18/03/2000]: Added JUPE spec. -Kev
936 <BR>[2000-04-10]: Added information about OPMODE and CLEARMODE tokens. -Kev
937 <P><A NAME="chap8.1"></A><B><FONT SIZE=+1>8.1 TODO</FONT></B>
938 <UL>
939 <LI>
940 Finish Chapter 5.</LI>
941
942 <LI>
943 Go through examples, and ensure they are all correct.</LI>
944
945 <LI>
946 Add common function headers, with argv listings.</LI>
947
948 <LI>
949 Add description of further server&lt;&gt;server messages, with special cases
950 and outcomes.</LI>
951
952 <LI>
953 Add FAQ Section.</LI>
954 </UL>
955 <FONT FACE="Arial,Helvetica"><FONT SIZE=-1><B>[</B><A HREF="#top">Back</A><B>]</B></FONT></FONT>
956 </BODY>
957 </HTML>