freeradius-server  3.0.23
About: FreeRADIUS Server Project - a high performance and highly configurable RADIUS server.
  Fossies Dox: freeradius-server-3.0.23.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

realms.c File Reference
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/realms.h>
#include <freeradius-devel/rad_assert.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
+ Include dependency graph for realms.c:

Go to the source code of this file.

Data Structures

struct  realm_config
 

Functions

static int realm_name_cmp (void const *one, void const *two)
 
static void home_server_free (void *data)
 
static int home_server_name_cmp (void const *one, void const *two)
 
static int home_server_addr_cmp (void const *one, void const *two)
 
static int home_server_number_cmp (void const *one, void const *two)
 
static int home_pool_name_cmp (void const *one, void const *two)
 
static size_t xlat_cs (CONF_SECTION *cs, char const *fmt, char *out, size_t outlen)
 
static ssize_t xlat_home_server (UNUSED void *instance, REQUEST *request, char const *fmt, char *out, size_t outlen)
 
static ssize_t xlat_server_pool (UNUSED void *instance, REQUEST *request, char const *fmt, char *out, size_t outlen)
 
static ssize_t xlat_home_server_dynamic (UNUSED void *instance, REQUEST *request, char const *fmt, char *out, size_t outlen)
 
void realms_free (void)
 
static void null_free (UNUSED void *data)
 
void realm_home_server_sanitize (home_server_t *home, CONF_SECTION *cs)
 
static bool home_server_insert (home_server_t *home, CONF_SECTION *cs)
 Insert a new home server into the various internal lookup trees. More...
 
bool realm_home_server_add (home_server_t *home)
 Add an already allocate home_server_t to the various trees. More...
 
home_server_thome_server_afrom_cs (TALLOC_CTX *ctx, realm_config_t *rc, CONF_SECTION *cs)
 Alloc a new home server defined by a CONF_SECTION. More...
 
CONF_SECTIONhome_server_cs_afrom_client (CONF_SECTION *client)
 Fixup a client configuration section to specify a home server. More...
 
static home_pool_tserver_pool_alloc (char const *name, home_pool_type_t type, home_type_t server_type, int num_home_servers)
 
static int pool_check_home_server (UNUSED realm_config_t *rc, CONF_PAIR *cp, char const *name, home_type_t server_type, home_server_t **phome)
 
void realm_pool_free (home_pool_t *pool)
 
int realm_pool_add (home_pool_t *pool, UNUSED CONF_SECTION *cs)
 
static int server_pool_add (realm_config_t *rc, CONF_SECTION *cs, home_type_t server_type, bool do_print)
 
static int old_server_add (realm_config_t *rc, CONF_SECTION *cs, char const *realm, char const *name, char const *secret, home_pool_type_t ldflag, home_pool_t **pool_p, home_type_t type, char const *server)
 
static int old_realm_config (realm_config_t *rc, CONF_SECTION *cs, REALM *r)
 
static int add_pool_to_realm (realm_config_t *rc, CONF_SECTION *cs, char const *name, home_pool_t **dest, home_type_t server_type, bool do_print)
 
static int realm_add (realm_config_t *rc, CONF_SECTION *cs)
 
int realm_realm_add (REALM *r, UNUSED CONF_SECTION *cs)
 
static int pool_peek_type (CONF_SECTION *config, CONF_SECTION *cs)
 
int realms_init (CONF_SECTION *config)
 
REALMrealm_find2 (char const *name)
 
REALMrealm_find (char const *name)
 
void home_server_update_request (home_server_t *home, REQUEST *request)
 
home_server_thome_server_ldb (char const *realmname, home_pool_t *pool, REQUEST *request)
 
home_server_thome_server_find (fr_ipaddr_t *ipaddr, uint16_t port, int proto)
 
home_server_thome_server_find_bysrc (fr_ipaddr_t *ipaddr, uint16_t port, int proto, fr_ipaddr_t *src_ipaddr)
 
home_server_thome_server_byname (char const *name, int type)
 
home_server_thome_server_bynumber (int number)
 
home_pool_thome_pool_byname (char const *name, int type)
 
int home_server_afrom_file (char const *filename)
 
int home_server_delete (char const *name, char const *type_name)
 

Variables

static rbtree_trealms_byname = NULL
 
bool home_servers_udp = false
 Whether there are any UDP home servers. More...
 
