summaryrefslogtreecommitdiffstats
path: root/src/lib-smtp/smtp-reply-parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib-smtp/smtp-reply-parser.h')
-rw-r--r--src/lib-smtp/smtp-reply-parser.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib-smtp/smtp-reply-parser.h b/src/lib-smtp/smtp-reply-parser.h
new file mode 100644
index 0000000..4ffb32a
--- /dev/null
+++ b/src/lib-smtp/smtp-reply-parser.h
@@ -0,0 +1,25 @@
+#ifndef SMTP_REPLY_PARSER_H
+#define SMTP_REPLY_PARSER_H
+
+#include "smtp-reply.h"
+
+struct smtp_reply_parser;
+
+bool smtp_reply_parse_enhanced_code(const char *text,
+ struct smtp_reply_enhanced_code *enh_code_r,
+ const char **pos_r) ATTR_NULL(3);
+
+struct smtp_reply_parser *
+smtp_reply_parser_init(struct istream *input, size_t max_reply_size);
+void smtp_reply_parser_deinit(struct smtp_reply_parser **_parser);
+
+void smtp_reply_parser_set_stream(struct smtp_reply_parser *parser,
+ struct istream *input);
+
+int smtp_reply_parse_next(struct smtp_reply_parser *parser,
+ bool enhanced_codes, struct smtp_reply **reply_r,
+ const char **error_r);
+int smtp_reply_parse_ehlo(struct smtp_reply_parser *parser,
+ struct smtp_reply **reply_r, const char **error_r);
+
+#endif