projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring.
[apps/pfixtools.git]
/
postfix.h
diff --git
a/postfix.h
b/postfix.h
index
d24dcbb
..
88e4f8d
100644
(file)
--- a/
postfix.h
+++ b/
postfix.h
@@
-1,5
+1,5
@@
/******************************************************************************/
/******************************************************************************/
-/* p
ostlicyd: a postfix policy daemon with a lot of features
*/
+/* p
fixtools: a collection of postfix related tools
*/
/* ~~~~~~~~~ */
/* ________________________________________________________________________ */
/* */
/* ~~~~~~~~~ */
/* ________________________________________________________________________ */
/* */
@@
-33,11
+33,26
@@
* Copyright © 2006-2007 Pierre Habouzit
*/
* Copyright © 2006-2007 Pierre Habouzit
*/
-#ifndef POSTLICYD_POSTFIX_H
-#define POSTLICYD_POSTFIX_H
+#ifndef PFIXTOOLS_POSTFIX_H
+#define PFIXTOOLS_POSTFIX_H
+
+#include <stddef.h>
#include "buffer.h"
#include "buffer.h"
+enum smtp_state {
+ SMTP_UNKNOWN,
+ SMTP_CONNECT,
+ SMTP_EHLO,
+ SMTP_HELO = SMTP_EHLO,
+ SMTP_MAIL,
+ SMTP_RCPT,
+ SMTP_DATA,
+ SMTP_END_OF_MESSAGE,
+ SMTP_VRFY,
+ SMTP_ETRN,
+};
+
/* \see http://www.postfix.org/SMTPD_POLICY_README.html */
typedef struct query_t {
unsigned state : 4;
/* \see http://www.postfix.org/SMTPD_POLICY_README.html */
typedef struct query_t {
unsigned state : 4;
@@
-72,10
+87,15
@@
typedef struct query_t {
} query_t;
static inline query_t *query_init(query_t *rq) {
} query_t;
static inline query_t *query_init(query_t *rq) {
-
p_clear(rq, 1
);
+
memset(rq, 0, offsetof(query_t, data)
);
buffer_init(&rq->data);
return rq;
}
buffer_init(&rq->data);
return rq;
}
+static inline query_t *query_reset(query_t *rq) {
+ memset(rq, 0, offsetof(query_t, data));
+ buffer_reset(&rq->data);
+ return rq;
+}
static inline void query_wipe(query_t *rq) {
buffer_wipe(&rq->data);
}
static inline void query_wipe(query_t *rq) {
buffer_wipe(&rq->data);
}