return 0;
}
-typedef int (*parser_callback_t)(struct Buffer *, struct Buffer *, int *, int *,
- int *, struct Buffer *);
+typedef int (*parser_callback_t)(struct Buffer *buf, struct Buffer *s, int *fg,
+ int *bg, int *attr, struct Buffer *err);
#ifdef HAVE_COLOR
/**
* struct TlsSockData - TLS socket data
*/
-typedef struct TlsSockData
+struct TlsSockData
{
gnutls_session_t state;
gnutls_certificate_credentials_t xcred;
-} tlssockdata;
+};
static int tls_init(void)
{
static int tls_socket_read(struct Connection *conn, char *buf, size_t len)
{
- tlssockdata *data = conn->sockdata;
+ struct TlsSockData *data = conn->sockdata;
int ret;
if (!data)
static int tls_socket_write(struct Connection *conn, const char *buf, size_t len)
{
- tlssockdata *data = conn->sockdata;
+ struct TlsSockData *data = conn->sockdata;
int ret;
size_t sent = 0;
static int tls_socket_close(struct Connection *conn)
{
- tlssockdata *data = conn->sockdata;
+ struct TlsSockData *data = conn->sockdata;
if (data)
{
/* shut down only the write half to avoid hanging waiting for the remote to respond.
static int tls_check_certificate(struct Connection *conn)
{
- tlssockdata *data = conn->sockdata;
+ struct TlsSockData *data = conn->sockdata;
gnutls_session_t state = data->state;
const gnutls_datum_t *cert_list = NULL;
unsigned int cert_list_size = 0;
static void tls_get_client_cert(struct Connection *conn)
{
- tlssockdata *data = conn->sockdata;
+ struct TlsSockData *data = conn->sockdata;
const gnutls_datum_t *crtdata = NULL;
gnutls_x509_crt_t clientcrt;
char *dn = NULL;
}
#ifdef HAVE_GNUTLS_PRIORITY_SET_DIRECT
-static int tls_set_priority(tlssockdata *data)
+static int tls_set_priority(struct TlsSockData *data)
{
size_t nproto = 4;
char *priority = NULL;
static int protocol_priority[] = { GNUTLS_TLS1_2, GNUTLS_TLS1_1, GNUTLS_TLS1,
GNUTLS_SSL3, 0 };
-static int tls_set_priority(tlssockdata *data)
+static int tls_set_priority(struct TlsSockData *data)
{
size_t nproto = 0; /* number of tls/ssl protocols */
*/
static int tls_negotiate(struct Connection *conn)
{
- tlssockdata *data = NULL;
+ struct TlsSockData *data = NULL;
int err;
- data = safe_calloc(1, sizeof(tlssockdata));
+ data = safe_calloc(1, sizeof(struct TlsSockData));
conn->sockdata = data;
err = gnutls_certificate_allocate_credentials(&data->xcred);
if (err < 0)
extern char RFC822Specials[];
-typedef size_t (*encoder_t)(char *, ICONV_CONST char *, size_t, const char *);
+typedef size_t (*encoder_t)(char *s, ICONV_CONST char *d, size_t dlen, const char *tocode);
static size_t convert_string(ICONV_CONST char *f, size_t flen, const char *from,
const char *to, char **t, size_t *tlen)