static fr_bio_fd_config_t fd_config;
-static fr_bio_fd_info_t const *fd_info = NULL;
-
-static fr_bio_t *bio = NULL;
-
static fr_radius_client_config_t client_config;
static fr_bio_packet_t *client_bio = NULL;
*/
static int radclient_sane(rc_request_t *request)
{
- request->packet->socket.inet.src_ipaddr = fd_info->socket.inet.src_ipaddr;
- request->packet->socket.inet.src_port = fd_info->socket.inet.src_port;
- request->packet->socket.inet.ifindex = fd_info->socket.inet.ifindex;
+ request->packet->socket.inet.src_ipaddr = client_info->fd_info->socket.inet.src_ipaddr;
+ request->packet->socket.inet.src_port = client_info->fd_info->socket.inet.src_port;
+ request->packet->socket.inet.ifindex = client_info->fd_info->socket.inet.ifindex;
if (request->packet->socket.inet.dst_port == 0) {
request->packet->socket.inet.dst_port = fd_config.dst_port;
client_info = fr_radius_client_bio_info(client_bio);
fr_assert(client_info != NULL);
- bio = fr_radius_client_bio_get_fd(client_bio);
- fr_assert(bio != NULL);
-
- fd_info = fr_bio_fd_info(bio);
- fr_assert(fd_info != NULL);
-
if (forced_id >= 0) {
if (fr_radius_client_bio_force_id(client_bio, packet_code, forced_id) < 0) {
fr_perror("radclient");
*
* Once the connect() passes, we start reading from the request list, and processing packets.
*/
- if (fr_event_fd_insert(autofree, NULL, client_config.retry_cfg.el, fd_info->socket.fd, NULL,
+ if (fr_event_fd_insert(autofree, NULL, client_config.retry_cfg.el, client_info->fd_info->socket.fd, NULL,
client_connect, client_error, client_bio) < 0) {
fr_perror("radclient");
fr_exit_now(1);
***********************************************************************/
fr_dlist_talloc_free(&rc_request_list);
- (void) fr_event_fd_delete(client_config.retry_cfg.el, fd_info->socket.fd, FR_EVENT_FILTER_IO);
+ (void) fr_event_fd_delete(client_config.retry_cfg.el, client_info->fd_info->socket.fd, FR_EVENT_FILTER_IO);
fr_radius_global_free();
*/
my->fd->uctx = my;
- my->fd_info = fr_bio_fd_info(my->fd);
- fr_assert(my->fd_info != NULL);
+ my->info.fd_info = fr_bio_fd_info(my->fd);
+ fr_assert(my->info.fd_info != NULL);
- my->reply_socket = my->fd_info->socket;
+ my->reply_socket = my->info.fd_info->socket;
if ((my->reply_socket.af == AF_INET) || (my->reply_socket.af == AF_INET6)) {
- fr_socket_addr_swap(&my->reply_socket, &my->fd_info->socket);
+ fr_socket_addr_swap(&my->reply_socket, &my->info.fd_info->socket);
}
my->mem = fr_bio_mem_alloc(my, read_size, 2 * 4096, my->fd);
/*
* Set up the connected status.
*/
- my->info.connected = (my->fd_info->type == FR_BIO_FD_CONNECTED) && (my->fd_info->state == FR_BIO_FD_STATE_OPEN);
+ my->info.connected = (my->info.fd_info->type == FR_BIO_FD_CONNECTED) && (my->info.fd_info->state == FR_BIO_FD_STATE_OPEN);
talloc_set_destructor(my, _radius_client_fd_bio_free);
if (my->info.connected) return 0;
- switch (my->fd_info->type) {
+ switch (my->info.fd_info->type) {
default:
fr_strerror_const("Invalid RADIUS client bio for connect");
return fr_bio_error(GENERIC);
break;
}
- switch(my->fd_info->state) {
+ switch(my->info.fd_info->state) {
case FR_BIO_FD_STATE_INVALID:
fr_strerror_const("Invalid RADIUS client bio state");
return fr_bio_error(GENERIC);
SET(write_resume);
SET(read_resume);
- (void) fr_bio_cb_set(my->fd, &bio_cb);
-
- return 0;
+ return fr_bio_cb_set(my->fd, &bio_cb);
}