Qsmtp
0.30dev
|
SSL encoding and decoding functions for network I/O. More...
#include <ssl_timeoutio.h>
#include <tls.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <openssl/err.h>
Macros | |
#define | ndelay_on(fd) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) |
#define | ndelay_off(fd) (void) fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK) |
Functions | |
static int | ssl_timeoutio (int(*func)(), time_t t, char *buf, const int len) |
int | ssl_timeoutaccept (time_t t) |
accept the request for SSL More... | |
int | ssl_timeoutconn (time_t t) |
establish SSL protocol to remote host More... | |
int | ssl_timeoutrehandshake (time_t t) |
do a new SSL handshake More... | |
int | ssl_timeoutread (time_t t, char *buf, const int len) |
int | ssl_timeoutwrite (time_t t, const char *buf, const int len) |
SSL encoding and decoding functions for network I/O.
int ssl_timeoutaccept | ( | time_t | t | ) |
accept the request for SSL
t | timeout in seconds |
0 | the call was successful |
<0 | error code |
int ssl_timeoutconn | ( | time_t | t | ) |
establish SSL protocol to remote host
t | timeout in seconds |
0 | the call was successful |
<0 | error code |
|
static |
call SSL function for given data buffer
func | OpenSSL function to call |
t | timeout |
buf | data buffer |
len | length of buf |
>0 | the call was successful |
<0 | error code |
-EPROTO | there was a SSL-level protocol error |
This function never returns 0.
int ssl_timeoutrehandshake | ( | time_t | t | ) |
do a new SSL handshake
t | timeout in seconds |
>0 | handshake was successful |
<0 | error code |
|
inline |
write data SSL encrypted to network
t | timeout |
buf | data to send |
len | length of buf |