diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:36:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:36:47 +0000 |
commit | 0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch) | |
tree | 3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib-dict/dict-client.h | |
parent | Initial commit. (diff) | |
download | dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip |
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/lib-dict/dict-client.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/lib-dict/dict-client.h b/src/lib-dict/dict-client.h new file mode 100644 index 0000000..95e2fb0 --- /dev/null +++ b/src/lib-dict/dict-client.h @@ -0,0 +1,48 @@ +#ifndef DICT_CLIENT_H +#define DICT_CLIENT_H + +#include "dict.h" + +#define DEFAULT_DICT_SERVER_SOCKET_FNAME "dict" + +#define DICT_CLIENT_PROTOCOL_MAJOR_VERSION 3 +#define DICT_CLIENT_PROTOCOL_MINOR_VERSION 2 + +#define DICT_CLIENT_PROTOCOL_VERSION_MIN_MULTI_OK 2 + +#define DICT_CLIENT_MAX_LINE_LENGTH (64*1024) + +enum dict_protocol_cmd { + /* <major-version> <minor-version> <value type> <user> <dict name> */ + DICT_PROTOCOL_CMD_HELLO = 'H', + + DICT_PROTOCOL_CMD_LOOKUP = 'L', /* <key> */ + DICT_PROTOCOL_CMD_ITERATE = 'I', /* <flags> <path> */ + + DICT_PROTOCOL_CMD_BEGIN = 'B', /* <id> */ + DICT_PROTOCOL_CMD_COMMIT = 'C', /* <id> */ + DICT_PROTOCOL_CMD_COMMIT_ASYNC = 'D', /* <id> */ + DICT_PROTOCOL_CMD_ROLLBACK = 'R', /* <id> */ + + DICT_PROTOCOL_CMD_SET = 'S', /* <id> <key> <value> */ + DICT_PROTOCOL_CMD_UNSET = 'U', /* <id> <key> */ + DICT_PROTOCOL_CMD_ATOMIC_INC = 'A', /* <id> <key> <diff> */ + DICT_PROTOCOL_CMD_TIMESTAMP = 'T', /* <id> <secs> <nsecs> */ + DICT_PROTOCOL_CMD_HIDE_LOG_VALUES = 'V', /* <id> <hide_log_values> */ +}; + +enum dict_protocol_reply { + DICT_PROTOCOL_REPLY_ERROR = -1, + + DICT_PROTOCOL_REPLY_OK = 'O', /* <value> */ + DICT_PROTOCOL_REPLY_MULTI_OK = 'M', /* protocol v2.2+ */ + DICT_PROTOCOL_REPLY_NOTFOUND = 'N', + DICT_PROTOCOL_REPLY_FAIL = 'F', + DICT_PROTOCOL_REPLY_WRITE_UNCERTAIN = 'W', + DICT_PROTOCOL_REPLY_ASYNC_COMMIT = 'A', + DICT_PROTOCOL_REPLY_ITER_FINISHED = '\0', + DICT_PROTOCOL_REPLY_ASYNC_ID = '*', + DICT_PROTOCOL_REPLY_ASYNC_REPLY = '+', +}; + +#endif |