projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update tests.
[apps/pfixtools.git]
/
postlicyd
/
query.c
diff --git
a/postlicyd/query.c
b/postlicyd/query.c
index
2d4cd89
..
4a4ae9c
100644
(file)
--- a/
postlicyd/query.c
+++ b/
postlicyd/query.c
@@
-38,6
+38,17
@@
#include "policy_tokens.h"
#include "str.h"
#include "policy_tokens.h"
#include "str.h"
+const char *smtp_state_names[SMTP_count] = {
+ "CONNECT",
+ "HELO",
+ "MAIL",
+ "RCPT",
+ "DATA",
+ "END-OF-MESSAGE",
+ "VRFY",
+ "ETRN",
+};
+
bool query_parse(query_t *query, char *p)
{
#define PARSE_CHECK(expr, error, ...) \
bool query_parse(query_t *query, char *p)
{
#define PARSE_CHECK(expr, error, ...) \
@@
-179,6
+190,12
@@
const char *query_field_for_id(const query_t *query, postlicyd_token id)
CASE(ETRN_DOMAIN, etrn_domain)
CASE(STRESS, stress)
#undef CASE
CASE(ETRN_DOMAIN, etrn_domain)
CASE(STRESS, stress)
#undef CASE
+ case PTK_PROTOCOL_NAME:
+ return query->esmtp ? "ESMTP" : "SMTP";
+
+ case PTK_PROTOCOL_STATE:
+ return smtp_state_names[query->state];
+
default: return NULL;
}
}
default: return NULL;
}
}