Code

parser: Let the TIMESERIES command accept optional data-source names.
[sysdb.git] / src / include / frontend / proto.h
index 52b50d197ebc868438b5d1394c41edb05ecf3188..ade3a7cb192eaa7fc1ccf0fa5c01c050723c69e8 100644 (file)
@@ -298,8 +298,39 @@ typedef enum {
         * A parsed expression. Only used internally.
         */
        SDB_CONNECTION_EXPR,
+
+       /*
+        * Server status queries.
+        */
+
+       /*
+        * SDB_CONNECTION_SERVER_VERSION:
+        * Retrieve the server version. The server replies with SDB_CONNECTION_OK
+        * on success and the server version as an unsigned 32-bit integer,
+        * optionally followed by a string describing extra version components.
+        * The integer server version is encoded as 100000 * major + 100 * minor +
+        * patch.
+        *
+        * 0               32              64
+        * +---------------+---------------+
+        * | SERVER_VERSION| 0             |
+        * +---------------+---------------+
+        */
+       SDB_CONNECTION_SERVER_VERSION = 1000,
 } sdb_conn_state_t;
 
+#define SDB_CONN_MSGTYPE_TO_STRING(t) \
+       (((t) == SDB_CONNECTION_IDLE) ? "IDLE" \
+               : ((t) == SDB_CONNECTION_PING) ? "PING" \
+               : ((t) == SDB_CONNECTION_STARTUP) ? "STARTUP" \
+               : ((t) == SDB_CONNECTION_QUERY) ? "QUERY" \
+               : ((t) == SDB_CONNECTION_FETCH) ? "FETCH" \
+               : ((t) == SDB_CONNECTION_LIST) ? "LIST" \
+               : ((t) == SDB_CONNECTION_LOOKUP) ? "LOOKUP" \
+               : ((t) == SDB_CONNECTION_TIMESERIES) ? "TIMESERIES" \
+               : ((t) == SDB_CONNECTION_STORE) ? "STORE" \
+               : "UNKNOWN")
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif