1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#ifndef SMTP_SYNTAX_H
#define SMTP_SYNTAX_H
struct smtp_parser;
/*
* String
*/
int smtp_string_parse(const char *string, const char **value_r,
const char **error_r);
void smtp_string_write(string_t *out, const char *value);
/*
* Xtext encoding
*/
int smtp_xtext_decode(string_t *out, const char *xtext, bool allow_nul,
const char **error_r);
int smtp_xtext_parse(const char *xtext, const char **value_r,
const char **error_r);
void smtp_xtext_encode(string_t *out, const unsigned char *data, size_t size);
static inline void
smtp_xtext_encode_cstr(string_t *out, const char *data)
{
smtp_xtext_encode(out, (const unsigned char *)data, strlen(data));
}
/*
* HELO domain
*/
int smtp_helo_domain_parse(const char *helo, bool allow_literal,
const char **domain_r);
/*
* EHLO reply
*/
bool smtp_ehlo_keyword_is_valid(const char *keyword);
bool smtp_ehlo_param_is_valid(const char *param);
bool smtp_ehlo_params_are_valid(const char *const *params) ATTR_NULL(1);
bool smtp_ehlo_params_str_is_valid(const char *params);
int smtp_ehlo_line_parse(const char *ehlo_line, const char **key_r,
const char *const **params_r, const char **error_r);
#endif
|