The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
master.c File Reference

Master IO handler. More...

#include <freeradius-devel/io/listen.h>
#include <freeradius-devel/io/master.h>
#include <freeradius-devel/util/syserror.h>
+ Include dependency graph for master.c:

Go to the source code of this file.

Data Structures

struct  fr_io_client_s
 Client definitions for master IO. More...
 
struct  fr_io_connection_s
 Track a connection. More...
 
struct  fr_io_nak_entry_t
 A negative cache entry. More...
 
struct  fr_io_pending_packet_t
 A saved packet. More...
 
struct  fr_io_thread_t
 
struct  fr_io_thread_t.rate_limit
 

Macros

#define COPY_FIELD(_dest, _x)   _dest->radclient->_x = radclient->_x
 
#define COPY_FIELD(_x)   c->_x = parent->_x
 
#define DUP_FIELD(_dest, _x)   _dest->radclient->_x = talloc_strdup(_dest->radclient, radclient->_x)
 
#define DUP_FIELD(_x)   do { if (parent->_x) {c->_x = talloc_strdup(c, parent->_x); if (!c->_x) {goto error;}}} while (0)
 
#define LOG_IGNORED_CLIENTS(_inst)   ((_inst)->log_ignored_clients || fr_debug_lvl >= 1)
 

Typedefs

typedef struct fr_io_connection_s fr_io_connection_t
 

Enumerations

enum  fr_io_client_state_t {
  PR_CLIENT_INVALID = 0 ,
  PR_CLIENT_STATIC ,
  PR_CLIENT_DYNAMIC ,
  PR_CLIENT_CONNECTED ,
  PR_CLIENT_PENDING
}
 Client states. More...
 

Functions

static int _client_free (fr_io_client_t *client)
 
static int _client_live_free (fr_io_client_t *client)
 
static fr_cmp_ret_t address_cmp (void const *one, void const *two)
 
static fr_cmp_ret_t alive_client_cmp (void const *one, void const *two)
 
static fr_io_client_t * client_alloc (TALLOC_CTX *ctx, fr_io_client_state_t state, fr_io_instance_t const *inst, fr_io_thread_t *thread, fr_client_t *radclient, fr_ipaddr_t const *network)
 Allocate a dynamic client.
 