static const FR_NAME_NUMBER home_server_types []
 
static const FR_NAME_NUMBER home_ping_check []
 
static const FR_NAME_NUMBER home_proto []
 
static realm_config_trealm_config = NULL
 
static rbtree_thome_servers_byaddr = NULL
 
static rbtree_thome_servers_byname = NULL
 
static int home_server_max_number = 0
 
static rbtree_thome_servers_bynumber = NULL
 
static rbtree_thome_pools_byname = NULL
 
static const CONF_PARSER proxy_config []
 
static CONF_PARSER limit_config []
 
static CONF_PARSER home_server_coa []
 
static CONF_PARSER home_server_config []
 

Data Structure Documentation

◆ realm_config

struct realm_config

Definition at line 58 of file realms.c.

+ Collaboration diagram for realm_config:
Data Fields
CONF_SECTION * cs
uint32_t dead_time
bool dynamic
bool fallback
uint32_t retry_count
uint32_t retry_delay
bool wake_all_if_all_dead

Function Documentation

◆ add_pool_to_realm()

static int add_pool_to_realm ( realm_config_t rc,
CONF_SECTION cs,
char const *  name,
home_pool_t **  dest,
home_type_t  server_type,
bool  do_print 
)
static

Definition at line 1851 of file realms.c.

References cf_log_err_cs(), cf_section_sub_find_name2(), realm_config::cs, ERROR, home_pools_byname, home_pool_t::name, rbtree_finddata(), server_pool_add(), and home_pool_t::server_type.

Referenced by realm_add().

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

◆ home_pool_byname()

home_pool_t* home_pool_byname ( char const *  name,
int  type 
)

Definition at line 2929 of file realms.c.

References home_pools_byname, home_pool_t::name, rbtree_finddata(), home_pool_t::server_type, and type.

Referenced by client_afrom_cs(), do_proxy(), request_coa_originate(), and request_will_proxy().

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

◆ home_pool_name_cmp()

static int home_pool_name_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 194 of file realms.c.

References home_pool_t::name, home_pool_t::server_type, and strcasecmp().

Referenced by realms_init().

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

◆ home_server_addr_cmp()

static int home_server_addr_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 156 of file realms.c.

References fr_ipaddr_cmp(), home_server::ipaddr, home_server::port, home_server::proto, home_server::server, home_server::src_ipaddr, and home_server::type.

Referenced by realms_init().

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

◆ home_server_afrom_cs()

home_server_t* home_server_afrom_cs ( TALLOC_CTX *  ctx,
realm_config_t rc,
CONF_SECTION cs 
)

Alloc a new home server defined by a CONF_SECTION.

Parameters
ctxto allocate home_server_t in.
rcRealm config, may be NULL in which case the global realm_config will be used.
csConfiguration section containing home server parameters.
Returns
a new home_server_t alloced in the context of the realm_config, or NULL on error.

Definition at line 699 of file realms.c.

References fr_ipaddr_t::af, cf_log_err_cs(), cf_pair_find(), cf_section_name2(), cf_section_parse(), cf_section_sub_find(), cf_section_sub_find_name2(), home_server::cs, realm_config::cs, home_server::dual, fr_inaddr_any(), fr_ntop(), fr_str2int(), home_ping_check, HOME_PING_CHECK_INVALID, HOME_PING_CHECK_NONE, HOME_PING_CHECK_REQUEST, HOME_PING_CHECK_STATUS_SERVER, home_proto, home_server_config, home_server_types, home_servers_byaddr, home_servers_udp, HOME_STATE_UNKNOWN, HOME_TYPE_ACCT, HOME_TYPE_AUTH, HOME_TYPE_AUTH_ACCT, HOME_TYPE_COA, HOME_TYPE_INVALID, ip_hton(), home_server::ipaddr, home_server::log_name, home_server::name, home_server::ping_check, home_server::ping_check_str, home_server::ping_user_name, home_server::ping_user_password, home_server::port, home_server::proto, proto, home_server::proto_str, PW_ACCT_UDP_PORT, PW_AUTH_UDP_PORT, PW_COA_UDP_PORT, PW_RADIUS_TLS_PORT, rad_assert, rad_const_free(), rbtree_finddata(), realm_config, realm_home_server_sanitize(), home_server::secret, home_server::server, home_server::src_ipaddr, home_server::src_ipaddr_str, home_server::state, talloc_typed_strdup(), home_server::type, type, and home_server::type_str.

