pianod2
multisource multiuser scriptable networked music player
Functions | Variables
fb_transport_gnutls.c File Reference

Football transport implementations for GNU TLS. More...

#include <config.h>
#include <assert.h>
#include <errno.h>
#include "fb_public.h"
#include "fb_transport.h"
#include "fb_service.h"
#include <sys/socket.h>
#include <gnutls/gnutls.h>
Include dependency graph for fb_transport_gnutls.c:

Functions

bool fb_gnutls_configure (const FB_TLS_CONFIG_FILENAMES *paths)
 
bool fb_gnutls_init (FB_CONNECTION *connection)
 
ssize_t fb_gnutls_handshake (struct fb_connection_t *connection)
 Perform TLS handshaking on a new connection. Return incomplete, failure, or 0. More...
 
ssize_t fb_gnutls_buffering (struct fb_connection_t *connection)
 Query number of bytes in TLS buffers. More...
 
ssize_t fb_gnutls_read (struct fb_connection_t *connection, char *data, ssize_t byte_count)
 
ssize_t fb_gnutls_write (struct fb_connection_t *connection, const char *data, ssize_t byte_count)
 
void fb_gnutls_done (FB_CONNECTION *connection)
 
void fb_gnutls_cleanup ()
 

Variables

static bool fb_tls_initialized
 
static gnutls_certificate_credentials_t fb_tls_credentials
 
static gnutls_dh_params_t fb_tls_dh_params
 
static gnutls_priority_t fb_tls_priorities
 
const FB_TRANSPORT_FUNCS fb_transport_encrypted
 

Detailed Description

Football transport implementations for GNU TLS.

Function Documentation

◆ fb_gnutls_buffering()

ssize_t fb_gnutls_buffering ( struct fb_connection_t connection)

Query number of bytes in TLS buffers.

◆ fb_gnutls_cleanup()

void fb_gnutls_cleanup ( )

◆ fb_gnutls_configure()

bool fb_gnutls_configure ( const FB_TLS_CONFIG_FILENAMES paths)

Initialize state, load certificates and keys.

◆ fb_gnutls_done()

void fb_gnutls_done ( FB_CONNECTION connection)

◆ fb_gnutls_handshake()

ssize_t fb_gnutls_handshake ( struct fb_connection_t connection)

Perform TLS handshaking on a new connection. Return incomplete, failure, or 0.

◆ fb_gnutls_init()

bool fb_gnutls_init ( FB_CONNECTION connection)

Initialize the TLS stuff for a new connection.

Parameters
connectionThe connection to initialize.
Returns
true on success, false on error.

◆ fb_gnutls_read()

ssize_t fb_gnutls_read ( struct fb_connection_t connection,
char *  data,
ssize_t  byte_count 
)

Read data from a TLS connection using GNU TLS.

◆ fb_gnutls_write()

ssize_t fb_gnutls_write ( struct fb_connection_t connection,
const char *  data,
ssize_t  byte_count 
)

Write data to a TLS connection using GNU TLS.

Variable Documentation

◆ fb_tls_credentials

gnutls_certificate_credentials_t fb_tls_credentials
static

◆ fb_tls_dh_params

gnutls_dh_params_t fb_tls_dh_params
static

◆ fb_tls_initialized

bool fb_tls_initialized
static

◆ fb_tls_priorities

gnutls_priority_t fb_tls_priorities
static

◆ fb_transport_encrypted

const FB_TRANSPORT_FUNCS fb_transport_encrypted
Initial value:
= {
.configure = fb_gnutls_configure,
.cleanup = fb_gnutls_cleanup,
.init = fb_gnutls_init,
.handshake = fb_gnutls_handshake,
.buffering = fb_gnutls_buffering,
.read = fb_gnutls_read,
.write = fb_gnutls_write,
}
bool fb_gnutls_configure(const FB_TLS_CONFIG_FILENAMES *paths)
Definition: fb_transport_gnutls.c:31
ssize_t fb_gnutls_read(struct fb_connection_t *connection, char *data, ssize_t byte_count)
Definition: fb_transport_gnutls.c:135
void fb_gnutls_cleanup()
Definition: fb_transport_gnutls.c:170
ssize_t fb_gnutls_buffering(struct fb_connection_t *connection)
Query number of bytes in TLS buffers.
Definition: fb_transport_gnutls.c:129
ssize_t fb_gnutls_handshake(struct fb_connection_t *connection)
Perform TLS handshaking on a new connection. Return incomplete, failure, or 0.
Definition: fb_transport_gnutls.c:113
bool fb_gnutls_init(FB_CONNECTION *connection)
Definition: fb_transport_gnutls.c:85
void fb_gnutls_done(FB_CONNECTION *connection)
Definition: fb_transport_gnutls.c:165
ssize_t fb_gnutls_write(struct fb_connection_t *connection, const char *data, ssize_t byte_count)
Definition: fb_transport_gnutls.c:151