summaryrefslogtreecommitdiffstats
path: root/src/imap/imap-state.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:51:24 +0000
commitf7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch)
treea3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/imap/imap-state.h
parentInitial commit. (diff)
downloaddovecot-upstream.tar.xz
dovecot-upstream.zip
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/imap/imap-state.h')
-rw-r--r--src/imap/imap-state.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/imap/imap-state.h b/src/imap/imap-state.h
new file mode 100644
index 0000000..ee00376
--- /dev/null
+++ b/src/imap/imap-state.h
@@ -0,0 +1,30 @@
+#ifndef IMAP_STATE_H
+#define IMAP_STATE_H
+
+/* Export the IMAP client state to the given buffer. Returns 1 if ok,
+ 0 if state couldn't be exported, -1 if temporary internal error error. */
+int imap_state_export_internal(struct client *client, buffer_t *dest,
+ const char **error_r);
+int imap_state_export_external(struct client *client, buffer_t *dest,
+ const char **error_r);
+
+/* Returns 1 if ok, 0 if state was corrupted, -1 if other error. Internal state
+ comes from another Dovecot component, which can override IP addresses,
+ session IDs, etc. */
+int imap_state_import_internal(struct client *client,
+ const unsigned char *data, size_t size,
+ const char **error_r);
+int imap_state_import_external(struct client *client,
+ const unsigned char *data, size_t size,
+ const char **error_r);
+
+/* INTERNAL API: Note that the "internal" flag specifies whether we're doing
+ the import/export from/to another Dovecot component or an untrusted
+ IMAP client. */
+int imap_state_export_base(struct client *client, bool internal,
+ buffer_t *dest, const char **error_r);
+ssize_t imap_state_import_base(struct client *client, bool internal,
+ const unsigned char *data, size_t size,
+ const char **error_r);
+void imap_state_import_idle_cmd_tag(struct client *client, const char *tag);
+#endif