27 #include <freeradius-devel/util/socket.h>
81 char const *interface);
fr_io_network_get_t network_get
get dynamic network information
fr_io_close_t close
Close the transport.
fr_io_open_t open
Open a new socket for listening, or accept/connect a new connection.
fr_io_data_read_t read
Read from a socket to a data buffer.
module_t common
Common fields to all loadable modules.
fr_io_connection_set_t connection_set
set src/dst IP/port of a connection
fr_io_signal_t error
There was an error on the socket.
fr_app_event_list_set_t event_list_set
Called by the network thread to pass an event list for use by the app_io_t.
fr_io_data_inject_t inject
Inject a packet into a socket.
fr_io_client_find_t client_find
find radclient
fr_io_encode_t encode
Pack fr_pair_ts back into a byte array.
size_t default_reply_size
same for replies
size_t default_message_size
Usually maximum message size.
fr_io_data_vnode_t vnode
Handle notifications that the VNODE has changed.
fr_io_data_write_t write
Write from a data buffer to a socket.
fr_io_set_fd_t fd_set
Set the file descriptor to the instance.
char const * fr_app_io_socket_name(TALLOC_CTX *ctx, fr_app_io_t const *app_io, fr_ipaddr_t const *src_ipaddr, int src_port, fr_ipaddr_t const *dst_ipaddr, int dst_port, char const *interface)
fr_io_track_create_t track_create
create a tracking structure
bool track_duplicates
track duplicate packets
fr_io_name_t get_name
get the socket name
fr_io_nak_t nak
Function to send a NAK.
fr_io_decode_t decode
Translate raw bytes into fr_pair_ts and metadata.
fr_io_track_cmp_t track_compare
compare two tracking structures
fr_io_signal_t flush
Flush the data when the socket is ready for writing.
Public structure describing an I/O path for a protocol.
void(* fr_app_event_list_set_t)(fr_listen_t *li, fr_event_list_t *el, void *nr)
Called by the network thread to pass an event list for the module to use for timer events.
int(* fr_io_open_t)(fr_listen_t *li)
Open an I/O path.
ssize_t(* fr_io_data_read_t)(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time, uint8_t *buffer, size_t buffer_len, size_t *leftover)
Read from a socket.
int(* fr_io_track_cmp_t)(void const *instance, void *thread_instance, fr_client_t *client, void const *one, void const *two)
Compare two tracking structures for storing in a duplicate detection tree.
void(* fr_io_data_vnode_t)(fr_listen_t *li, uint32_t fflags)
Tell the IO handler that a VNODE has changed.
int(* fr_io_decode_t)(void const *instance, request_t *request, uint8_t *const data, size_t data_len)
Decode a raw packet and convert it into a request.
char const *(* fr_io_name_t)(fr_listen_t *li)
ssize_t(* fr_io_data_write_t)(fr_listen_t *li, void *packet_ctx, fr_time_t request_time, uint8_t *buffer, size_t buffer_len, size_t written)
Write a socket.
int(* fr_io_set_fd_t)(fr_listen_t *li, int fd)
Set a selectable file descriptor for this I/O path.
int(* fr_io_connection_set_t)(fr_listen_t *li, fr_io_address_t *connection)
size_t(* fr_io_nak_t)(fr_listen_t *li, void *packet_ctx, uint8_t *const packet, size_t packet_len, uint8_t *reply, size_t reply_len)
NAK a packet.
ssize_t(* fr_io_encode_t)(void const *instance, request_t *request, uint8_t *buffer, size_t buffer_len)
Encode data from a request_t into a raw packet.
int(* fr_io_data_inject_t)(fr_listen_t *li, uint8_t const *buffer, size_t buffer_len, fr_time_t recv_time)
Inject data into a socket.
fr_client_t *(* fr_io_client_find_t)(fr_listen_t *li, fr_ipaddr_t const *ipaddr, int ipproto)
void(* fr_io_network_get_t)(int *ipproto, bool *dynamic_clients, fr_trie_t const **trie, void *instance)
Callback to return network properties.
int(* fr_io_close_t)(fr_listen_t *li)
Handle a close on the socket.
int(* fr_io_signal_t)(fr_listen_t *li)
Handle an error on the socket.
void *(* fr_io_track_create_t)(void const *instance, void *thread_instance, fr_client_t *client, fr_io_track_t *track, uint8_t const *packet, size_t packet_len)
Convert a raw packet to a tracking structure.
static fr_app_io_t app_io
Struct exported by a rlm_* module.