ze-filter  (ze-filter-0.8.0-develop-180218)
ze-callback.h
Go to the documentation of this file.
1 /*
2  *
3  * ze-filter - Mail Server Filter for sendmail
4  *
5  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
6  *
7  * Auteur : Jose Marcio Martins da Cruz
8  * jose.marcio.mc@gmail.org
9  *
10  * Historique :
11  * Creation : Sat Dec 19 23:42:11 CET 2009
12  *
13  * This program is free software, but with restricted license :
14  *
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * More details about ze-filter license can be found at ze-filter
21  * web site : http://foss.jose-marcio.org
22  */
23 
24 
25 #ifndef __ZE_CALLBACK_H
26 
27 #define CALLBACK_FIRST 0
28 #define CALLBACK_CONNECT 0
29 #define CALLBACK_EHLO 1
30 #define CALLBACK_MAIL 2
31 #define CALLBACK_RCPT 3
32 #define CALLBACK_DATA 4
33 #define CALLBACK_HEADER 5
34 #define CALLBACK_EOH 6
35 #define CALLBACK_BODY 7
36 #define CALLBACK_EOM 8
37 #define CALLBACK_ABORT 9
38 #define CALLBACK_CLOSE 10
39 #define CALLBACK_UNKNOWN 11
40 #define CALLBACK_LAST 11
41 
42 #define CALLBACK_LABEL(i) \
43  ((i) == CALLBACK_CONNECT ? "CONNECT" : \
44  (i) == CALLBACK_EHLO ? "HELO" : \
45  (i) == CALLBACK_MAIL ? "MAIL" : \
46  (i) == CALLBACK_RCPT ? "RCPT" : \
47  (i) == CALLBACK_DATA ? "DATA" : \
48  (i) == CALLBACK_HEADER ? "HEADER" : \
49  (i) == CALLBACK_EOH ? "EOH" : \
50  (i) == CALLBACK_BODY ? "BODY" : \
51  (i) == CALLBACK_EOM ? "EOM" : \
52  (i) == CALLBACK_ABORT ? "ABORT" : \
53  (i) == CALLBACK_CLOSE ? "CLOSE" : "UNKNOWN")
54 
55 #define CALLBACK_VALUE(label) \
56  (STRCASEEQUAL((label), "CONNECT") ? CALLBACK_CONNECT : \
57  STRCASEEQUAL((label), "HELO") ? CALLBACK_EHLO : \
58  STRCASEEQUAL((label), "EHLO") ? CALLBACK_EHLO : \
59  STRCASEEQUAL((label), "MAIL") ? CALLBACK_MAIL : \
60  STRCASEEQUAL((label), "RCPT") ? CALLBACK_RCPT : \
61  STRCASEEQUAL((label), "DATA") ? CALLBACK_DATA : \
62  STRCASEEQUAL((label), "HEADER") ? CALLBACK_HEADER : \
63  STRCASEEQUAL((label), "EOH") ? CALLBACK_EOH : \
64  STRCASEEQUAL((label), "BODY") ? CALLBACK_BODY : \
65  STRCASEEQUAL((label), "EOM") ? CALLBACK_EOM : \
66  STRCASEEQUAL((label), "ABORT") ? CALLBACK_ABORT : \
67  STRCASEEQUAL((label), "CLOSE") ? CALLBACK_CLOSE : CALLBACK_UNKNOWN)
68 
69 
70 bool callback_stats_update(int callback, timems_T dt);
71 
72 bool callback_stats_dump(int fd, bool line);
73 
74 
75 # define __ZE_CALLBACK_H 1
76 #endif /* __ZE_CALLBACK_H */
bool callback_stats_update(int callback, timems_T dt)
Definition: ze-callback.c:68
bool callback_stats_dump(int fd, bool line)
Definition: ze-callback.c:91
uint64_t timems_T
Definition: zeTime.h:32