X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Ffrontend%2Fconnection.h;h=a2163bce9841d479557ad5f8c4f93bdf69ba4af5;hp=141248f211a97ffff1b89bc0cb07024092d3cc23;hb=ddb7ffc175e49abfa69c82777b88d73e1f1103fb;hpb=5bed28501c56d1268d49e62d807897d2ce32af3f diff --git a/src/include/frontend/connection.h b/src/include/frontend/connection.h index 141248f..a2163bc 100644 --- a/src/include/frontend/connection.h +++ b/src/include/frontend/connection.h @@ -28,6 +28,7 @@ #ifndef SDB_FRONTEND_CONNECTION_H #define SDB_FRONTEND_CONNECTION_H 1 +#include "frontend/proto.h" #include "utils/strbuf.h" #include @@ -36,19 +37,6 @@ extern "C" { #endif -/* status codes returned to a client */ -typedef enum { - CONNECTION_OK = 0, - CONNECTION_ERROR -} sdb_conn_status_t; - -/* accepted commands / state of the connection */ -typedef enum { - CONNECTION_IDLE = 0, - CONNECTION_PING, - CONNECTION_STARTUP, -} sdb_conn_state_t; - typedef struct sdb_conn sdb_conn_t; /* @@ -92,7 +80,7 @@ sdb_connection_read(sdb_conn_t *conn); */ ssize_t sdb_connection_send(sdb_conn_t *conn, uint32_t code, - uint32_t msg_len, char *msg); + uint32_t msg_len, const char *msg); /* * sdb_connection_ping: @@ -110,7 +98,7 @@ sdb_connection_ping(sdb_conn_t *conn); */ /* - * sdb_session_start: + * sdb_fe_session_start: * Start a new user session on the specified connection. * * Returns: @@ -118,7 +106,22 @@ sdb_connection_ping(sdb_conn_t *conn); * - a negative value else */ int -sdb_session_start(sdb_conn_t *conn); +sdb_fe_session_start(sdb_conn_t *conn); + +/* + * store access + */ + +/* + * sdb_fe_list: + * Send a complete listing of the store, serialized as JSON, to the client. + * + * Returns: + * - 0 on success + * - a negative value else + */ +int +sdb_fe_list(sdb_conn_t *conn); #ifdef __cplusplus } /* extern "C" */