The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
bio.c File Reference

RADIUS BIO transport. More...

#include <freeradius-devel/io/application.h>
#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/pair.h>
#include <freeradius-devel/missing.h>
#include <freeradius-devel/server/connection.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/heap.h>
#include <freeradius-devel/util/rb_expire.h>
#include <sys/socket.h>
#include "track.h"
+ Include dependency graph for bio.c:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bio_handle_ctx_t
 
struct  bio_handle_t
 Track the handle, which is tightly correlated with the FD. More...
 
struct  bio_handle_t.bio
 
struct  bio_request_s
 Connect request_t to local tracking structure. More...
 
struct  bio_thread_t
 
struct  bio_thread_t.bio
 
struct  home_server_t
 

Macros

#define REQUIRE_MA(_h)   (((_h)->ctx.inst->require_message_authenticator == FR_RADIUS_REQUIRE_MA_YES) || (_h)->ctx.inst->received_message_authenticator)
 

Typedefs

typedef struct bio_request_s bio_request_t
 

Functions

static int _bio_handle_free (bio_handle_t *h)
 Free a connection handle, closing associated resources.
 
static int _bio_request_free (bio_request_t *u)
 Free a bio_request_t.
 
static void bio_connected (fr_bio_t *bio)
 
static void bio_error (fr_bio_t *bio)
 
static void bio_request_reset (bio_request_t *u)
 Clear out any connection specific resources from a udp request.
 
static void bio_tracking_entry_log (fr_log_t const *log, fr_log_type_t log_type, char const *file, int line, radius_track_entry_t *te)
 Log additional information about a tracking entry.
 
static bool check_for_zombie (fr_event_list_t *el, trunk_connection_t *tconn, fr_time_t now, fr_time_t last_sent)
 See if the connection is zombied.
 
static void conn_close (UNUSED fr_event_list_t *el, void *handle, UNUSED void *uctx)
 Shutdown/close a file descriptor.
 
