93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch * Character definitions
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschextern const uint16_t smtp_esmtp_value_char_mask;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschextern const uint16_t smtp_ehlo_param_char_mask;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschextern const uint16_t smtp_ehlo_greet_char_mask;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_xtext_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_atext_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_dcontent_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_qtext_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_textstr_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_esmtp_value_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_ehlo_param_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_ehlo_greet_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstatic inline bool
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch return (smtp_char_lookup[ch] & smtp_qpair_char_mask) != 0;
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch * SMTP parser
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschvoid smtp_parser_init(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschstring_t *smtp_parser_get_tmpbuf(struct smtp_parser *parser, size_t size);
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch * Common syntax
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschint smtp_parser_parse_domain(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch const char **value_r);
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschint smtp_parser_parse_address_literal(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschint smtp_parser_parse_atom(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch const char **value_r);
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschint smtp_parser_parse_quoted_string(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch const char **value_r);
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Boschint smtp_parser_parse_string(struct smtp_parser *parser,
93bedc85596ff3d4afcf010843e93030a772d5a8Stephan Bosch const char **value_r);