summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae71903)
raw | patch | inline | side by side (parent: ae71903)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 5 Oct 2014 14:27:52 +0000 (16:27 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 5 Oct 2014 14:27:52 +0000 (16:27 +0200) |
src/include/frontend/proto.h | patch | blob | history |
index e9001cbb413003b01e8a3ab745827e228eaab3fa..5e3019cf0ba4e6fad0d410f663108fa51018b7ca 100644 (file)
* message body depends on the message type. Both, the message type and length
* are stored in an unsigned 32bit integer in network byte-order.
*
+ * Any strings in the message body may not include a zero byte.
+ *
* 1 3 4 6
* 0 6 2 8 4
* +-------------------------------+-------------------------------+
*
* 0 32 64
* +---------------+---------------+
- * | message type | length |
+ * | OK | len(msg) |
* +---------------+---------------+
* | optional status message ... |
*/
*
* 0 32 64
* +---------------+---------------+
- * | message type | length |
+ * | ERROR | len(msg) |
* +---------------+---------------+
* | error message ... |
*/
*
* 0 32 64
* +---------------+---------------+
- * | message type | length |
+ * | LOG | length |
* +---------------+---------------+
* | log priority | log message |
* +---------------+ |
*
* 0 32 64
* +---------------+---------------+
- * | message type | length |
+ * | DATA | length |
* +---------------+---------------+
* | result type | result ... |
* +---------------+ |
/*
* CONNECTION_PING:
* Check if the current connection is still alive. The server will reply
- * with CONNECTION_OK if it was able to handle the command.
+ * with CONNECTION_OK and an empty message body if it was able to handle
+ * the command.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | PING | 0 |
+ * +---------------+---------------+
*/
CONNECTION_PING,
* the server using special messages specific to the authentication
* method. The server does not send any asynchronous messages before
* startup is complete.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | STARTUP | len(username) |
+ * +---------------+---------------+
+ * | username ... |
*/
CONNECTION_STARTUP,
* CONNECTION_QUERY:
* Execute a query in the server. The message body shall include a single
* query command as a text string. Multiple commands are ignored by the
- * server entirely.
+ * server entirely to protect against injection attacks.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | QUERY | len(query) |
+ * +---------------+---------------+
+ * | query string ... |
*/
CONNECTION_QUERY,
* include the type and the identifier of the object to be retrieved.
* Hosts are identified by their name. Other types are not supported yet.
* The type is encoded as a 32bit integer in network byte-order.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | FETCH | length |
+ * +---------------+---------------+
+ * | object type | identifier |
+ * +---------------+ |
+ * | ... |
*/
CONNECTION_FETCH,
* the type of the objects to be listed, encoded as a 32bit integer in
* network byte-order. The response includes all hosts and the respective
* child objects. By default, all hosts are listed.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | LIST | length |
+ * +---------------+---------------+
+ * | [object type] |
+ * +---------------+
*/
CONNECTION_LIST,
* include the type of the objects to look up and a string representing
* the conditional expression of the 'MATCHING' clause. The type is
* encoded as a 32bit integer in network byte-order.
+ *
+ * 0 32 64
+ * +---------------+---------------+
+ * | LOOKUP | length |
+ * +---------------+---------------+
+ * | object type | matching |
+ * +---------------+ |
+ * | clause ... |
*/
CONNECTION_LOOKUP,