static void client_expiry_timer (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 
static void client_pending_free (fr_io_client_t *client)
 
static fr_cmp_ret_t connection_cmp (void const *one, void const *two)
 
static int connection_free (fr_io_connection_t *connection)
 
static uint32_t connection_hash (void const *ctx)
 
static int count_connections (UNUSED uint8_t const *key, UNUSED size_t keylen, void *data, void *ctx)
 Count the number of connections used by active clients.
 
static void fr_io_client_delete (fr_io_client_t *client)
 Delete a client and any connection it belongs to.
 
static fr_io_connection_t * fr_io_connection_alloc (fr_io_instance_t const *inst, fr_io_thread_t *thread, fr_io_client_t *client, int fd, fr_io_address_t *address)
 Create a new connection.
 
static void fr_io_connection_allow (fr_io_client_t *parent, fr_client_t *radclient)
 Promote a pending dynamic-client parent and all of its child connections.
 
static void fr_io_connection_deny (fr_io_client_t *parent)
 Tear down any deferred sibling connections under a pending parent.
 
int fr_io_listen_free (fr_listen_t *li)
 
static void fr_io_nak_expire (fr_io_thread_t *thread, fr_time_t now)
 Expire entries in the cache.
 
static bool fr_io_nak_find (fr_io_thread_t *thread, fr_ipaddr_t const *src_ipaddr)
 Look up a negative cache entry.
 
static void fr_io_nak_insert (fr_io_thread_t *thread, fr_ipaddr_t const *src_ipaddr, fr_time_delta_t lifetime)
 Add a negative cache entry.
 
static fr_io_pending_packet_t * fr_io_pending_alloc (fr_io_connection_t *connection, fr_io_client_t *client, uint8_t const *buffer, size_t packet_len, fr_io_track_t *track, int priority)
 
static fr_io_track_t * fr_io_track_add (fr_listen_t const *li, fr_io_client_t *client, fr_io_address_t *address, uint8_t const *packet, size_t packet_len, fr_time_t recv_time, bool *is_dup)
 
int fr_master_io_listen (fr_io_instance_t *inst, fr_schedule_t *sc, size_t default_message_size, size_t num_messages)
 
fr_trie_t * fr_master_io_network (TALLOC_CTX *ctx, int af, fr_ipaddr_t *allow, fr_ipaddr_t *deny)
 Create a trie from arrays of allow / deny IP addresses.
 
fr_io_track_t * fr_master_io_track_alloc (fr_listen_t *li, fr_client_t *radclient, fr_ipaddr_t const *src_ipaddr, int src_port, fr_ipaddr_t const *dst_ipaddr, int dst_port)
 
static void get_inst (fr_listen_t *li, fr_io_instance_t const **inst, fr_io_thread_t **thread, fr_io_connection_t **connection, fr_listen_t **child)
 
static int mod_close (fr_listen_t *li)
 Close the socket.
 
static void mod_event_list_set (fr_listen_t *li, fr_event_list_t *el, void *nr)
 Set the event list for a new socket.
 
static int mod_inject (fr_listen_t *li, uint8_t const *buffer, size_t buffer_len, fr_time_t recv_time)
 Inject a packet to a connection.
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static char const * mod_name (fr_listen_t *li)
 
static int mod_open (fr_listen_t *li)
 Open a new listener.
 
static ssize_t mod_read (fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
 Implement 99% of the read routines.
 
static ssize_t mod_write (fr_listen_t *li, void *packet_ctx, fr_time_t request_time, uint8_t *buffer, size_t buffer_len, size_t written)
 
static void packet_expiry_timer (fr_timer_list_t *tl, fr_time_t now, void *uctx)
 
static fr_cmp_ret_t pending_client_cmp (void const *one, void const *two)
 
static int pending_free (fr_io_pending_packet_t *pending)
 
static fr_cmp_ret_t pending_packet_cmp (void const *one, void const *two)
 
static fr_io_pending_packet_t * pending_packet_pop (fr_io_thread_t *thread)
 
static fr_client_t * radclient_alloc (TALLOC_CTX *ctx, int ipproto, fr_io_address_t *address)
 
static fr_client_t * radclient_clone (TALLOC_CTX *ctx, fr_client_t const *parent)
 
static fr_cmp_ret_t track_cmp (void const *one, void const *two)
 
static fr_cmp_ret_t track_connected_cmp (void const *one, void const *two)
 
static int track_dedup_free (fr_io_track_t *track)
 
static int track_free (fr_io_track_t *track)
 
static void update_client (fr_io_client_t *client, fr_client_t *radclient)
 

Variables

fr_app_io_t fr_master_app_io
 
static fr_event_update_t pause_read []
 
static fr_event_update_t resume_read []
 

Detailed Description

Master IO handler.

Id
147500d0cc1bdf447e558e0ffb0fdbdd3ae7e3cd

Definition in file master.c.


Data Structure Documentation

◆ fr_io_client_s

struct fr_io_client_s

Client definitions for master IO.

Definition at line 123 of file master.c.

+ Collaboration diagram for fr_io_client_s:
Data Fields
fr_hash_table_t * addresses list of src/dst addresses used by this client
fr_heap_index_t alive_id for all clients
fr_io_connection_t * connection parent connection
fr_timer_t * ev when we clean up the client
fr_hash_table_t * ht for tracking connected sockets
bool in_trie is the client in the trie?
fr_io_instance_t const * inst parent instance for master IO handler
pthread_mutex_t mutex for parent / child signaling
fr_ipaddr_t network network for dynamic clients
int packets number of packets using this client
fr_heap_t * pending pending packets for this client
fr_heap_index_t pending_id for pending clients
fr_client_t * radclient old-style definition of this client
bool ready_to_delete are we ready to delete this client?
fr_ipaddr_t src_ipaddr packets come from this address
fr_io_client_state_t state state of this client
fr_rb_tree_t * table tracking table for packets
fr_io_thread_t * thread
bool use_connected does this client allow connected sub-sockets?

◆ fr_io_connection_s

struct fr_io_connection_s

Track a connection.

This structure contains information about the connection, a pointer to the library instance so that we can clean up on exit, and the listener.

It also points to a client structure which is for this connection, and only this connection.

Finally, a pointer to the parent client, so that the child can tell the parent it's alive, and the parent can push packets to the child.

Definition at line 163 of file master.c.

+ Collaboration diagram for fr_io_connection_s:
Data Fields
fr_io_address_t * address full information about the connection.
fr_listen_t * child child listener (app_io) for this socket
fr_io_client_t * client our local client (pending or connected).
bool dead roundabout way to get the network side to close a socket
fr_event_list_t * el event list for this connection
bool in_parent_hash for tracking thread issues
fr_listen_t * listen master listener for this socket
module_instance_t * mi for submodule
char const * name taken from proto_FOO_TRANSPORT
fr_network_t * nr network for this connection
int packets number of packets using this connection
fr_io_client_t * parent points to the parent client.
bool paused event filter doesn't like resuming something that isn't paused

◆ fr_io_nak_entry_t

struct fr_io_nak_entry_t

A negative cache entry.

This is smaller and simpler than using a fr_io_client_t. Plus, it doesn't affect the lifetime, ownership, or parenting of a fr_io_client_t.

Definition at line 37 of file master.c.

+ Collaboration diagram for fr_io_nak_entry_t:
Data Fields
fr_io_nak_list_entry_t entry
fr_time_t expires when this entry stops being used
fr_ipaddr_t src_ipaddr the address which was NAK'd

◆ fr_io_pending_packet_t

struct fr_io_pending_packet_t

A saved packet.

Definition at line 81 of file master.c.

+ Collaboration diagram for fr_io_pending_packet_t:
Data Fields
uint8_t * buffer
size_t buffer_len
fr_heap_index_t heap_id
uint32_t priority
fr_time_t recv_time
fr_io_track_t * track

◆ fr_io_thread_t

struct fr_io_thread_t

Definition at line 45 of file master.c.

+ Collaboration diagram for fr_io_thread_t:
Data Fields
fr_heap_t * alive_clients heap of active dynamic clients
fr_listen_t * child The child (app_io) IO path.
uint64_t client_id Unique client identifier.
fr_event_list_t * el event list, for the master socket.
fr_listen_t * listen The master IO path.
fr_io_nak_list_head_t nak_list time ordered list of NAK entries.
fr_trie_t * nak_trie trie of NAK clients
fr_network_t * nr network for the master socket
uint32_t num_connections number of dynamic connections
uint32_t num_pending_packets number of pending packets
fr_heap_t * pending_clients heap of pending clients
struct fr_io_thread_t.rate_limit rate_limit
fr_schedule_t * sc the scheduler
fr_trie_t * trie trie of clients

◆ fr_io_thread_t.rate_limit

struct fr_io_thread_t.rate_limit

Definition at line 64 of file master.c.

Data Fields
fr_rate_limit_t accept_failed
fr_rate_limit_t alloc_failed
fr_rate_limit_t bad_type
fr_rate_limit_t conn_alloc_failed
fr_rate_limit_t max_connections
fr_rate_limit_t queue_full
fr_rate_limit_t repeat_nak
fr_rate_limit_t too_many_pending
fr_rate_limit_t tracking_failed
fr_rate_limit_t unknown_client

Macro Definition Documentation

◆ COPY_FIELD [1/2]

#define COPY_FIELD (   _dest,
  _x 
)    _dest->radclient->_x = radclient->_x

◆ COPY_FIELD [2/2]

#define COPY_FIELD (   _x)    c->_x = parent->_x

◆ DUP_FIELD [1/2]

#define DUP_FIELD (   _dest,
  _x 
)    _dest->radclient->_x = talloc_strdup(_dest->radclient, radclient->_x)

