27 RCSIDH(lib_bio_fd_h,
"$Id: 7c695251c409536b2789d34acdc02b71e13d741d $")
29 #include <freeradius-devel/bio/base.h>
30 #include <freeradius-devel/util/socket.h>
37 #define AF_FILE_BIO (INT_MAX)
fr_bio_t * fr_bio_fd_alloc(TALLOC_CTX *ctx, fr_bio_cb_funcs_t *cb, fr_bio_fd_config_t const *cfg, size_t offset))
Allocate a FD bio.
fr_socket_t socket
as connected socket
uint16_t src_port
our port
fr_bio_fd_info_t const * fr_bio_fd_info(fr_bio_t *bio)
Returns a pointer to the bio-specific information.
@ FR_BIO_FD_CONNECTED
connected client sockets (UDP or TCP)
@ FR_BIO_FD_UNCONNECTED
unconnected UDP / datagram only
@ FR_BIO_FD_ACCEPT
returns new fd in buffer on fr_bio_read()
fr_bio_fd_type_t type
type of the socket
fr_bio_fd_state_t state
connecting, open, closed, etc.
uint32_t recv_buff
How big the kernel's receive buffer should be.
@ FR_BIO_FD_STATE_INVALID
@ FR_BIO_FD_STATE_CONNECTING
@ FR_BIO_FD_STATE_OPEN
error states must be before this
fr_ipaddr_t dst_ipaddr
their IP address
fr_bio_fd_type_t type
accept, connected, unconnected, etc.
int fr_bio_fd_connect(fr_bio_t *bio)
Finalize a connect()
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?
gid_t gid
who owns the socket
char const * interface
for binding to an interface
mode_t perm
permissions for domain sockets
int socket_type
SOCK_STREAM or SOCK_DGRAM.
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.
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 write_blocked
did we block on write?
fr_ipaddr_t src_ipaddr
our IP address
Configuration for sockets.
Run-time status of the socket.
Holds information necessary for binding or connecting to a socket.