1 | /* $Id: client.h,v 1.17 2011/06/28 00:13:48 sbajic Exp $ */ |
---|
2 | |
---|
3 | /* |
---|
4 | DSPAM |
---|
5 | COPYRIGHT (C) 2002-2012 DSPAM PROJECT |
---|
6 | |
---|
7 | This program is free software: you can redistribute it and/or modify |
---|
8 | it under the terms of the GNU Affero General Public License as |
---|
9 | published by the Free Software Foundation, either version 3 of the |
---|
10 | License, or (at your option) any later version. |
---|
11 | |
---|
12 | This program is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | GNU Affero General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU Affero General Public License |
---|
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef _CLIENT_H |
---|
23 | # define _CLIENT_H |
---|
24 | |
---|
25 | #ifdef HAVE_CONFIG_H |
---|
26 | #include <auto-config.h> |
---|
27 | #endif |
---|
28 | |
---|
29 | #ifdef DAEMON |
---|
30 | |
---|
31 | #include <sys/types.h> |
---|
32 | #ifndef _WIN32 |
---|
33 | #include <pwd.h> |
---|
34 | #endif |
---|
35 | |
---|
36 | #include "dspam.h" |
---|
37 | #include "buffer.h" |
---|
38 | |
---|
39 | int client_process (AGENT_CTX *ATX, buffer *msg); |
---|
40 | int client_connect (AGENT_CTX *ATX, int flags); |
---|
41 | int client_authenticate (THREAD_CTX *TTX, const char *mode); |
---|
42 | int client_parsecode (char *err); |
---|
43 | int client_getcode (THREAD_CTX *TTX, char *err, size_t len); |
---|
44 | char * client_expect (THREAD_CTX *TTX, int code, char *err, size_t len); |
---|
45 | char * client_getline (THREAD_CTX *TTX, int timeout); |
---|
46 | int deliver_socket (AGENT_CTX *ATX, const char *msg, int proto); |
---|
47 | |
---|
48 | char *pop_buffer (THREAD_CTX *TTX); |
---|
49 | int send_socket (THREAD_CTX *TTX, const char *ptr); |
---|
50 | |
---|
51 | #define CCF_PROCESS 0x00 /* use ClientHost */ |
---|
52 | #define CCF_DELIVERY 0x01 /* use DeliveryHost */ |
---|
53 | |
---|
54 | #define DDP_LMTP 0x00 |
---|
55 | #define DDP_SMTP 0x01 |
---|
56 | |
---|
57 | #endif /* _CLIENT_H */ |
---|
58 | |
---|
59 | #endif /* DAEMON */ |
---|