◆ DUP_FIELD [2/2]

#define DUP_FIELD (   _x)    do { if (parent->_x) {c->_x = talloc_strdup(c, parent->_x); if (!c->_x) {goto error;}}} while (0)

◆ LOG_IGNORED_CLIENTS

#define LOG_IGNORED_CLIENTS (   _inst)    ((_inst)->log_ignored_clients || fr_debug_lvl >= 1)

Typedef Documentation

◆ fr_io_connection_t

Definition at line 118 of file master.c.

Enumeration Type Documentation

◆ fr_io_client_state_t

Client states.

Enumerator
PR_CLIENT_INVALID 
PR_CLIENT_STATIC 

static / global clients

PR_CLIENT_DYNAMIC 

dynamically defined client

PR_CLIENT_CONNECTED 

dynamically defined client in a connected socket

PR_CLIENT_PENDING 

dynamic client pending definition

Definition at line 94 of file master.c.

Function Documentation

◆ _client_free()

static int _client_free ( fr_io_client_t *  client)
static

Definition at line 598 of file master.c.

+ Here is the caller graph for this function:

◆ _client_live_free()

static int _client_live_free ( fr_io_client_t *  client)
static

Definition at line 1119 of file master.c.

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

◆ address_cmp()

static fr_cmp_ret_t address_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 278 of file master.c.

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

