a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch#ifndef SMTP_REPLY_PARSER_H
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch#define SMTP_REPLY_PARSER_H
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch#include "smtp-reply.h"
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschstruct smtp_reply_parser;
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschstruct smtp_reply_parser *
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschsmtp_reply_parser_init(struct istream *input, size_t max_reply_size);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschvoid smtp_reply_parser_deinit(struct smtp_reply_parser **_parser);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschvoid smtp_reply_parser_set_stream(struct smtp_reply_parser *parser,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch struct istream *input);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschint smtp_reply_parse_next(struct smtp_reply_parser *parser,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch bool enhanced_codes, struct smtp_reply **reply_r,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch const char **error_r);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Boschint smtp_reply_parse_ehlo(struct smtp_reply_parser *parser,
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch struct smtp_reply **reply_r, const char **error_r);
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch
a8433392e8a5ddfe8a125716f62b2a4dc8f1f01eStephan Bosch#endif