The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
Functions | Variables
listen.c File Reference

Listener ids. More...

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

Go to the source code of this file.

Functions

static int _listen_free (fr_listen_t *listen)
 Take a listener out of the table, as it is being freed.
 
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.
 
static void listen_by_id_init (void)
 
static fr_cmp_ret_t listen_id_cmp (void const *one, void const *two)
 

Variables

static fr_rb_tree_t listen_by_id
 
static pthread_once_t listen_by_id_once = PTHREAD_ONCE_INIT
 
static uint32_t listen_next_id = 1
 

Detailed Description

Listener ids.

Id
ec6b4205d319c3b7557436c0c96477806c617a69

Definition in file listen.c.

Function Documentation

◆ _listen_free()

static int _listen_free ( fr_listen_t *  listen)
static

Take a listener out of the table, as it is being freed.

The id itself is not reused: the counter only goes up.

Definition at line 60 of file listen.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_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:

◆ listen_by_id_init()

static void listen_by_id_init ( void  )
static

Definition at line 51 of file listen.c.

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

◆ listen_id_cmp()

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

Definition at line 44 of file listen.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ listen_by_id

fr_rb_tree_t listen_by_id
static

Definition at line 40 of file listen.c.

◆ listen_by_id_once

pthread_once_t listen_by_id_once = PTHREAD_ONCE_INIT
static

Definition at line 41 of file listen.c.

◆ listen_next_id

uint32_t listen_next_id = 1
static

Definition at line 42 of file listen.c.