File: HACKING

package info (click to toggle)
qcontrol 0.5.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: ansic: 2,020; sh: 228; makefile: 82
file content (45 lines) | stat: -rw-r--r-- 1,427 bytes parent folder | download | duplicates (9)
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
45
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.