The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
rlm_radius.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17#include <freeradius-devel/io/atomic_queue.h>
18#include <freeradius-devel/server/base.h>
19#include <freeradius-devel/server/map.h>
20#include <freeradius-devel/server/module_rlm.h>
21#include <freeradius-devel/server/trunk.h>
22#include <freeradius-devel/util/dlist.h>
23#include <freeradius-devel/util/retry.h>
24#include <freeradius-devel/unlang/module.h>
25#include <freeradius-devel/radius/radius.h>
26#include <freeradius-devel/radius/bio.h>
27#include <freeradius-devel/radius/tls.h>
28
29#include <freeradius-devel/bio/fd.h>
30
31#ifdef WITH_TLS
32#include <freeradius-devel/tls/base.h>
33#include <freeradius-devel/tls/connection.h>
34#include <freeradius-devel/bio/tls.h>
35#endif
36
37/*
38 * $Id: 821606e31fa2fbec3329b3db598d30c60d82eedd $
39 *
40 * @file rlm_radius.h
41 * @brief Structures for the RADIUS client packets
42 *
43 * @copyright 2017 Alan DeKok (aland@freeradius.org)
44 */
45
47
48typedef enum : uint8_t {
50 RLM_RADIUS_MODE_PROXY, //!< we proxy to one home server
51 RLM_RADIUS_MODE_CLIENT, //!< we are a client to one home server
52 RLM_RADIUS_MODE_REPLICATE, //!< to a particular destination
53 RLM_RADIUS_MODE_UNCONNECTED_REPLICATE, //!< %radius.sendto.ipaddr(), but we don't look for a reply
54 RLM_RADIUS_MODE_XLAT_PROXY, //!< %radius.sendto.ipaddr(), but we do look for a reply.
56
57/*
58 * Define a structure for our module configuration.
59 */
61 fr_bio_fd_config_t fd_config; //!< for now MUST be at the start!
62
63 char const *name;
64
65 fr_time_delta_t response_window; //!< Deprecated. Only used to warn that the item is ignored.
67 uint32_t response_timeouts; //!< Requests in a row which have to time out before the connection is zombie.
69
71
72 char const *secret; //!< Shared secret.
73
74#ifdef WITH_TLS
75 fr_tls_conf_t *tls_conf; //!< Parsed "tls" section. If set, we use RADIUS/TLS, or RADIUS/DTLS for UDP.
76#endif
77
78 uint32_t max_packet_size; //!< Maximum packet size.
79 uint16_t max_send_coalesce; //!< Maximum number of packets to coalesce into one mmsg call.
80
82
83 rlm_radius_mode_t mode; //!< proxy, client, etc.
84
85 uint32_t max_attributes; //!< Maximum number of attributes to decode in response.
86
87 fr_radius_require_ma_t require_message_authenticator; //!< Require Message-Authenticator in responses.
88 bool *received_message_authenticator; //!< Received Message-Authenticator in responses.
89 bool track_load_balance; //!< do we track load-balance state
90
91 uint32_t *types; //!< array of allowed packet types
92 uint32_t status_check; //!< code of status-check type
93 map_list_t status_check_map; //!< attributes for the status-server checks
94 uint32_t num_answers_to_alive; //!< How many status check responses we need to
95 ///< mark the connection as alive.
96
98
100
101 trunk_conf_t trunk_conf; //!< trunk configuration
102
103 fr_pair_list_t *trigger_args; //!< Pairs passed to trigger requests.
104};
@ FR_RADIUS_CODE_MAX
Maximum possible protocol code.
Definition defs.h:53
Configuration for sockets.
Definition fd.h:92
unsigned short uint16_t
unsigned int uint32_t
unsigned char uint8_t
fr_radius_require_ma_t
Control whether Message-Authenticator is required in Access-Requests.
Definition radius.h:61
fr_radius_require_ma_t require_message_authenticator
Require Message-Authenticator in responses.
Definition rlm_radius.h:87
uint32_t num_answers_to_alive
How many status check responses we need to mark the connection as alive.
Definition rlm_radius.h:94
map_list_t status_check_map
attributes for the status-server checks
Definition rlm_radius.h:93
uint16_t max_send_coalesce
Maximum number of packets to coalesce into one mmsg call.
Definition rlm_radius.h:79
fr_time_delta_t revive_interval
Definition rlm_radius.h:68
bool track_load_balance
do we track load-balance state
Definition rlm_radius.h:89
fr_retry_config_t retry[FR_RADIUS_CODE_MAX]
Definition rlm_radius.h:99
char const * name
Definition rlm_radius.h:63
uint32_t status_check
code of status-check type
Definition rlm_radius.h:92
rlm_radius_mode_t mode
proxy, client, etc.
Definition rlm_radius.h:83
bool * received_message_authenticator
Received Message-Authenticator in responses.
Definition rlm_radius.h:88
rlm_radius_mode_t
Definition rlm_radius.h:48
@ RLM_RADIUS_MODE_XLAT_PROXY
radius.sendto.ipaddr(), but we do look for a reply.
Definition rlm_radius.h:54
@ RLM_RADIUS_MODE_INVALID
Definition rlm_radius.h:49
@ RLM_RADIUS_MODE_PROXY
we proxy to one home server
Definition rlm_radius.h:50
@ RLM_RADIUS_MODE_REPLICATE
to a particular destination
Definition rlm_radius.h:52
@ RLM_RADIUS_MODE_UNCONNECTED_REPLICATE
radius.sendto.ipaddr(), but we don't look for a reply
Definition rlm_radius.h:53
@ RLM_RADIUS_MODE_CLIENT
we are a client to one home server
Definition rlm_radius.h:51
uint32_t max_packet_size
Maximum packet size.
Definition rlm_radius.h:78
uint32_t * types
array of allowed packet types
Definition rlm_radius.h:91
char const * secret
Shared secret.
Definition rlm_radius.h:72
fr_time_delta_t response_window
Deprecated. Only used to warn that the item is ignored.
Definition rlm_radius.h:65
uint32_t max_attributes
Maximum number of attributes to decode in response.
Definition rlm_radius.h:85
fr_pair_list_t * trigger_args
Pairs passed to trigger requests.
Definition rlm_radius.h:103
bool allowed[FR_RADIUS_CODE_MAX]
Definition rlm_radius.h:97
trunk_conf_t trunk_conf
trunk configuration
Definition rlm_radius.h:101
uint32_t response_timeouts
Requests in a row which have to time out before the connection is zombie.
Definition rlm_radius.h:67
fr_time_delta_t zombie_period
Definition rlm_radius.h:66
fr_bio_fd_config_t fd_config
for now MUST be at the start!
Definition rlm_radius.h:61
fr_radius_ctx_t common_ctx
Definition rlm_radius.h:81
fr_time_delta_t home_server_lifetime
for XLAT_PROXY
Definition rlm_radius.h:70
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80
Common configuration parameters for a trunk.
Definition trunk.h:251