The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
listen.h File Reference
#include <freeradius-devel/io/base.h>
#include <freeradius-devel/io/application.h>
#include <freeradius-devel/server/time_tracking.h>
+ Include dependency graph for listen.h:

Go to the source code of this file.

Data Structures

struct  fr_async_s
 Minimal data structure to use the new code. More...
 
struct  fr_listen_instance_s
 
struct  fr_listen_s
 

Typedefs

typedef struct fr_listen_instance_s fr_listen_instance_t
 One open socket of a listener.
 
typedef struct fr_listen_s fr_listen_t
 A listener, as configured.
 

Functions

int fr_io_listen_free (fr_listen_instance_t *li)
 Free a socket's thread instance along with it.
 
fr_listen_t * fr_listen_alloc (TALLOC_CTX *ctx, CONF_SECTION *listen_cs, CONF_SECTION *server_cs, fr_app_t const *app, void const *app_instance, fr_app_io_t const *app_io, void const *app_io_instance)
 Allocate a listener, and give it its id.
 
fr_listen_t * fr_listen_by_id (uint32_t id)
 Find a listener by its id.
 
fr_listen_instance_t * fr_listen_instance_alloc (TALLOC_CTX *ctx, fr_listen_t *listen)
 Allocate a socket of a listener.
 

Data Structure Documentation

◆ fr_async_s

struct fr_async_s

Minimal data structure to use the new code.

Definition at line 79 of file listen.h.

+ Collaboration diagram for fr_async_s:
Data Fields
fr_channel_t * channel
fr_event_list_t * el
fr_dlist_t entry in the list of requests associated with this channel
fr_listen_instance_t * inst How we received this request,.

and how we'll send the reply.

void * packet_ctx
fr_time_t recv_time
request_t * request back-pointer to the owning request so anything that pops this async off its dlist can reach the request without walking the talloc parent.
fr_time_tracking_t tracking

◆ fr_listen_instance_s

struct fr_listen_instance_s

Definition at line 62 of file listen.h.

+ Collaboration diagram for fr_listen_instance_s:
Data Fields
fr_socket_t * app_io_addr for tracking duplicate sockets
bool connected is this for a connected socket?
int fd file descriptor for this socket - set by open
fr_listen_t * listen the listener this is a socket of.
char const * name printable name for this socket - set by open
void * thread_instance thread / socket context
fr_rb_node_t virtual_server_node Entry into the virtual server's tree of listeners.

◆ fr_listen_s

struct fr_listen_s

Definition at line 27 of file listen.h.

+ Collaboration diagram for fr_listen_s:
Data Fields
fr_app_t const * app
void const * app_instance
fr_app_io_t const * app_io I/O path functions.
void const * app_io_instance I/O path configuration context.
CONF_SECTION * cs of this listener
size_t default_message_size copied from app_io, but may be changed
fr_dict_t const * dict dictionary for this listener
uint32_t id Unique for the life of the process.
fr_rb_node_t id_node Entry into the table of listeners by id.
bool needs_full_setup Set to true to avoid the short cut when adding the listener.

Added for rlm_detail which requires inst->parent->sc to be populated when event_list_set callback is run which doesn't happen if the short cut is taken.

bool no_write_callback sometimes we don't need to do writes
bool non_socket_listener special internal listener that does not use sockets.
size_t num_messages for the message ring buffer
bool read_hexdump Do we debug hexdump packets as they're read.
CONF_SECTION * server_cs CONF_SECTION of the server.
bool track_duplicates do we track duplicate packets?
bool write_hexdump Do we debug hexdump packets as they're written.

Typedef Documentation

◆ fr_listen_instance_t

One open socket of a listener.

Created for global and connected sockets of the listener.

Definition at line 61 of file listen.h.

◆ fr_listen_t

typedef struct fr_listen_s fr_listen_t

A listener, as configured.

What a listen section produces at startup: the protocol, the virtual server and the I/O path.

Definition at line 26 of file listen.h.

Function Documentation

◆ fr_io_listen_free()

int fr_io_listen_free ( fr_listen_instance_t *  li)

Free a socket's thread instance along with it.

For sockets whose thread instance is not a talloc child of the socket. Set as the destructor by whoever made the socket.

Definition at line 126 of file listen.c.

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

◆ fr_listen_alloc()

fr_listen_t * fr_listen_alloc ( TALLOC_CTX *  ctx,
CONF_SECTION *  listen_cs,
CONF_SECTION *  server_cs,
fr_app_t const *  app,
void const *  app_instance,
fr_app_io_t const *  app_io,
void const *  app_io_instance 
)

Allocate a listener, and give it its id.

Parameters
[in]ctxto allocate the listener in.
[in]listen_csthe listen section it came from.
[in]server_csthe virtual server it is bound to.
[in]appthe application it belongs to, which encodes and decodes.
[in]app_instancethe application's instance data.
[in]app_iothe I/O path, which reads and writes.
[in]app_io_instancethe I/O path's instance data.
Returns
the listener.

Definition at line 78 of file listen.c.

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

◆ fr_listen_by_id()

fr_listen_t * fr_listen_by_id ( uint32_t  id)

Find a listener by its id.

Parameters
[in]idof the listener.
Returns
  • NULL if no listener has that id.
  • the listener otherwise.

Definition at line 141 of file listen.c.

+ Here is the call graph for this function:

◆ fr_listen_instance_alloc()

fr_listen_instance_t * fr_listen_instance_alloc ( TALLOC_CTX *  ctx,
fr_listen_t *  listen 
)

Allocate a socket of a listener.

Parameters
[in]ctxto allocate the socket in.
[in]listenit is a socket of.
Returns
the socket.

Definition at line 111 of file listen.c.

+ Here is the caller graph for this function: