|
football
socket abstraction layer
|
Football service and connection creation/destruction. More...
#include <config.h>#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <assert.h>#include "fb_transport.h"#include "fb_service.h"Macros | |
| #define | _BSD_SOURCE /* strdup, realpath */ |
| #define | _DEFAULT_SOURCE |
Functions | |
| bool | fb_services_are_open (void) |
| Indicate whether there are any services open. | |
| FB_SERVICE * | fb_create_service (const FB_SERVICE_OPTIONS *options) |
| Create a new service and initialize its listeners. | |
| void | fb_destroy_service (FB_SERVICE *service) |
| void | fb_close_service (FB_SERVICE *service) |
| Initiate closure of a service. | |
| bool | fb_validate_connection (FB_SERVICE *service, FB_CONNECTION *connection) |
| Validate connection with hosts_access. | |
| FB_CONNECTION * | fb_accept_connection (FB_SERVICE *service, FB_SOCKETID id) |
| bool | fb_transfer (FB_CONNECTION *connection, FB_SERVICE *service) |
| Transfer a connection to a new service. | |
| bool | fb_transfer_by_name (FB_CONNECTION *connection, const char *name) |
| void | fb_destroy_connection (FB_CONNECTION *connection) |
| void | fb_close_connection (FB_CONNECTION *connection) |
| Initiate connection closure. | |
| FB_EVENT * | fb_accept_file (FB_SERVICE *service, char *filename) |
| Make a connection that reads from a file. | |
| FB_EVENT * | fb_loopback_socket (FB_SERVICE *service) |
| Make a connection with a pipe. | |
| FB_ITERATOR * | fb_new_iterator (FB_SERVICE *service) |
| Create a new iterator. | |
| FB_EVENT * | fb_iterate_next (FB_ITERATOR *it) |
| Get the next iteration. | |
| void | fb_destroy_iterator (FB_ITERATOR *it) |
| Destroy an iterator and release its resources. | |
Football service and connection creation/destruction.
| FB_EVENT * fb_accept_file | ( | FB_SERVICE * | service, |
| char * | filename | ||
| ) |
Make a connection that reads from a file.
| service | the service to register the connection with |
| filename | the file to read from |
| void fb_close_connection | ( | FB_CONNECTION * | connection | ) |
Initiate connection closure.
If the socket is in an open state, change its state and enable writes. The next write attempt will generate a close event. If the connection is already on its way out, leave it alone.
| connection | the connection to close |
| void fb_close_service | ( | FB_SERVICE * | service | ) |
Initiate closure of a service.
| FB_SERVICE * fb_create_service | ( | const FB_SERVICE_OPTIONS * | options | ) |
Create a new service and initialize its listeners.
Subsequent changes made to the options do not effect behavior.
| options | Options for the new service's behavior. |
| void fb_destroy_iterator | ( | FB_ITERATOR * | it | ) |
Destroy an iterator and release its resources.
| it | The iterator |
| FB_EVENT * fb_iterate_next | ( | FB_ITERATOR * | it | ) |
Get the next iteration.
| it | The iterator |
| FB_EVENT * fb_loopback_socket | ( | FB_SERVICE * | service | ) |
Make a connection with a pipe.
| service | the service to register the connection with |
| FB_ITERATOR * fb_new_iterator | ( | FB_SERVICE * | service | ) |
Create a new iterator.
Create and initialize a new iterator for a service.
| bool fb_services_are_open | ( | void | ) |
Indicate whether there are any services open.
| bool fb_transfer | ( | FB_CONNECTION * | connection, |
| FB_SERVICE * | service | ||
| ) |
Transfer a connection to a new service.
| connection | The connection to transfer. |
| service | The service to reassign it to. |
| bool fb_validate_connection | ( | FB_SERVICE * | service, |
| FB_CONNECTION * | connection | ||
| ) |
Validate connection with hosts_access.
| service | The service on which the connection is arriving. |
| connection | The connection. |