comparison src/spamass.h @ 214:82886d4dd71f stable-6-0-19

Fixes to compile on Fedora 9 and for const correctness.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 10 Jun 2008 08:58:42 -0700
parents a4d313c2460b
children 78eedbbce636
comparison
equal deleted inserted replaced
213:44ffef730bc4 214:82886d4dd71f
10 10
11 #ifndef _SPAMASS_H 11 #ifndef _SPAMASS_H
12 #define _SPAMASS_H 12 #define _SPAMASS_H
13 13
14 extern "C" { 14 extern "C" {
15 #include <libmilter/mfapi.h> 15 #include <libmilter/mfapi.h>
16 } 16 }
17 17
18 #ifdef HAVE_CDEFS_H 18 #ifdef HAVE_CDEFS_H
19 #include <sys/cdefs.h> 19 #include <sys/cdefs.h>
20 #endif 20 #endif
21 21
22 #include <list> 22 #include <list>
23 23
24 extern char *spamc; 24 extern const char *spamc;
25 extern char *spamc_empty; 25 extern const char *spamc_empty;
26 using namespace std; 26 using namespace std;
27 27
28 class mlfiPriv; 28 class mlfiPriv;
29 29
30 class SpamAssassin { 30 class SpamAssassin {
31 public: 31 public:
32 SpamAssassin(mlfiPriv *priv_, int ip, char *helo_, char *from, char *qid); 32 SpamAssassin(mlfiPriv *priv_, int ip, const char *helo_, const char *from, const char *qid);
33 ~SpamAssassin(); 33 ~SpamAssassin();
34 34
35 void mlfi_envrcpt(SMFICTX *ctx, char *envrcpt); 35 void mlfi_envrcpt(SMFICTX *ctx, const char *envrcpt);
36 void mlfi_header(char* headerf, char* headerv); 36 void mlfi_header(const char* headerf, const char* headerv);
37 void mlfi_eoh(); 37 void mlfi_eoh();
38 void mlfi_body(u_char *bodyp, size_t bodylen); 38 void mlfi_body(const u_char *bodyp, size_t bodylen);
39 int mlfi_eom(); 39 int mlfi_eom();
40 40
41 private: 41 private:
42 void Connect(); 42 void Connect();
43 void output(const char*buffer, size_t size); 43 void output(const char *buffer, size_t size);
44 void output(const char*buffer); 44 void output(const char *buffer);
45 void output(string buffer); 45 void output(string buffer);
46 void close_output(); 46 void close_output();
47 void input(); 47 void input();
48 int read_pipe(); 48 int read_pipe();
49 void empty_and_close_pipe(); 49 void empty_and_close_pipe();
50 void closeall(int fd); 50 void closeall(int fd);
51 char *getorwarnmacro(SMFICTX *ctx, char *macro, char *def, char *scope); 51 const char *getorwarnmacro(SMFICTX *ctx, const char *macro, const char *def, const char *scope);
52 void warnmacro(char *macro, char *scope); 52 void warnmacro(const char *macro, const char *scope);
53 53
54 public: 54 public:
55 bool error; // spamc died or cannot work 55 bool error; // spamc died or cannot work
56 bool running; // running implies (connected and pid) 56 bool running; // running implies (connected and pid)
57 bool first_recipient; // have we not seen any recipients? 57 bool first_recipient; // have we not seen any recipients?
58 58
59 // connection back to main dnsbl priv structure for logging 59 // connection back to main dnsbl priv structure for logging
60 mlfiPriv *priv; 60 mlfiPriv *priv;
61 int ip4; // ip4 address of smtp client 61 int ip4; // ip4 address of smtp client
62 62
63 // strings owned by main dnsbl 63 // strings owned by main dnsbl
64 char *helo; // client helo value 64 const char *helo; // client helo value
65 char *envfrom; // envelope from value for this message 65 const char *envfrom; // envelope from value for this message
66 char *queueid; // the sendmail queue id for this message 66 const char *queueid; // the sendmail queue id for this message
67 67
68 // Process handling variables 68 // Process handling variables
69 pid_t pid; 69 pid_t pid;
70 int pipe_io[2][2]; 70 int pipe_io[2][2];
71 string spamc_output; 71 string spamc_output;
72 string spamc_input; 72 string spamc_input;
73 }; 73 };
74 74
75 #endif 75 #endif