static void conn_discard (UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
 Read and discard data.
 
static void conn_error (UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, int fd_errno, void *uctx)
 Connection errored.
 
static connection_state_t conn_failed (void *handle, connection_state_t state, UNUSED void *uctx)
 Connection failed.
 
static connection_state_t conn_init (void **h_out, connection_t *conn, void *uctx)
 Initialise a new outbound connection.
 
static void conn_init_error (UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, int fd_errno, void *uctx)
 Connection errored.
 
static void conn_init_next (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx)
 Perform the next step of init and negotiation.
 
static void conn_init_readable (fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
 Read the connection during the init and negotiation stage.
 
static void conn_init_timeout (UNUSED fr_timer_list_t *tl, fr_time_t now, void *uctx)
 Status check timer when opening the connection for the first time.
 
static void conn_init_writable (fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
 Send initial negotiation.
 
static void conn_init_writable (UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
 
static fr_radius_decode_fail_t decode (TALLOC_CTX *ctx, fr_pair_list_t *reply, uint8_t *response_code, bio_handle_t *h, request_t *request, bio_request_t *u, uint8_t const request_authenticator[static RADIUS_AUTH_VECTOR_LENGTH], uint8_t *data, size_t data_len)
 Decode response packet data, extracting relevant information and validating the packet.
 
static void do_retry (rlm_radius_t const *inst, bio_request_t *u, request_t *request, fr_retry_t const *retry)
 
static void do_signal (rlm_radius_t const *inst, bio_request_t *u, request_t *request, fr_signal_t action)
 
static void do_signal (rlm_radius_t const *inst, bio_request_t *u, UNUSED request_t *request, fr_signal_t action)
 
static int encode (bio_handle_t *h, request_t *request, bio_request_t *u, uint8_t id)
 
static int8_t home_server_cmp (void const *one, void const *two)
 Dynamic home server code.
 
static void home_server_free (void *data)
 
static void mod_dup (request_t *request, bio_request_t *u)
 
static int mod_enqueue (bio_request_t **p_u, fr_retry_config_t const **p_retry_config, rlm_radius_t const *inst, trunk_t *trunk, request_t *request)
 
static unlang_action_t mod_resume (rlm_rcode_t *p_result, module_ctx_t const *mctx, UNUSED request_t *request)
 Resume execution of the request, returning the rcode set during trunk execution.
 
static void mod_retry (module_ctx_t const *mctx, request_t *request, fr_retry_t const *retry)
 Handle module retries.
 
static void mod_signal (module_ctx_t const *mctx, UNUSED request_t *request, fr_signal_t action)
 
static int mod_thread_instantiate (module_thread_inst_ctx_t const *mctx)
 Instantiate thread data for the submodule.
 
static void mod_write (request_t *request, trunk_request_t *treq, bio_handle_t *h)
 
static void protocol_error_reply (bio_request_t *u, bio_handle_t *h)
 Deal with Protocol-Error replies, and possible negotiation.
 
static void request_cancel (UNUSED connection_t *conn, void *preq_to_reset, trunk_cancel_reason_t reason, UNUSED void *uctx)
 Remove the request from any tracking structures.
 
static void request_complete (request_t *request, NDEBUG_UNUSED void *preq, void *rctx, UNUSED void *uctx)
 Response has already been written to the rctx at this point.
 
static void request_conn_release (connection_t *conn, void *preq_to_reset, UNUSED void *uctx)
 Clear out anything associated with the handle from the request.
 
static void request_demux (UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 
static void request_fail (request_t *request, NDEBUG_UNUSED void *preq, void *rctx, NDEBUG_UNUSED trunk_request_state_t state, UNUSED void *uctx)
 Write out a canned failure.
 
static void request_mux (UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 
static int8_t request_prioritise (void const *one, void const *two)
 
static void request_replicate_demux (UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 
static void request_replicate_mux (UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
 
static void revive_timeout (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx)
 Revive a connection after "revive_interval".
 
static fr_bio_verify_action_t rlm_radius_verify (UNUSED fr_bio_t *bio, void *verify_ctx, UNUSED void *packet_ctx, const void *data, size_t *size)
 
static void status_check_alloc (bio_handle_t *h)
 
static void status_check_next (UNUSED fr_timer_list_t *tl, UNUSED fr_time_t now, void *uctx)
 Handle retries for a status check.
 
static void status_check_reply (trunk_request_t *treq, fr_time_t now)
 Deal with replies replies to status checks and possible negotiation.
 
static void status_check_reset (bio_handle_t *h, bio_request_t *u)
 Reset a status_check packet, ready to reuse.
 
static connection_tthread_conn_alloc (trunk_connection_t *tconn, fr_event_list_t *el, connection_conf_t const *conf, char const *log_prefix, void *uctx)
 
static void thread_conn_notify (trunk_connection_t *tconn, connection_t *conn, fr_event_list_t *el, trunk_connection_event_t notify_on, UNUSED void *uctx)
 
static xlat_action_t xlat_radius_client (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args)
 
static xlat_action_t xlat_radius_replicate (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *args)
 
static xlat_action_t xlat_sendto_resume (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in)
 
static void xlat_sendto_retry (xlat_ctx_t const *xctx, request_t *request, fr_retry_t const *retry)
 
static void xlat_sendto_signal (xlat_ctx_t const *xctx, request_t *request, fr_signal_t action)
 
static void zombie_timeout (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 Mark a connection dead after "zombie_interval".
 

Variables

static const trunk_io_funcs_t io_funcs
 
static const trunk_io_funcs_t io_replicate_funcs
 
static rlm_rcode_t radius_code_to_rcode [FR_RADIUS_CODE_MAX]
 Turn a reply code into a module rcode;.
 
static xlat_arg_parser_t const xlat_radius_send_args []
 

Detailed Description

RADIUS BIO transport.

Id
d75153102b08b62f705cbf2fb80795fad2502e80

Definition in file bio.c.


Data Structure Documentation

◆ bio_handle_ctx_t

struct bio_handle_ctx_t

Definition at line 40 of file bio.c.

+ Collaboration diagram for bio_handle_ctx_t:
Data Fields
fr_event_list_t * el Event list.
fr_bio_fd_config_t fd_config for threads or sockets
fr_bio_fd_info_t const * fd_info status of the FD.
rlm_radius_t const * inst our instance
char const * module_name the module that opened the connection
fr_radius_ctx_t radius_ctx
trunk_t * trunk trunk handler

◆ bio_handle_t

struct bio_handle_t

Track the handle, which is tightly correlated with the FD.

Definition at line 65 of file bio.c.

+ Collaboration diagram for bio_handle_t:
Data Fields
struct bio_handle_t.bio bio
uint8_t * buffer Receive buffer.
size_t buflen Receive buffer length.
connection_t * conn
bio_handle_ctx_t ctx common struct for home servers and BIO handles
int fd File descriptor.
fr_time_t first_sent first time we sent a packet since going idle
uint8_t last_id Used when replicating to ensure IDs are distributed evenly.
fr_time_t last_idle last time we had nothing to do
fr_time_t last_reply When we last received a reply.
fr_time_t last_sent last time we sent a packet.
uint32_t max_packet_size Our max packet size. may be different from the parent.
fr_time_t mrs_time Most recent sent time which had a reply.
bool status_checking whether we're doing status checks
request_t * status_request
bio_request_t * status_u for sending status check packets
radius_track_t * tt RADIUS ID tracking structure.
fr_timer_t * zombie_ev Zombie timeout.

◆ bio_handle_t.bio

struct bio_handle_t.bio

Definition at line 70 of file bio.c.

Data Fields
fr_bio_t * fd raw FD
fr_bio_t * mem memory wrappers for stream sockets
fr_bio_t * read what we use for input
fr_bio_t * write what we use for output

◆ bio_request_s

struct bio_request_s

Connect request_t to local tracking structure.

Definition at line 106 of file bio.c.

+ Collaboration diagram for bio_request_s:
Data Fields
uint8_t code Packet code.
fr_timer_t * ev timer for retransmissions
fr_pair_list_t extra VPs for debugging, like Proxy-State.
uint8_t id Last ID assigned to this packet.
bool is_retry
uint32_t num_replies number of reply packets, sent is in retry.count
uint8_t * packet Packet we write to the network.
size_t packet_len Length of the packet.
size_t partial partially sent data
uint32_t priority copied from request->async->priority
bool proxied is this request being proxied
rlm_rcode_t rcode from the transport
fr_time_t recv_time copied from request->async->recv_time
fr_retry_t retry retransmission timers
radius_track_entry_t * rr ID tracking, resend count, etc.
bool status_check is this packet a status check?
trunk_request_t * treq

◆ bio_thread_t

struct bio_thread_t

Definition at line 50 of file bio.c.

+ Collaboration diagram for bio_thread_t:
Data Fields
struct bio_thread_t.bio bio
bio_handle_ctx_t ctx common struct for home servers and BIO handles

◆ bio_thread_t.bio

struct bio_thread_t.bio

Definition at line 53 of file bio.c.

Data Fields
fr_rb_expire_t expires for proxying / client sending
fr_bio_t * fd writing
uint32_t id for replication

◆ home_server_t

struct home_server_t

Definition at line 132 of file bio.c.

+ Collaboration diagram for home_server_t:
Data Fields
bio_handle_ctx_t ctx for copying to bio_handle_t
fr_rb_expire_node_t expire

Macro Definition Documentation

◆ REQUIRE_MA

#define REQUIRE_MA (   _h)    (((_h)->ctx.inst->require_message_authenticator == FR_RADIUS_REQUIRE_MA_YES) || (_h)->ctx.inst->received_message_authenticator)

Typedef Documentation

◆ bio_request_t

typedef struct bio_request_s bio_request_t

Definition at line 60 of file bio.c.

Function Documentation

◆ _bio_handle_free()

static int _bio_handle_free ( bio_handle_t h)
static

Free a connection handle, closing associated resources.

Definition at line 597 of file bio.c.

+ Here is the caller graph for this function:

◆ _bio_request_free()

static int _bio_request_free ( bio_request_t u)
static

Free a bio_request_t.

Allows us to set break points for debugging.

Definition at line 2344 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bio_connected()

static void bio_connected ( fr_bio_t bio)
static

Definition at line 614 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bio_error()

static void bio_error ( fr_bio_t bio)
static

Definition at line 623 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bio_request_reset()

static void bio_request_reset ( bio_request_t u)
static

Clear out any connection specific resources from a udp request.

Definition at line 203 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bio_tracking_entry_log()

static void bio_tracking_entry_log ( fr_log_t const *  log,
fr_log_type_t  log_type,
char const *  file,
int  line,
radius_track_entry_t te 
)
static

Log additional information about a tracking entry.

Parameters
[in]teTracking entry we're logging information for.
[in]logdestination.
[in]log_typeType of log message.
[in]filethe logging request was made in.
[in]linelogging request was made on.

Definition at line 184 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_for_zombie()

static bool check_for_zombie ( fr_event_list_t el,
trunk_connection_t tconn,
fr_time_t  now,
fr_time_t  last_sent 
)
static

See if the connection is zombied.

We check for zombie when major events happen:

1) request hits its final timeout
2) request timer hits, and it needs to be retransmitted
3) a DUP packet comes in, and the request needs to be retransmitted
4) we're sending a packet.

There MIGHT not be retries configured, so we MUST check for zombie when any new packet comes in. Similarly, there MIGHT not be new packets, but retries are configured, so we have to check there, too.

Also, the socket might not be writable for a while. There MIGHT be a long time between getting the timer / DUP signal, and the request finally being written to the socket. So we need to check for zombie at BOTH the timeout and the mux / write function.

Returns
  • true if the connection is zombie.
  • false if the connection is not zombie.

Definition at line 1306 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_close()

static void conn_close ( UNUSED fr_event_list_t el,
void *  handle,
UNUSED void *  uctx 
)
static

Shutdown/close a file descriptor.

Definition at line 816 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_discard()

static void conn_discard ( UNUSED fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
void *  uctx 
)
static

Read and discard data.

Definition at line 899 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_error()

static void conn_error ( UNUSED fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
int  fd_errno,
void *  uctx 
)
static

Connection errored.

We were signalled by the event loop that a fatal error occurred on this connection.

Parameters
[in]elThe event list signalling.
[in]fdthat errored.
[in]flagsEl flags.
[in]fd_errnoThe nature of the error.
[in]uctxThe trunk connection handle (tconn).

Definition at line 934 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_failed()

static connection_state_t conn_failed ( void *  handle,
connection_state_t  state,
UNUSED void *  uctx 
)
static

Connection failed.

Parameters
[in]handleof connection that failed.
[in]statethe connection was in when it failed.
[in]uctxUNUSED.

Definition at line 843 of file bio.c.

+ Here is the caller graph for this function:

◆ conn_init()

static connection_state_t conn_init ( void **  h_out,
connection_t conn,
void *  uctx 
)
static

Initialise a new outbound connection.

Parameters
[out]h_outWhere to write the new file descriptor.
[in]connto initialise.
[in]uctxA bio_thread_t

Definition at line 695 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_init_error()

static void conn_init_error ( UNUSED fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
int  fd_errno,
void *  uctx 
)
static

Connection errored.

We were signalled by the event loop that a fatal error occurred on this connection.

Parameters
[in]elThe event list signalling.
[in]fdthat errored.
[in]flagsEl flags.
[in]fd_errnoThe nature of the error.
[in]uctxThe trunk connection handle (tconn).

Definition at line 325 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_init_next()

static void conn_init_next ( UNUSED fr_timer_list_t tl,
UNUSED fr_time_t  now,
void *  uctx 
)
static

Perform the next step of init and negotiation.

Definition at line 394 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_init_readable()

static void conn_init_readable ( fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
void *  uctx 
)
static

Read the connection during the init and negotiation stage.

Definition at line 408 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_init_timeout()

static void conn_init_timeout ( UNUSED fr_timer_list_t tl,
fr_time_t  now,
void *  uctx 
)
static

Status check timer when opening the connection for the first time.

Setup retries, or fail the connection.

Definition at line 346 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ conn_init_writable() [1/2]

static void conn_init_writable ( fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
void *  uctx 
)
static

Send initial negotiation.

Definition at line 516 of file bio.c.

+ Here is the call graph for this function:

◆ conn_init_writable() [2/2]

static void conn_init_writable ( UNUSED fr_event_list_t el,
UNUSED int  fd,
UNUSED int  flags,
void *  uctx 
)
static
+ Here is the caller graph for this function:

◆ decode()

static fr_radius_decode_fail_t decode ( TALLOC_CTX *  ctx,
fr_pair_list_t reply,
uint8_t response_code,
bio_handle_t h,
request_t request,
bio_request_t u,
uint8_t const  request_authenticator[static RADIUS_AUTH_VECTOR_LENGTH],
uint8_t data,
size_t  data_len 
)
static

Decode response packet data, extracting relevant information and validating the packet.

Parameters
[in]ctxto allocate pairs in.
[out]replyPointer to head of pair list to add reply attributes to.
[out]response_codeThe type of response packet.
[in]hconnection handle.
[in]requestthe request.
[in]uUDP request.
[in]request_authenticatorfrom the original request.
[in]datato decode.
[in]data_lenLength of input data.
Returns
  • DECODE_FAIL_NONE on success.
  • DECODE_FAIL_* on failure.

Definition at line 1054 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_retry()

static void do_retry ( rlm_radius_t const *  inst,
bio_request_t u,
request_t request,
fr_retry_t const *  retry 
)
static

Definition at line 1409 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_signal() [1/2]

static void do_signal ( rlm_radius_t const *  inst,
bio_request_t u,
request_t request,
fr_signal_t  action 
)
static
+ Here is the caller graph for this function:

◆ do_signal() [2/2]

static void do_signal ( rlm_radius_t const *  inst,
bio_request_t u,
UNUSED request_t request,
fr_signal_t  action 
)
static

Definition at line 2295 of file bio.c.

+ Here is the call graph for this function:

◆ encode()

static int encode ( bio_handle_t h,
request_t request,
bio_request_t u,
uint8_t  id 
)
static

Definition at line 1121 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ home_server_cmp()

static int8_t home_server_cmp ( void const *  one,
void const *  two 
)
static

Dynamic home server code.

Definition at line 2707 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ home_server_free()

static void home_server_free ( void *  data)
static

Definition at line 2498 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_dup()

static void mod_dup ( request_t request,
bio_request_t u 
)
static

Definition at line 1365 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_enqueue()

static int mod_enqueue ( bio_request_t **  p_u,
fr_retry_config_t const **  p_retry_config,
rlm_radius_t const *  inst,
trunk_t trunk,
request_t request 
)
static

Definition at line 2365 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_resume()

static unlang_action_t mod_resume ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
UNUSED request_t request 
)
static

Resume execution of the request, returning the rcode set during trunk execution.

Definition at line 2274 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_retry()

static void mod_retry ( module_ctx_t const *  mctx,
request_t request,
fr_retry_t const *  retry 
)
static

Handle module retries.

Definition at line 1401 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_signal()

static void mod_signal ( module_ctx_t const *  mctx,
UNUSED request_t request,
fr_signal_t  action 
)
static

Definition at line 2286 of file bio.c.

+ Here is the call graph for this function:

◆ mod_thread_instantiate()

static int mod_thread_instantiate ( module_thread_inst_ctx_t const *  mctx)
static

Instantiate thread data for the submodule.

Definition at line 2532 of file bio.c.

+ Here is the call graph for this function:

◆ mod_write()

static void mod_write ( request_t request,
trunk_request_t treq,
bio_handle_t h 
)
static

Definition at line 1501 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ protocol_error_reply()

static void protocol_error_reply ( bio_request_t u,
bio_handle_t h 
)
static

Deal with Protocol-Error replies, and possible negotiation.

Definition at line 1711 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ request_cancel()

static void request_cancel ( UNUSED connection_t conn,
void *  preq_to_reset,
trunk_cancel_reason_t  reason,
UNUSED void *  uctx 
)
static

Remove the request from any tracking structures.

Frees encoded packets if the request is being moved to a new connection

Definition at line 2180 of file bio.c.

◆ request_complete()

static void request_complete ( request_t request,
NDEBUG_UNUSED void *  preq,
void *  rctx,
UNUSED void *  uctx 
)
static

Response has already been written to the rctx at this point.

Definition at line 2256 of file bio.c.

+ Here is the call graph for this function:

◆ request_conn_release()

static void request_conn_release ( connection_t conn,
void *  preq_to_reset,
UNUSED void *  uctx 
)
static

Clear out anything associated with the handle from the request.

Definition at line 2212 of file bio.c.

+ Here is the call graph for this function:

◆ request_demux()

static void request_demux ( UNUSED fr_event_list_t el,
trunk_connection_t tconn,
connection_t conn,
UNUSED void *  uctx 
)
static

Definition at line 1889 of file bio.c.

+ Here is the call graph for this function:

◆ request_fail()

static void request_fail ( request_t request,
NDEBUG_UNUSED void *  preq,
void *  rctx,
NDEBUG_UNUSED trunk_request_state_t  state,
UNUSED void *  uctx 
)
static

Write out a canned failure.

Definition at line 2234 of file bio.c.

+ Here is the call graph for this function:

◆ request_mux()

static void request_mux ( UNUSED fr_event_list_t el,
trunk_connection_t tconn,
connection_t conn,
UNUSED void *  uctx 
)
static

Definition at line 1482 of file bio.c.

+ Here is the call graph for this function:

◆ request_prioritise()

static int8_t request_prioritise ( void const *  one,
void const *  two 
)
static

Definition at line 1015 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ request_replicate_demux()

static void request_replicate_demux ( UNUSED fr_event_list_t el,
trunk_connection_t tconn,
connection_t conn,
UNUSED void *  uctx 
)
static

Definition at line 2060 of file bio.c.

+ Here is the call graph for this function:

◆ request_replicate_mux()

static void request_replicate_mux ( UNUSED fr_event_list_t el,
trunk_connection_t tconn,
connection_t conn,
UNUSED void *  uctx 
)
static

Definition at line 2043 of file bio.c.

+ Here is the call graph for this function:

◆ revive_timeout()

static void revive_timeout ( UNUSED fr_timer_list_t tl,
UNUSED fr_time_t  now,
void *  uctx 
)
static

Revive a connection after "revive_interval".

Definition at line 1236 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rlm_radius_verify()

static fr_bio_verify_action_t rlm_radius_verify ( UNUSED fr_bio_t bio,
void *  verify_ctx,
UNUSED void *  packet_ctx,
const void *  data,
size_t size 
)
static

Definition at line 633 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status_check_alloc()

static void status_check_alloc ( bio_handle_t h)
static

Definition at line 237 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status_check_next()

static void status_check_next ( UNUSED fr_timer_list_t tl,
UNUSED fr_time_t  now,
void *  uctx 
)
static

Handle retries for a status check.

Definition at line 1826 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status_check_reply()

static void status_check_reply ( trunk_request_t treq,
fr_time_t  now 
)
static

Deal with replies replies to status checks and possible negotiation.

Definition at line 1841 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ status_check_reset()

static void status_check_reset ( bio_handle_t h,
bio_request_t u 
)
static

Reset a status_check packet, ready to reuse.

Definition at line 220 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread_conn_alloc()

static connection_t * thread_conn_alloc ( trunk_connection_t tconn,
fr_event_list_t el,
connection_conf_t const *  conf,
char const *  log_prefix,
void *  uctx 
)
static

Definition at line 870 of file bio.c.

+ Here is the call graph for this function:

◆ thread_conn_notify()

static void thread_conn_notify ( trunk_connection_t tconn,
connection_t conn,
fr_event_list_t el,
trunk_connection_event_t  notify_on,
UNUSED void *  uctx 
)
static

Definition at line 946 of file bio.c.

+ Here is the call graph for this function:

◆ xlat_radius_client()

static xlat_action_t xlat_radius_client ( UNUSED TALLOC_CTX *  ctx,
UNUSED fr_dcursor_t out,
xlat_ctx_t const *  xctx,
request_t request,
fr_value_box_list_t *  args 
)
static

Definition at line 2758 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_radius_replicate()

static xlat_action_t xlat_radius_replicate ( UNUSED TALLOC_CTX *  ctx,
UNUSED fr_dcursor_t out,
xlat_ctx_t const *  xctx,
request_t request,
fr_value_box_list_t *  args 
)
static

Definition at line 2608 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xlat_sendto_resume()

static xlat_action_t xlat_sendto_resume ( TALLOC_CTX *  ctx,
fr_dcursor_t out,
xlat_ctx_t const *  xctx,
request_t request,
UNUSED fr_value_box_list_t *  in 
)
static

Definition at line 2719 of file bio.c.

+ Here is the call graph for this function:

◆ xlat_sendto_retry()

static void xlat_sendto_retry ( xlat_ctx_t const *  xctx,
request_t request,
fr_retry_t const *  retry 
)
static

Definition at line 2747 of file bio.c.

+ Here is the call graph for this function:

◆ xlat_sendto_signal()

static void xlat_sendto_signal ( xlat_ctx_t const *  xctx,
request_t request,
fr_signal_t  action 
)
static

Definition at line 2736 of file bio.c.

+ Here is the call graph for this function:

◆ zombie_timeout()

static void zombie_timeout ( fr_timer_list_t tl,
fr_time_t  now,
void *  uctx 
)
static

Mark a connection dead after "zombie_interval".

Definition at line 1248 of file bio.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ io_funcs

const trunk_io_funcs_t io_funcs
static
Initial value:
= {
.connection_alloc = thread_conn_alloc,
.connection_notify = thread_conn_notify,
.request_prioritise = request_prioritise,
.request_mux = request_mux,
.request_demux = request_demux,
.request_conn_release = request_conn_release,
.request_complete = request_complete,
.request_fail = request_fail,
.request_cancel = request_cancel,
}
static int8_t request_prioritise(void const *one, void const *two)
Definition bio.c:1015
static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
Definition bio.c:1889
static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn, fr_event_list_t *el, trunk_connection_event_t notify_on, UNUSED void *uctx)
Definition bio.c:946
static void request_conn_release(connection_t *conn, void *preq_to_reset, UNUSED void *uctx)
Clear out anything associated with the handle from the request.
Definition bio.c:2212
static void request_cancel(UNUSED connection_t *conn, void *preq_to_reset, trunk_cancel_reason_t reason, UNUSED void *uctx)
Remove the request from any tracking structures.
Definition bio.c:2180
static void request_fail(request_t *request, NDEBUG_UNUSED void *preq, void *rctx, NDEBUG_UNUSED trunk_request_state_t state, UNUSED void *uctx)
Write out a canned failure.
Definition bio.c:2234
static connection_t * thread_conn_alloc(trunk_connection_t *tconn, fr_event_list_t *el, connection_conf_t const *conf, char const *log_prefix, void *uctx)
Definition bio.c:870
static void request_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
Definition bio.c:1482
static void request_complete(request_t *request, NDEBUG_UNUSED void *preq, void *rctx, UNUSED void *uctx)
Response has already been written to the rctx at this point.
Definition bio.c:2256

Definition at line 2505 of file bio.c.

◆ io_replicate_funcs

const trunk_io_funcs_t io_replicate_funcs
static
Initial value:
= {
.connection_alloc = thread_conn_alloc,
.connection_notify = thread_conn_notify,
.request_prioritise = request_prioritise,
.request_mux = request_replicate_mux,
.request_demux = request_replicate_demux,
.request_conn_release = request_conn_release,
.request_complete = request_complete,
.request_fail = request_fail,
.request_cancel = request_cancel,
}
static void request_replicate_mux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
Definition bio.c:2043
static void request_replicate_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, UNUSED void *uctx)
Definition bio.c:2060

Definition at line 2517 of file bio.c.

◆ radius_code_to_rcode

rlm_rcode_t radius_code_to_rcode[FR_RADIUS_CODE_MAX]
static
Initial value:
= {
}
@ FR_RADIUS_CODE_ACCESS_CHALLENGE
RFC2865 - Access-Challenge.
Definition defs.h:43
@ FR_RADIUS_CODE_DISCONNECT_ACK
RFC3575/RFC5176 - Disconnect-Ack (positive)
Definition defs.h:47
@ FR_RADIUS_CODE_ACCESS_ACCEPT
RFC2865 - Access-Accept.
Definition defs.h:34
@ FR_RADIUS_CODE_ACCOUNTING_RESPONSE
RFC2866 - Accounting-Response.
Definition defs.h:37
@ FR_RADIUS_CODE_COA_NAK
RFC3575/RFC5176 - CoA-Nak (not willing to perform)
Definition defs.h:51
@ FR_RADIUS_CODE_COA_ACK
RFC3575/RFC5176 - CoA-Ack (positive)
Definition defs.h:50
@ FR_RADIUS_CODE_DISCONNECT_NAK
RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
Definition defs.h:48
@ FR_RADIUS_CODE_PROTOCOL_ERROR
RFC7930 - Protocol-Error (generic NAK)
Definition defs.h:52
@ FR_RADIUS_CODE_ACCESS_REJECT
RFC2865 - Access-Reject.
Definition defs.h:35
@ RLM_MODULE_OK
The module is OK, continue.
Definition rcode.h:43
@ RLM_MODULE_REJECT
Immediately reject the request.
Definition rcode.h:41
@ RLM_MODULE_UPDATED
OK (pairs modified).
Definition rcode.h:49
@ RLM_MODULE_HANDLED
The module handled the request, so stop.
Definition rcode.h:44

Turn a reply code into a module rcode;.

Definition at line 141 of file bio.c.

◆ xlat_radius_send_args

xlat_arg_parser_t const xlat_radius_send_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_COMBO_IP_ADDR },
{ .required = true, .single = true, .type = FR_TYPE_UINT16 },
{ .required = true, .single = true, .type = FR_TYPE_STRING },
}
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_UINT16
16 Bit unsigned integer.
@ FR_TYPE_COMBO_IP_ADDR
IPv4 or IPv6 address depending on length.
#define XLAT_ARG_PARSER_TERMINATOR
Definition xlat.h:169

Definition at line 2598 of file bio.c.