]> jfr.im git - irc/rqf/shadowircd.git/blob - servlink/README
[svn] - the new plan:
[irc/rqf/shadowircd.git] / servlink / README
1 Servlink protocol documentation.
2 $Id: README 1285 2006-05-05 15:03:53Z nenolod $
3 --------------
4
5 After negotiating an incoming/outgoing server connection, the ircd will
6 fork, then execve servlink, with fd 0 as one end of a control pipe and
7 fd 1 as one end of a data pipe. fd 2 will be the socket connected to
8 the remote server.
9
10 The data pipe is used by the ircd to send/receive normal, decrypted,
11 uncompressed IRC commands to/from the remote server. The socket is used to
12 send the (processed) data to the remote server, and receive the data from
13 the remote server.
14
15 The control pipe is used to activate encryption/compression and to set the
16 encryption key/algorithm to be used.
17
18 Format of control messages:
19
20 <u8 command><optional data>
21
22 data format:
23 <u16 len><data>
24
25 Commands:
26
27 001 - SET_ZIP_OUT_LEVEL
28 data: yes
29 description:
30 set compression level (0 [use default, 6], or 1-9)
31
32 002 - START_ZIP_OUT
33 data: no
34 description:
35 all data written to the data pipe will be compressed
36 prior to being sent to the remote server.
37
38 003 - START_ZIP_IN
39 data: no
40 description:
41 all data not yet read from the slink program will be
42 decompressed before reading
43
44 004 - INJECT_RECVQ
45 data: recvq
46
47 Used before INIT to inject any data read from the server fd which
48 should be pre-processed by servlink before being sent back
49 to the LOCAL_FD through the data fd.
50
51 005 - INJECT_SENDQ
52 data: sendq
53
54 As above, but sent to remote server without processing.
55
56 006 - INIT
57
58 007 - ZIPSTATS
59 request to send ziplinks statistics reply.
60
61 replies
62
63 001 - ERROR
64 data: u32 len/char error[len]
65
66 fatal error message.
67
68 002 - ZIPSTATS
69 data: u32 in/u32 in_wire/u32 out/u32 out_wire
70
71 ziplinks commpression statistics