◆ alive_client_cmp()

static fr_cmp_ret_t alive_client_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 1487 of file master.c.

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

◆ client_alloc()

static fr_io_client_t * client_alloc ( TALLOC_CTX *  ctx,
fr_io_client_state_t  state,
fr_io_instance_t const *  inst,
fr_io_thread_t *  thread,
fr_client_t *  radclient,
fr_ipaddr_t const *  network 
)
static

Allocate a dynamic client.

Definition at line 1160 of file master.c.

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

◆ client_expiry_timer()

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

Definition at line 2305 of file master.c.

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

◆ client_pending_free()

static void client_pending_free ( fr_io_client_t *  client)
static

Definition at line 613 of file master.c.

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

◆ connection_cmp()

static fr_cmp_ret_t connection_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 308 of file master.c.

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

◆ connection_free()

static int connection_free ( fr_io_connection_t *  connection)
static

Definition at line 630 of file master.c.

+ Here is the caller graph for this function:

◆ connection_hash()

static uint32_t connection_hash ( void const *  ctx)
static

Definition at line 294 of file master.c.

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

◆ count_connections()

static int count_connections ( UNUSED uint8_t const *  key,
UNUSED size_t  keylen,
void *  data,
void *  ctx 
)
static

Count the number of connections used by active clients.

Definition at line 571 of file master.c.

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

◆ fr_io_client_delete()

static void fr_io_client_delete ( fr_io_client_t *  client)
static

Delete a client and any connection it belongs to.

A connected socket owns a client, so we have to remove the connection from the parent "accept" connection. We also mark the connection as dead, and tell the network side to read from the connection, which then closes it.

Definition at line 2283 of file master.c.

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

◆ fr_io_connection_alloc()

static fr_io_connection_t * fr_io_connection_alloc ( fr_io_instance_t const *  inst,
fr_io_thread_t *  thread,
fr_io_client_t *  client,
int  fd,
fr_io_address_t *  address 
)
static

Create a new connection.

Called ONLY from the master socket.

Definition at line 645 of file master.c.

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

◆ fr_io_connection_allow()

static void fr_io_connection_allow ( fr_io_client_t *  parent,
fr_client_t *  radclient 
)
static

Promote a pending dynamic-client parent and all of its child connections.

When multiple TCP connections from the same source IP arrive while the parent client is still PR_CLIENT_PENDING, only the first connection is added to the scheduler. Later connection are inserted into the parent's hash table, but their fr_schedule_listen_add() call is deferred to this function. When the first connection verification completes successfully, every other connection is finished and scheduled.

This function:

  • Promotes the parent itself to PR_CLIENT_DYNAMIC and re-parents the cs.
  • Walks the parent's hash table of connections. For the first connection (already in the scheduler with connection->nr set), it resumes reads if the connection was paused. For every later connection, (connection->nr == NULL), it copies the verified radclient definition onto the connection and then calls fr_schedule_listen_add() to add the connection to the scheduler.
