27RCSIDH(lib_bio_fd_h, 
"$Id: 60e32201ce37cb8c49b3715489be8b517d85ac54 $")
 
   29#include <freeradius-devel/bio/base.h> 
   30#include <freeradius-devel/util/socket.h> 
   31#include <freeradius-devel/util/event.h> 
   33#include <freeradius-devel/server/cf_parse.h> 
   40#define AF_FILE_BIO (INT_MAX) 
  156#define fr_bio_fd_connect(_x) fr_bio_fd_connect_full(_x, NULL, NULL, NULL, NULL, NULL) 
void(* fr_bio_callback_t)(fr_bio_t *bio)
 
Defines a CONF_PAIR to C data type mapping.
 
const conf_parser_t fr_bio_fd_server_config[]
 
char const  * transport
name of the transport protocol
 
fr_socket_t socket
as connected socket
 
char const  * name
printable name of this BIO
 
uint16_t src_port
our port
 
@ FR_BIO_FD_CONNECTED
connected client sockets (UDP or TCP)
 
@ FR_BIO_FD_INVALID
not set
 
@ FR_BIO_FD_UNCONNECTED
unconnected UDP / datagram only
 
@ FR_BIO_FD_LISTEN
returns new fd in buffer on fr_bio_read() or fr_bio_fd_accept()
 
fr_bio_fd_type_t type
type of the socket
 
fr_bio_fd_state_t state
connecting, open, closed, etc.
 
uint16_t src_port_start
limit source port ranges for client BIOs
 
uint32_t recv_buff
How big the kernel's receive buffer should be.
 
bool mkdir
make intermediate directories
 
int fr_bio_fd_reopen(fr_bio_t *bio)
Reopen a file BIO.
 
@ FR_BIO_FD_STATE_INVALID
 
@ FR_BIO_FD_STATE_CONNECTING
 
@ FR_BIO_FD_STATE_OPEN
error states must be before this
 
int connect_errno
from connect() or other APIs
 
fr_ipaddr_t dst_ipaddr
their IP address
 
fr_bio_fd_type_t type
accept, connected, unconnected, etc.
 
const conf_parser_t fr_bio_fd_client_config[]
 
bool recv_buff_is_set
Whether we were provided with a recv_buf.
 
char const  * path
for Unix domain sockets
 
uint32_t send_buff
How big the kernel's send buffer should be.
 
char const  * filename
for files
 
uid_t uid
who owns the socket
 
fr_bio_fd_config_t const  * cfg
so we know what was asked, vs what was granted.
 
bool read_blocked
did we block on read?
 
bool server
is this a client or a server?
 
gid_t gid
who owns the socket
 
char const  * interface
for binding to an interface
 
mode_t perm
permissions for domain sockets
 
fr_bio_fd_info_t const * fr_bio_fd_info(fr_bio_t *bio)
Returns a pointer to the bio-specific information.
 
uint16_t src_port_end
limit source port ranges for client BIOs
 
int socket_type
SOCK_STREAM or SOCK_DGRAM.
 
uint32_t backlog
for listen()
 
uint16_t dst_port
their port
 
bool tcp_delay
We do tcp_nodelay by default.
 
int fr_bio_fd_write_only(fr_bio_t *bio)
Mark up a bio as write-only.
 
int fr_bio_fd_open(fr_bio_t *bio, fr_bio_fd_config_t const *cfg)
Opens a socket and updates sock->fd.
 
bool reuse_port
whether or not we re-use the same destination port for datagram sockets
 
bool backlog_is_set
Whether we were provided with a backlog.
 
int fr_bio_fd_connect_full(fr_bio_t *bio, fr_event_list_t *el, fr_bio_callback_t connected_cb, fr_bio_callback_t error_cb, fr_time_delta_t *timeout, fr_bio_callback_t timeout_cb))
Finalize a connect()
 
int fr_bio_fd_accept(TALLOC_CTX *ctx, fr_bio_t **out, fr_bio_t *bio)
Accept a new connection on a socket.
 
bool exceed_mtu
Whether we allow packets which exceed the local MTU.
 
int fr_bio_fd_check_config(fr_bio_fd_config_t const *cfg)
Checks the configuration without modifying anything.
 
fr_socket_t socket
socket information, including FD.
 
int fr_bio_fd_close(fr_bio_t *bio)
Close the FD, but leave the bio allocated and alive.
 
fr_time_t when
when the packet was received
 
bool send_buff_is_set
Whether we were provided with a send_buf.
 
fr_bio_t * fr_bio_fd_alloc(TALLOC_CTX *ctx, fr_bio_fd_config_t const *cfg, size_t offset))
Allocate a FD bio.
 
bool write_blocked
did we block on write?
 
fr_ipaddr_t src_ipaddr
our IP address
 
Configuration for sockets.
 
Run-time status of the socket.
 
Stores all information relating to an event list.
 
A time delta, a difference in time measured in nanoseconds.
 
static fr_event_list_t * el
 
Holds information necessary for binding or connecting to a socket.
 
static size_t char ** out