Referenced by client_afrom_cs(), home_server_afrom_file(), and realms_init().

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

◆ home_server_afrom_file()

int home_server_afrom_file ( char const *  filename)

Definition at line 2939 of file realms.c.

References cf_file_read(), cf_section_alloc(), cf_section_sub_find_name2(), home_server::dual, home_server::dynamic, realm_config::dynamic, fr_strerror_printf(), home_server_afrom_cs(), realm_home_server_add(), and home_server::server.

Referenced by command_add_home_server_file(), and realms_init().

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

◆ home_server_byname()

home_server_t* home_server_byname ( char const *  name,
int  type 
)

Definition at line 2904 of file realms.c.

References home_servers_byname, home_server::name, rbtree_finddata(), home_server::type, and type.

Referenced by client_afrom_cs(), home_server_delete(), request_will_proxy(), and xlat_home_server_dynamic().

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

◆ home_server_bynumber()

home_server_t* home_server_bynumber ( int  number)

Definition at line 2917 of file realms.c.

References home_servers_bynumber, home_server::number, rbtree_finddata(), and home_server::server.

Referenced by command_show_home_servers().

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

◆ home_server_cs_afrom_client()

CONF_SECTION* home_server_cs_afrom_client ( CONF_SECTION client)

Fixup a client configuration section to specify a home server.

This is used to create the equivalent CoA home server entry for a client, so that the server can originate CoA messages.

The server section automatically inherits the following fields from the client:

  • ipaddr/ipv4addr/ipv6addr
  • secret
  • src_ipaddr
Note
new CONF_SECTION will be allocated in the context of the client, but the client CONF_SECTION will not be modified.
Parameters
clientCONF_SECTION to inherit values from.
Returns
a new server CONF_SCTION, or a pointer to the existing CONF_SECTION in the client.

Definition at line 1027 of file realms.c.

References cf_log_err_cs(), cf_pair_add(), cf_pair_alloc(), cf_pair_dup(), cf_pair_find(), cf_pair_value(), cf_section_alloc(), cf_section_dup(), cf_section_name2(), cf_section_sub_find(), T_BARE_WORD, T_OP_EQ, and T_SINGLE_QUOTED_STRING.

Referenced by client_afrom_cs().

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

◆ home_server_delete()

int home_server_delete ( char const *  name,
char const *  type_name 
)

Definition at line 2999 of file realms.c.

References home_server::dynamic, realm_config::dynamic, fr_str2int(), fr_strerror_printf(), home_server_byname(), home_server_types, home_servers_byaddr, home_servers_byname, home_servers_bynumber, HOME_TYPE_INVALID, rbtree_deletebydata(), and type.

Referenced by command_del_home_server().

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

◆ home_server_find()

home_server_t* home_server_find ( fr_ipaddr_t ipaddr,
uint16_t  port,
int  proto 
)

Definition at line 2857 of file realms.c.

References fr_ipaddr_t::af, home_servers_byaddr, home_server::ipaddr, home_server::port, home_server::proto, proto, rbtree_finddata(), home_server::server, and home_server::src_ipaddr.

Referenced by common_socket_parse(), home_server_find_bysrc(), request_coa_originate(), request_stats_reply(), and request_will_proxy().

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

◆ home_server_find_bysrc()

home_server_t* home_server_find_bysrc ( fr_ipaddr_t ipaddr,
uint16_t  port,
int  proto,
fr_ipaddr_t src_ipaddr 
)

Definition at line 2879 of file realms.c.

References fr_ipaddr_t::af, home_server_find(), home_servers_byaddr, home_server::ipaddr, home_server::port, home_server::proto, proto, rbtree_finddata(), home_server::server, and home_server::src_ipaddr.

Referenced by get_home_server().

+ 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 138 of file realms.c.

References data.

Referenced by realms_init().

+ Here is the caller graph for this function:

◆ home_server_insert()

static bool home_server_insert ( home_server_t home,
CONF_SECTION cs 
)
static

Insert a new home server into the various internal lookup trees.

Parameters
homeserver to add.
csThat defined the home server.
Returns
true on success else false.

Definition at line 584 of file realms.c.

