football
socket abstraction layer
Loading...
Searching...
No Matches
Macros | Functions | Variables
fb_transport.c File Reference

Football transport layer implementation. More...

#include <config.h>
#include <errno.h>
#include <assert.h>
#include "fb_public.h"
#include "fb_transport.h"
#include "fb_service.h"
#include <sys/socket.h>

Macros

#define MSG_NOSIGNAL   (0)
 
#define TLS_PUBLIC_KEY_FILE   "x509-server-key.pem"
 
#define TLS_CERTIFICATE_FILE   "x509-server.pem"
 

Functions

bool fb_unencrypted_init (struct fb_connection_t *connection)
 
ssize_t fb_unencrypted_handshake (struct fb_connection_t *connection)
 Perform TLS handshaking on a new connection. Return incomplete, failure, or 0.
 
ssize_t fb_unencrypted_buffering (struct fb_connection_t *connection)
 Query number of bytes in TLS buffers.
 
ssize_t fb_unencrypted_read (struct fb_connection_t *connection, char *data, ssize_t byte_count)
 
ssize_t fb_unencrypted_write (struct fb_connection_t *connection, const char *data, ssize_t byte_count)
 
void fb_unencrypted_done (FB_CONNECTION *connection)
 
bool fb_file_init (struct fb_connection_t *connection)
 
ssize_t fb_file_read (struct fb_connection_t *connection, char *data, ssize_t byte_count)
 
ssize_t fb_file_write (struct fb_connection_t *connection, const char *data, ssize_t byte_count)
 
void fb_file_done (FB_CONNECTION *connection)
 
bool fb_init_tls_support (const char *path)
 
void fb_cleanup_tls_support (void)
 

Variables

const ssize_t FB_TRANSPORT_CLOSED = 0
 Connection closed normally. Returned by read transport function only.
 
const ssize_t FB_TRANSPORT_INCOMPLETE = -1
 An action was incomplete, but can be retried in the future.
 
const ssize_t FB_TRANSPORT_FAILURE = -2
 An action failed permanently; the connection has failed and should be closed.
 
const FB_TRANSPORT_FUNCS fb_transport_unencrypted
 Transport virtual method table for unenrypted connections.
 
const FB_TRANSPORT_FUNCS fb_transport_read_file
 Transport virtual method table for reading from files.
 

Detailed Description

Football transport layer implementation.

Generic functions and support for unsecured connections and files.

Variable Documentation

◆ fb_transport_read_file

const FB_TRANSPORT_FUNCS fb_transport_read_file
Initial value:
= {
.init = fb_file_init,
.read = fb_file_read,
.write = fb_file_write,
.done = fb_file_done
}
ssize_t fb_unencrypted_handshake(struct fb_connection_t *connection)
Perform TLS handshaking on a new connection. Return incomplete, failure, or 0.
Definition fb_transport.c:52
ssize_t fb_unencrypted_buffering(struct fb_connection_t *connection)
Query number of bytes in TLS buffers.
Definition fb_transport.c:60

Transport virtual method table for reading from files.

◆ fb_transport_unencrypted

const FB_TRANSPORT_FUNCS fb_transport_unencrypted
Initial value:
= {
.init = fb_unencrypted_init,
.read = fb_unencrypted_read,
.write = fb_unencrypted_write,
.done = fb_unencrypted_done
}

Transport virtual method table for unenrypted connections.