Parameters
parentthe parent client whose state and child connections to promote
radclientthe verified radclient (typically the calling child's radclient)

Definition at line 2655 of file master.c.

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

◆ fr_io_connection_deny()

static void fr_io_connection_deny ( fr_io_client_t *  parent)
static

Tear down any deferred sibling connections under a pending parent.

This function is Cclled from mod_write() when the first connection dynamic-client verification fails (NAK or hard reject). Any other connections that were inserted into parent->ht are then freed.

Walk parent->ht, find every deferred sibling, remove it from the hash table, close the socket, and frees its module instance (which cascades to the connection itself). The first connection (the one whose verification just failed) is identified by conn->nr != NULL and is left alone, as the caller already owns its cleanup.

Uses a find-one-then-restart loop rather than iterate-while-deleting, since the deferred sibling count is small and the cost is irrelevant on the failure path.

Definition at line 2594 of file master.c.

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

◆ fr_io_listen_free()

int fr_io_listen_free ( fr_listen_t *  li)

Definition at line 3408 of file master.c.

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

◆ fr_io_nak_expire()

static void fr_io_nak_expire ( fr_io_thread_t *  thread,
fr_time_t  now 
)
static

Expire entries in the cache.

Remove old entries from the head of the queue if they have expired, OR if the NAK list is large.

Todo:
  • make the size of the NAK list configurable. For now, a hard-coded limit of 1000 isn't terrible. If there are more NAK IPs than that, the admin should set up firewall rules to block traffic.

Definition at line 475 of file master.c.

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

◆ fr_io_nak_find()

static bool fr_io_nak_find ( fr_io_thread_t *  thread,
fr_ipaddr_t const *  src_ipaddr 
)
static

Look up a negative cache entry.

Entries are expired first, and then looked up.

Parameters
[in]threadthread instance
[in]src_ipaddrto look up.
Returns
  • true if the address is NAK'd, and the caller must refuse it.
  • false if it is not NAK'd, or if the entry has expired.

Definition at line 557 of file master.c.

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

◆ fr_io_nak_insert()

static void fr_io_nak_insert ( fr_io_thread_t *  thread,
fr_ipaddr_t const *  src_ipaddr,
fr_time_delta_t  lifetime 
)
static

Add a negative cache entry.

The new entry is either added, or it has its expiry updated. Deleting the existing entry would cause problems for the lifetime of the NAK entry.

Parameters
[in]threadthread instance
[in]src_ipaddrto look add
[in]lifetimehow long the entry lives for.

Definition at line 506 of file master.c.

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

◆ fr_io_pending_alloc()

static fr_io_pending_packet_t * fr_io_pending_alloc ( fr_io_connection_t *  connection,
fr_io_client_t *  client,
uint8_t const *  buffer,
size_t  packet_len,
fr_io_track_t *  track,
int  priority 
)
static

Definition at line 1442 of file master.c.

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

◆ fr_io_track_add()

static fr_io_track_t * fr_io_track_add ( fr_listen_t const *  li,
fr_io_client_t *  client,
fr_io_address_t *  address,
uint8_t const *  packet,
size_t  packet_len,
fr_time_t  recv_time,
bool *  is_dup 
)
static

Definition at line 1266 of file master.c.

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

◆ fr_master_io_listen()

int fr_master_io_listen ( fr_io_instance_t *  inst,
fr_schedule_t *  sc,
size_t  default_message_size,
size_t  num_messages 
)

Definition at line 3416 of file master.c.

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

◆ fr_master_io_network()

fr_trie_t * fr_master_io_network ( TALLOC_CTX *  ctx,
int  af,
fr_ipaddr_t *  allow,
fr_ipaddr_t *  deny 
)

Create a trie from arrays of allow / deny IP addresses.

Parameters
ctxthe talloc ctx
afthe address family to allow
allowthe array of IPs / networks to allow. MUST be talloc'd
denythe array of IPs / networks to deny. MAY be NULL, MUST be talloc'd
Returns
  • fr_trie_t on success
  • NULL on error

Definition at line 3258 of file master.c.

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

◆ fr_master_io_track_alloc()

fr_io_track_t * fr_master_io_track_alloc ( fr_listen_t *  li,
fr_client_t *  radclient,
fr_ipaddr_t const *  src_ipaddr,
int  src_port,
fr_ipaddr_t const *  dst_ipaddr,
int  dst_port 
)

Definition at line 3585 of file master.c.

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

◆ get_inst()

static void get_inst ( fr_listen_t *  li,
fr_io_instance_t const **  inst,
fr_io_thread_t **  thread,
fr_io_connection_t **  connection,
fr_listen_t **  child 
)
static

Definition at line 1071 of file master.c.

+ Here is the caller graph for this function:

◆ mod_close()

static int mod_close ( fr_listen_t *  li)
static

Close the socket.

Definition at line 3107 of file master.c.

+ Here is the call graph for this function:

◆ mod_event_list_set()

static void mod_event_list_set ( fr_listen_t *  li,
fr_event_list_t *  el,
void *  nr 
)
static

Set the event list for a new socket.

Parameters
[in]lithe listener
[in]elthe event list
[in]nrcontext from the network side

Definition at line 2244 of file master.c.

+ Here is the call graph for this function:

◆ mod_inject()

static int mod_inject ( fr_listen_t *  li,
uint8_t const *  buffer,
size_t  buffer_len,
fr_time_t  recv_time 
)
static

Inject a packet to a connection.

Always called in the context of the network.

Definition at line 2150 of file master.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 3160 of file master.c.

+ Here is the call graph for this function:

◆ mod_name()

static char const * mod_name ( fr_listen_t *  li)
static

Definition at line 3235 of file master.c.

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

◆ mod_open()

static int mod_open ( fr_listen_t *  li)
static

Open a new listener.

Definition at line 2208 of file master.c.

◆ mod_read()

static ssize_t mod_read ( fr_listen_t *  li,
void **  packet_ctx,
fr_time_t *  recv_time_p,
uint8_t *  buffer,
size_t  buffer_len,
size_t *  leftover 
)
static

Implement 99% of the read routines.

The app_io->read does the transport-specific data read.

Log that we ignore clients in debug mode, or when it's enabled for a listener

Definition at line 1499 of file master.c.

+ Here is the call graph for this function:

◆ mod_write()

static ssize_t mod_write ( fr_listen_t *  li,
void *  packet_ctx,
fr_time_t  request_time,
uint8_t *  buffer,
size_t  buffer_len,
size_t  written 
)
static

Definition at line 2741 of file master.c.

+ Here is the call graph for this function:

◆ packet_expiry_timer()

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

Definition at line 2481 of file master.c.

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

◆ pending_client_cmp()

static fr_cmp_ret_t pending_client_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 260 of file master.c.

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

◆ pending_free()

static int pending_free ( fr_io_pending_packet_t *  pending)
static

Definition at line 1418 of file master.c.

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

◆ pending_packet_cmp()

static fr_cmp_ret_t pending_packet_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 230 of file master.c.

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

◆ pending_packet_pop()

static fr_io_pending_packet_t * pending_packet_pop ( fr_io_thread_t *  thread)
static

Definition at line 373 of file master.c.

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

◆ radclient_alloc()

static fr_client_t * radclient_alloc ( TALLOC_CTX *  ctx,
int  ipproto,
fr_io_address_t *  address 
)
static

Definition at line 1091 of file master.c.

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

◆ radclient_clone()

static fr_client_t * radclient_clone ( TALLOC_CTX *  ctx,
fr_client_t const *  parent 
)
static

Definition at line 411 of file master.c.

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

◆ track_cmp()

static fr_cmp_ret_t track_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 317 of file master.c.

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

◆ track_connected_cmp()

static fr_cmp_ret_t track_connected_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 347 of file master.c.

+ Here is the caller graph for this function:

◆ track_dedup_free()

static int track_dedup_free ( fr_io_track_t *  track)
static

Definition at line 201 of file master.c.

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

◆ track_free()

static int track_free ( fr_io_track_t *  track)
static

Definition at line 190 of file master.c.

+ Here is the caller graph for this function:

◆ update_client()

static void update_client ( fr_io_client_t *  client,
fr_client_t *  radclient 
)
static

Definition at line 2546 of file master.c.

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

Variable Documentation

◆ fr_master_app_io

fr_app_io_t fr_master_app_io
Initial value:
= {
.common = {
.name = "radius_master_io",
.instantiate = mod_instantiate,
},
.default_message_size = 4096,
.track_duplicates = true,
.read = mod_read,
.write = mod_write,
.inject = mod_inject,
.open = mod_open,
.close = mod_close,
.event_list_set = mod_event_list_set,
.get_name = mod_name,
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition dl_module.h:63
static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time_p, uint8_t *buffer, size_t buffer_len, size_t *leftover)
Implement 99% of the read routines.
Definition master.c:1499
static void mod_event_list_set(fr_listen_t *li, fr_event_list_t *el, void *nr)
Set the event list for a new socket.
Definition master.c:2244
static int mod_open(fr_listen_t *li)
Open a new listener.
Definition master.c:2208
static ssize_t mod_write(fr_listen_t *li, void *packet_ctx, fr_time_t request_time, uint8_t *buffer, size_t buffer_len, size_t written)
Definition master.c:2741
static char const * mod_name(fr_listen_t *li)
Definition master.c:3235
static int mod_close(fr_listen_t *li)
Close the socket.
Definition master.c:3107
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition master.c:3160
static int mod_inject(fr_listen_t *li, uint8_t const *buffer, size_t buffer_len, fr_time_t recv_time)
Inject a packet to a connection.
Definition master.c:2150

Definition at line 3628 of file master.c.

◆ pause_read

fr_event_update_t pause_read[]
static
Initial value:
= {
{ 0 }
}
#define FR_EVENT_SUSPEND(_s, _f)
Temporarily remove the filter for a func from kevent.
Definition event.h:115
Callbacks for the FR_EVENT_FILTER_IO filter.
Definition event.h:188

Definition at line 180 of file master.c.

◆ resume_read

fr_event_update_t resume_read[]
static
Initial value:
= {
{ 0 }
}
#define FR_EVENT_RESUME(_s, _f)
Re-add the filter for a func from kevent.
Definition event.h:131

Definition at line 185 of file master.c.