References fr_ipaddr_t::af, cf_log_err_cs(), home_server_max_number, home_servers_byaddr, home_servers_byname, home_servers_bynumber, home_server::ipaddr, home_server::log_name, home_server::name, home_server::number, rbtree_deletebydata(), rbtree_insert(), and home_server::server.

Referenced by realm_home_server_add().

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

◆ home_server_ldb()

home_server_t* home_server_ldb ( char const *  realmname,
home_pool_t pool,
REQUEST request 
)

Definition at line 2548 of file realms.c.

References _realm::acct_pool, fr_ipaddr_t::af, _realm::auth_pool, radius_packet::code, rad_request::config, home_pool_t::cs, home_server::currently_outstanding, exec_trigger(), home_pool_t::fallback, realm_config::fallback, fr_hash(), fr_hash_update(), fr_ipaddr_cmp(), fr_pair_find_by_num(), fr_rand(), hash(), HOME_PING_CHECK_NONE, HOME_POOL_CLIENT_BALANCE, HOME_POOL_CLIENT_PORT_BALANCE, HOME_POOL_FAIL_OVER, HOME_POOL_KEYED_BALANCE, HOME_POOL_LOAD_BALANCE, home_server_ldb(), HOME_STATE_ALIVE, HOME_STATE_IS_DEAD, HOME_STATE_ZOMBIE, home_pool_t::in_fallback, fr_ipaddr_t::ipaddr, home_server::ipaddr, rad_request::listener, home_server::log_name, home_server::max_outstanding, home_pool_t::name, _realm::name, home_pool_t::num_home_servers, rad_request::packet, home_server::parent_server, home_server::ping_check, PW_CODE_ACCESS_REQUEST, PW_CODE_ACCOUNTING_REQUEST, RAD_LISTEN_DETAIL, RDEBUG2, RDEBUG3, realm_find(), request, home_server::response_timeouts, rad_request::server, home_server::server, home_pool_t::servers, radius_packet::src_ipaddr, radius_packet::src_port, home_server::state, TAG_ANY, home_pool_t::time_all_dead, rad_request::timestamp, rad_listen::type, home_pool_t::type, realm_config::wake_all_if_all_dead, and WARN.

Referenced by home_server_ldb(), replicate_packet(), request_coa_originate(), request_proxy_anew(), request_running(), and request_will_proxy().

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

◆ home_server_name_cmp()

static int home_server_name_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 145 of file realms.c.

References home_server::name, strcasecmp(), and home_server::type.

Referenced by realms_init().

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

◆ home_server_number_cmp()

static int home_server_number_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 185 of file realms.c.

References home_server::number.

Referenced by realms_init().

+ Here is the caller graph for this function:

◆ home_server_update_request()

void home_server_update_request ( home_server_t home,
REQUEST request 
)

Definition at line 2481 of file realms.c.

References radius_packet::code, radius_packet::dst_ipaddr, radius_packet::dst_port, ERROR, fr_exit, fr_pair_find_by_num(), fr_pair_list_copy(), fr_pair_make(), rad_request::home_server, home_server::ipaddr, rad_request::packet, home_server::port, radius_packet::proto, home_server::proto, rad_request::proxy, PW_CODE_ACCESS_REQUEST, rad_alloc(), request, radius_packet::src_ipaddr, home_server::src_ipaddr, radius_packet::src_port, T_OP_SET, TAG_ANY, and radius_packet::vps.

Referenced by request_coa_originate(), request_proxy_anew(), request_running(), and request_will_proxy().

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

◆ null_free()

static void null_free ( UNUSED void *  data)
static

Definition at line 491 of file realms.c.

Referenced by realm_home_server_add().

+ Here is the caller graph for this function:

◆ old_realm_config()

static int old_realm_config ( realm_config_t rc,
CONF_SECTION cs,
REALM r 
)
static

Definition at line 1720 of file realms.c.

References _realm::acct_pool, _realm::auth_pool, cf_log_err_cp(), cf_log_err_cs(), cf_log_info(), cf_pair_find(), cf_pair_value(), HOME_POOL_FAIL_OVER, HOME_POOL_LOAD_BALANCE, HOME_TYPE_ACCT, HOME_TYPE_AUTH, _realm::name, old_server_add(), rad_debug_lvl, secret, and strcasecmp().

Referenced by realm_add().

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

