| 1 |
adx |
30 |
Servlink protocol documentation. |
| 2 |
knight |
31 |
$Id$ |
| 3 |
adx |
30 |
-------------- |
| 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 - SET_CRYPT_IN_CIPHER |
| 45 |
|
|
data: <u8 cipher id> |
| 46 |
|
|
|
| 47 |
|
|
001 - BLOWFISH |
| 48 |
|
|
002 - CAST |
| 49 |
|
|
003 - DES |
| 50 |
|
|
004 - 3DES |
| 51 |
|
|
005 - IDEA |
| 52 |
|
|
006 - RC5 ( 8 rounds) |
| 53 |
|
|
007 - RC5 (12 rounds) |
| 54 |
|
|
008 - RC5 (16 rounds) |
| 55 |
|
|
|
| 56 |
|
|
cannot be called whilst decryption is active. |
| 57 |
|
|
|
| 58 |
|
|
005 - SET_CRYPT_IN_KEY |
| 59 |
|
|
data: <key> |
| 60 |
|
|
|
| 61 |
|
|
cannot be called whilst decryption is active. |
| 62 |
|
|
|
| 63 |
|
|
006 - START_CRYPT_IN |
| 64 |
|
|
|
| 65 |
|
|
007 - SET_CRYPT_OUT_CIPHER |
| 66 |
|
|
data: <u8 cipher id> |
| 67 |
|
|
|
| 68 |
|
|
001 - BLOWFISH |
| 69 |
|
|
002 - CAST |
| 70 |
|
|
003 - DES |
| 71 |
|
|
004 - 3DES |
| 72 |
|
|
005 - IDEA |
| 73 |
|
|
006 - RC5 ( 8 rounds) |
| 74 |
|
|
007 - RC5 (12 rounds) |
| 75 |
|
|
008 - RC5 (16 rounds) |
| 76 |
|
|
|
| 77 |
|
|
cannot be called whilst encryption is active. |
| 78 |
|
|
|
| 79 |
|
|
008 - SET_CRYPT_OUT_KEY |
| 80 |
|
|
data: <key> |
| 81 |
|
|
|
| 82 |
|
|
cannot be called whilst encryption is active. |
| 83 |
|
|
|
| 84 |
|
|
009 - START_CRYPT_OUT |
| 85 |
|
|
|
| 86 |
|
|
010 - INJECT_RECVQ |
| 87 |
|
|
data: recvq |
| 88 |
|
|
|
| 89 |
|
|
Used before INIT to inject any data read from the server fd which |
| 90 |
|
|
should be pre-processed by servlink before being sent back |
| 91 |
|
|
to the LOCAL_FD through the data fd. |
| 92 |
|
|
|
| 93 |
|
|
011 - INJECT_SENDQ |
| 94 |
|
|
data: sendq |
| 95 |
|
|
|
| 96 |
|
|
As above, but sent to remote server without processing. |
| 97 |
|
|
|
| 98 |
|
|
012 - INIT |
| 99 |
|
|
|
| 100 |
|
|
013 - ZIPSTATS |
| 101 |
|
|
request to send ziplinks statistics reply. |
| 102 |
|
|
|
| 103 |
|
|
replies |
| 104 |
|
|
|
| 105 |
|
|
001 - ERROR |
| 106 |
|
|
data: u32 len/char error[len] |
| 107 |
|
|
|
| 108 |
|
|
fatal error message. |
| 109 |
|
|
|
| 110 |
|
|
002 - ZIPSTATS |
| 111 |
|
|
data: u32 in/u32 in_wire/u32 out/u32 out_wire |
| 112 |
|
|
|
| 113 |
|
|
ziplinks commpression statistics |