|
1 Client-Server interaction |
|
2 ------------------------- |
|
3 |
|
4 To execute a server call, the client opens the daemon's UNIX domain |
|
5 socket (as specified by SYSCONFDIR/socket-file), and sends across the |
|
6 following data: |
|
7 |
|
8 Size Type Description |
|
9 1 int Protocol number (always 2) |
|
10 2 int Total length of all data |
|
11 1 int Number of arguments following the command |
|
12 varies string Command name |
|
13 varies strings Arguments |
|
14 |
|
15 It then receives the following response from the server: |
|
16 |
|
17 Size Type Description |
|
18 1 int Response code: one of the following |
|
19 0: OK -- operation succeeded |
|
20 1: Bad -- error in format or syntax |
|
21 2: Error -- operation failed |
|
22 varies string Message |
|
23 |
|
24 |
|
25 Strings are encoded as: |
|
26 |
|
27 Size Type Description |
|
28 2 int Length of string |
|
29 length char String data (no trailing NUL byte) |
|
30 |
|
31 All integers are unsigned, sent MSB first. |
|
32 |
|
33 Example: |
|
34 0x02 Protocol version |
|
35 0x00 0x2E Length of everything from this point on |
|
36 0x02 Number of arguments to command |
|
37 0x00 0x0A Length of command name (command name will become a |
|
38 number later) |
|
39 listdomain Command name |
|
40 0x00 0x15 Length of first argument |
|
41 mailtest.somesuch.dom First argument |
|
42 0x00 0x08 Length of second argument |
|
43 mailtest Second argument |