◆ old_server_add()

static int old_server_add ( realm_config_t rc,
CONF_SECTION cs,
char const *  realm,
char const *  name,
char const *  secret,
home_pool_type_t  ldflag,
home_pool_t **  pool_p,
home_type_t  type,
char const *  server 
)
static

◆ pool_check_home_server()

static int pool_check_home_server ( UNUSED realm_config_t rc,
CONF_PAIR cp,
char const *  name,
home_type_t  server_type,
home_server_t **  phome 
)
static

Definition at line 1105 of file realms.c.

References cf_log_err_cp(), home_servers_byname, HOME_TYPE_ACCT, HOME_TYPE_AUTH, HOME_TYPE_AUTH_ACCT, home_server::name, rbtree_finddata(), and home_server::type.

Referenced by server_pool_add().

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

◆ pool_peek_type()

static int pool_peek_type ( CONF_SECTION config,
CONF_SECTION cs 
)
static

Definition at line 2160 of file realms.c.

References cf_log_err_cp(), cf_log_err_cs(), cf_pair_find(), cf_pair_value(), cf_section_sub_find_name2(), fr_str2int(), home_server_types, HOME_TYPE_INVALID, and type.

Referenced by realms_init().

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

◆ realm_add()

static int realm_add ( realm_config_t rc,
CONF_SECTION cs 
)
static

Definition at line 1900 of file realms.c.

References _realm::acct_pool, add_pool_to_realm(), _realm::auth_pool, cf_log_err_cs(), cf_log_info(), cf_pair_attr(), cf_pair_find(), cf_pair_value(), cf_section_name1(), cf_section_name2(), _realm::coa_pool, HOME_TYPE_ACCT, HOME_TYPE_AUTH, HOME_TYPE_COA, _realm::name, old_realm_config(), realm_find2(), realm_realm_add(), strcasecmp(), _realm::strip_realm, and WARN.

Referenced by realms_init().

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

◆ realm_find()

REALM* realm_find ( char const *  name)

Definition at line 2431 of file realms.c.

References ERROR, fr_strerror(), _realm::name, rbtree_finddata(), and realms_byname.

Referenced by CC_HINT(), check_for_realm(), eap_start(), home_server_ldb(), and mod_realm_recv_coa().

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

◆ realm_find2()

REALM* realm_find2 ( char const *  name)

Definition at line 2397 of file realms.c.

References _realm::name, rbtree_finddata(), and realms_byname.

Referenced by rad_accounting(), rad_authenticate(), realm_add(), replicate_packet(), request_running(), and request_will_proxy().

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

◆ realm_home_server_add()

bool realm_home_server_add ( home_server_t home)

Add an already allocate home_server_t to the various trees.

Parameters
homeserver to add.
Returns
true on success, else false on error.

Definition at line 617 of file realms.c.

References fr_ipaddr_t::af, cf_data_add(), cf_log_err_cs(), home_server::cs, home_server::dual, realm_config::dynamic, ERROR, event_loop_started, fr_int2str(), home_proto, home_server_insert(), home_servers_byaddr, home_servers_byname, HOME_TYPE_ACCT, inet_ntop(), fr_ipaddr_t::ipaddr, home_server::ipaddr, home_server::name, null_free(), home_server::parent_server, home_server::ping_user_password, home_server::port, home_server::proto, rbtree_finddata(), home_server::server, and home_server::type.

Referenced by client_add(), home_server_afrom_file(), and realms_init().

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

◆ realm_home_server_sanitize()

◆ realm_name_cmp()

static int realm_name_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 128 of file realms.c.

References _realm::name, and strcasecmp().

Referenced by realms_init().

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

◆ realm_pool_add()

int realm_pool_add ( home_pool_t pool,
UNUSED CONF_SECTION cs 
)

Definition at line 1247 of file realms.c.

References DEBUG, realm_config::dynamic, event_loop_started, home_pools_byname, rad_assert, and rbtree_insert().

Referenced by server_pool_add().

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

◆ realm_pool_free()

void realm_pool_free ( home_pool_t pool)

Definition at line 1146 of file realms.c.

References realm_config::dynamic, and event_loop_started.

Referenced by realms_free().

+ Here is the caller graph for this function:

◆ realm_realm_add()

int realm_realm_add ( REALM r,
UNUSED CONF_SECTION cs 
)

