-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHACKING
More file actions
45 lines (30 loc) · 1.39 KB
/
HACKING
File metadata and controls
45 lines (30 loc) · 1.39 KB
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
Remote Protocol
===============
When run in daemon mode qcontrol listens on an AF_UNIX socket located at
/var/run/qcontrol.sock. By default (without --direct) qcontrol will act as a
client to this server.
There are two basic data types:
INTEGER: An unsigned 32-bit value, in host byte order.
STRING: An INTEGER length (including the NUL terminator) followed by
exactly that number of bytes. The NUL is included.
The protocol is initiated by the client. The client sends a request and then
waits for a response. The request and response are expected to be packetized
(that is, that read() will return ether a single complete message or nothing).
Request:
C->S INTEGER $argc (== n)
C->S STRING $argv[0]
C->S ...
C->S STRING $argv[n-1]
The request consists of a C style $argc+$argv[], that is an argument
count followed by the given number of strings.
Response:
C<-S INTEGER $result
C<-S OPTIONAL STRING $message
The response consists of an INTEGER $result and an optional $message.
If $result < 0 then an error has occured and $message will be present
and contains the help string for the attempted command.
If $result == 0 then if the total length of the response is exactly
32-bits then this indicates success. If the length of the response is
longer than 32-bits then the remainder is a single STRING $message
containing a list of available commands.
Otherwise $result > 0 indicates success.