| 1 | #ifndef UTILS_H |
| 2 | #define UTILS_H |
| 3 | |
| 4 | extern int libspamc_timeout; /* default timeout in seconds */ |
| 5 | |
| 6 | #ifdef SPAMC_SSL |
| 7 | #include <openssl/crypto.h> |
| 8 | #include <openssl/pem.h> |
| 9 | #include <openssl/ssl.h> |
| 10 | #include <openssl/err.h> |
| 11 | #else |
| 12 | typedef int SSL; /* fake type to avoid conditional compilation */ |
| 13 | typedef int SSL_CTX; |
| 14 | typedef int SSL_METHOD; |
| 15 | #endif |
| 16 | |
| 17 | ssize_t fd_timeout_read (int fd, void *, size_t ); |
| 18 | int ssl_timeout_read (SSL *ssl, void *, int ); |
| 19 | |
| 20 | /* these are fd-only, no SSL support */ |
| 21 | int full_read(int fd, unsigned char *buf, int min, int len); |
| 22 | int full_write(int fd, const unsigned char *buf, int len); |
| 23 | |
| 24 | #endif |