Definition at line 2096 of file realms.c.

References cf_log_err_cs(), DEBUG, realm_config::dynamic, event_loop_started, fr_canonicalize_error(), fr_strerror(), _realm::name, rad_assert, rbtree_insert(), realms_byname, and spaces.

Referenced by realm_add().

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

◆ realms_free()

void realms_free ( void  )

Definition at line 391 of file realms.c.

References home_pools_byname, home_servers_byaddr, home_servers_byname, home_servers_bynumber, rbtree_free(), realm_pool_free(), and realms_byname.

Referenced by main_config_free(), and realms_init().

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

◆ realms_init()

◆ server_pool_add()

static int server_pool_add ( realm_config_t rc,
CONF_SECTION cs,
home_type_t  server_type,
bool  do_print 
)
static

◆ server_pool_alloc()

static home_pool_t* server_pool_alloc ( char const *  name,
home_pool_type_t  type,
home_type_t  server_type,
int  num_home_servers 
)
static

Definition at line 1082 of file realms.c.

References home_pool_t::name, home_pool_t::num_home_servers, rad_malloc(), home_pool_t::server_type, home_pool_t::servers, home_pool_t::type, and type.

Referenced by old_server_add(), and server_pool_add().

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

◆ xlat_cs()

static size_t xlat_cs ( CONF_SECTION cs,
char const *  fmt,
char *  out,
size_t  outlen 
)
static

Definition at line 206 of file realms.c.

References cf_pair_find(), cf_pair_value(), cf_section_name2(), DEBUG, fmt, and strlcpy().

Referenced by xlat_home_server(), and xlat_server_pool().

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

◆ xlat_home_server()

static ssize_t xlat_home_server ( UNUSED void *  instance,
REQUEST request,
char const *  fmt,
char *  out,
size_t  outlen 
)
static

Definition at line 245 of file realms.c.

References home_server::cs, fmt, rad_request::home_server, HOME_STATE_ADMIN_DOWN, HOME_STATE_ALIVE, HOME_STATE_CONNECTION_FAIL, HOME_STATE_IS_DEAD, HOME_STATE_ZOMBIE, request, RWDEBUG, home_server::state, strlcpy(), and xlat_cs().

Referenced by realms_init().

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

◆ xlat_home_server_dynamic()

static ssize_t xlat_home_server_dynamic ( UNUSED void *  instance,
REQUEST request,
char const *  fmt,
char *  out,
size_t  outlen 
)
static

Definition at line 340 of file realms.c.

References radius_packet::code, home_server::dynamic, fmt, home_server_byname(), HOME_TYPE_ACCT, HOME_TYPE_AUTH, HOME_TYPE_COA, rad_request::packet, PW_CODE_ACCESS_REQUEST, PW_CODE_ACCOUNTING_REQUEST, PW_CODE_COA_REQUEST, PW_CODE_DISCONNECT_REQUEST, request, and type.

Referenced by realms_init().

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

◆ xlat_server_pool()

static ssize_t xlat_server_pool ( UNUSED void *  instance,
REQUEST request,
char const *  fmt,
char *  out,
size_t  outlen 
)
static

Definition at line 302 of file realms.c.

References home_pool_t::cs, fmt, rad_request::home_pool, home_pool_t::in_fallback, request, RWDEBUG, strlcpy(), and xlat_cs().

Referenced by realms_init().

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

Variable Documentation

◆ home_ping_check

const FR_NAME_NUMBER home_ping_check[]
static
Initial value:
= {
{ "none", HOME_PING_CHECK_NONE },
{ "status-server", HOME_PING_CHECK_STATUS_SERVER },
{ "request", HOME_PING_CHECK_REQUEST },
{ NULL, 0 }
}
@ HOME_PING_CHECK_REQUEST
Definition: realms.h:35
@ HOME_PING_CHECK_NONE
Definition: realms.h:33
@ HOME_PING_CHECK_STATUS_SERVER
Definition: realms.h:34

Definition at line 79 of file realms.c.

Referenced by home_server_afrom_cs().

◆ home_pools_byname

rbtree_t* home_pools_byname = NULL
static

◆ home_proto

const FR_NAME_NUMBER home_proto[]
static
Initial value:
= {
{ "UDP", IPPROTO_UDP },
{ "TCP", IPPROTO_TCP },
{ NULL, 0 }
}

Definition at line 86 of file realms.c.

Referenced by home_server_afrom_cs(), and realm_home_server_add().

◆ home_server_coa

CONF_PARSER home_server_coa[]
static
Initial value:
= {
}
#define STRINGIFY(x)
Definition: build.h:19
#define CONF_PARSER_TERMINATOR
Definition: conffile.h:217
#define FR_CONF_OFFSET(_t, _s, _f)
Definition: conffile.h:106
@ PW_TYPE_INTEGER
32 Bit unsigned integer.
Definition: radius.h:14

Definition at line 429 of file realms.c.

◆ home_server_config

CONF_PARSER home_server_config[]
static

Definition at line 438 of file realms.c.

Referenced by home_server_afrom_cs().

◆ home_server_max_number

int home_server_max_number = 0
static

Definition at line 99 of file realms.c.

Referenced by home_server_insert(), and old_server_add().

◆ home_server_types

const FR_NAME_NUMBER home_server_types[]
static
Initial value:
= {
{ "auth", HOME_TYPE_AUTH },
{ "acct", HOME_TYPE_ACCT },
{ "auth+acct", HOME_TYPE_AUTH_ACCT },
{ "coa", HOME_TYPE_COA },
{ NULL, 0 }
}
@ HOME_TYPE_AUTH_ACCT
Authentication and accounting server.
Definition: realms.h:24
@ HOME_TYPE_AUTH
Authentication server.
Definition: realms.h:22
@ HOME_TYPE_ACCT
Accounting server.
Definition: realms.h:23
@ HOME_TYPE_COA
CoA destination (NAS or Proxy)
Definition: realms.h:27

Definition at line 71 of file realms.c.

Referenced by home_server_afrom_cs(), home_server_delete(), and pool_peek_type().

◆ home_servers_byaddr

◆ home_servers_byname

◆ home_servers_bynumber

rbtree_t* home_servers_bynumber = NULL
static

◆ home_servers_udp

bool home_servers_udp = false

Whether there are any UDP home servers.

Definition at line 37 of file realms.c.

Referenced by check_proxy(), and home_server_afrom_cs().

◆ limit_config

CONF_PARSER limit_config[]
static
Initial value:
= {
{ "max_connections", FR_CONF_OFFSET(PW_TYPE_INTEGER, home_server_t, limit.max_connections), "16" },
{ "max_requests", FR_CONF_OFFSET(PW_TYPE_INTEGER, home_server_t, limit.max_requests), "0" },
{ "lifetime", FR_CONF_OFFSET(PW_TYPE_INTEGER, home_server_t, limit.lifetime), "0" },
{ "idle_timeout", FR_CONF_OFFSET(PW_TYPE_INTEGER, home_server_t, limit.idle_timeout), "0" },
}

Definition at line 420 of file realms.c.

◆ proxy_config

const CONF_PARSER proxy_config[]
static
Initial value:
= {
{ "retry_delay", FR_CONF_OFFSET(PW_TYPE_INTEGER, realm_config_t, retry_delay), STRINGIFY(RETRY_DELAY) },
{ "retry_count", FR_CONF_OFFSET(PW_TYPE_INTEGER, realm_config_t, retry_count), STRINGIFY(RETRY_COUNT) },
{ "default_fallback", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, realm_config_t, fallback), "no" },
{ "dynamic", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, realm_config_t, dynamic), NULL },
{ "wake_all_if_all_dead", FR_CONF_OFFSET(PW_TYPE_BOOLEAN, realm_config_t, wake_all_if_all_dead), "no" },
}
@ PW_TYPE_BOOLEAN
A truth value.
Definition: radius.h:35
#define RETRY_COUNT
Definition: radiusd.h:327
#define RETRY_DELAY
Definition: radiusd.h:326
#define DEAD_TIME
Definition: radiusd.h:328

Definition at line 108 of file realms.c.

Referenced by realms_init().

◆ realm_config

realm_config_t* realm_config = NULL
static

Definition at line 93 of file realms.c.

Referenced by home_server_afrom_cs().

◆ realms_byname

rbtree_t* realms_byname = NULL
static

Definition at line 35 of file realms.c.

Referenced by realm_find(), realm_find2(), realm_realm_add(), realms_free(), and realms_init().