The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
main_config.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
18/**
19 * $Id: be5dd37608b57f159641c00dce570c57dd355f7b $
20 *
21 * @file lib/server/main_config.h
22 * @brief Structures and prototypes for map functions
23 *
24 * @copyright 2018 The FreeRADIUS server project
25 */
26RCSIDH(main_config_h, "$Id: be5dd37608b57f159641c00dce570c57dd355f7b $")
27
28/*
29 * Forward declarations
30 */
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#define MAX_REQUEST_TIME 30 //!< Default maximum request time
36
38
39extern main_config_t const *main_config; //!< Global configuration singleton.
40
41#include <freeradius-devel/server/cf_util.h>
42#include <freeradius-devel/server/tmpl.h>
43
44#include <freeradius-devel/util/dict.h>
45
46
47/** Main server configuration
48 *
49 * The parsed version of the main server config.
50 */
52 char const *name; //!< Name of the daemon, usually 'radiusd'.
53 bool overwrite_config_name; //!< Overwrite the configured name, as this
54 ///< was specified by the user on the command line.
55 CONF_SECTION *root_cs; //!< Root of the server config.
56
57 bool daemonize; //!< Should the server daemonize on startup.
58 bool spawn_workers; //!< Should the server spawn threads.
59 char const *pid_file; //!< Path to write out PID file.
60
61 fr_time_delta_t max_request_time; //!< How long a request can be processed for before
62 //!< timing out.
63
64 bool drop_requests; //!< Administratively disable request processing.
65 bool suppress_secrets; //!< suppress secrets (or not)
66
67 char const *log_dir;
68 char const *local_state_dir;
69 char const *chroot_dir;
70
73
74 char const *radacct_dir;
75 char const *lib_dir;
76 char const *sbin_dir;
77 char const *run_dir;
78 char const *raddb_dir; //!< Path to raddb directory
79
80 char const *prefix;
81
82 char const *log_dest;
83
84 char const *log_file;
86 bool log_line_number; //!< Log src file/line the message was generated on.
87
91
93
94 char const *dict_dir; //!< Where to load dictionaries from.
95
96 size_t talloc_pool_size; //!< Size of pool to allocate to hold each #request_t.
97
98 uint32_t max_requests; //!< maximum number of requests outstanding
99
100 bool write_pid; //!< write the PID file
101
102#ifdef HAVE_SETUID
103 uid_t server_uid; //!< UID we're running as.
104 gid_t server_gid; //!< GID we're running as.
105 uid_t uid; //!< UID we should run as.
106 bool uid_is_set;
107 gid_t gid; //!< GID we should run as.
108 bool gid_is_set;
109#endif
110
111#ifdef ENABLE_OPENSSL_VERSION_CHECK
112 char const *allow_vulnerable_openssl; //!< The CVE number of the last security issue acknowledged.
113#endif
114
115#ifdef WITH_TLS
116 bool openssl_fips_mode; //!< Whether OpenSSL fips mode is enabled or disabled.
117 bool openssl_fips_mode_is_set; //!< Whether the user specified a value.
118
119 size_t openssl_async_pool_init; //!< Tuning option to set the minimum number of requests
120 ///< in the async ctx pool.
121
122 size_t openssl_async_pool_max; //!< Tuning option to set the maximum number of requests
123 ///< in the async ctx pool.
124#endif
125
126 fr_dict_t *dict; //!< Main dictionary.
127
128
129 /*
130 * Debugging options
131 */
132 bool allow_core_dumps; //!< Whether the server is allowed to drop a core when
133 //!< receiving a fatal signal.
134
135 char const *panic_action; //!< Command to execute if the server receives a fatal
136 //!< signal.
137
138 uint32_t debug_level; //!< The base log level for the server.
139
140 bool talloc_memory_report; //!< Print a memory report on what's left unfreed.
141 //!< Can only be used when the server is running in single
142 //!< threaded mode.
143
144 bool allow_multiple_procs; //!< Allow multiple instances of radiusd to run with the
145 ///< same config file.
146
147 int multi_proc_sem_id; //!< Semaphore we use to prevent multiple processes running.
148 char *multi_proc_sem_path; //!< Semaphore path.
149
150 uint32_t max_networks; //!< for the scheduler
151 uint32_t max_workers; //!< for the scheduler
152 fr_time_delta_t stats_interval; //!< for the scheduler
153
154#ifndef NDEBUG
155 uint32_t ins_max; //!< max instruction count
156 bool ins_countup; //!< count up to "max"
157#endif
158
159 /*
160 * Migration tools
161 */
162 bool rewrite_update; //!< rewrite "update" to be new edit sections
163 bool forbid_update; //!< forbid "update" sections
164 bool require_enum_prefix; //!< require "::" for enum parsing. They're always printed with this
165};
166
167void main_config_name_set_default(main_config_t *config, char const *name, bool overwrite_config);
168void main_config_raddb_dir_set(main_config_t *config, char const *path);
169void main_config_dict_dir_set(main_config_t *config, char const *path);
170
171int main_config_parse_option(char const *value); /* flat / nested migration */
172
173bool main_config_migrate_option_get(char const *name);
174
178
179main_config_t *main_config_alloc(TALLOC_CTX *ctx);
184
185#ifdef __cplusplus
186}
187#endif
#define RCSIDH(h, id)
Definition build.h:484
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:101
Test enumeration values.
Definition dict_test.h:92
char const * log_dest
Definition main_config.h:82
int multi_proc_sem_id
Semaphore we use to prevent multiple processes running.
char const * panic_action
Command to execute if the server receives a fatal signal.
void main_config_exclusive_proc_done(main_config_t const *config)
int32_t syslog_facility
Definition main_config.h:92
fr_time_delta_t stats_interval
for the scheduler
uint32_t max_networks
for the scheduler
char const * radacct_dir
Definition main_config.h:74
int main_config_parse_option(char const *value)
char const * lib_dir
Definition main_config.h:75
int main_config_free(main_config_t **config)
main_config_t * main_config_alloc(TALLOC_CTX *ctx)
Allocate a main_config_t struct, setting defaults.
void main_config_dict_dir_set(main_config_t *config, char const *path)
Set the global dictionary directory.
char const * name
Name of the daemon, usually 'radiusd'.
Definition main_config.h:52
bool hostname_lookups
Definition main_config.h:72
char const * chroot_dir
Definition main_config.h:69
bool talloc_memory_report
Print a memory report on what's left unfreed.
char const * local_state_dir
Definition main_config.h:68
void main_config_hup(main_config_t *config)
bool drop_requests
Administratively disable request processing.
Definition main_config.h:64
int main_config_exclusive_proc(main_config_t *config)
Check to see if we're the only process using this configuration file (or PID file if specified)
size_t talloc_pool_size
Size of pool to allocate to hold each request_t.
Definition main_config.h:96
uint32_t max_workers
for the scheduler
void main_config_name_set_default(main_config_t *config, char const *name, bool overwrite_config)
Set the server name.
bool daemonize
Should the server daemonize on startup.
Definition main_config.h:57
bool log_timestamp_is_set
Definition main_config.h:90
fr_dict_t * dict
Main dictionary.
char const * pid_file
Path to write out PID file.
Definition main_config.h:59
void hup_logfile(main_config_t *config)
bool require_enum_prefix
require "::" for enum parsing. They're always printed with this
bool suppress_secrets
suppress secrets (or not)
Definition main_config.h:65
bool rewrite_update
rewrite "update" to be new edit sections
int main_config_exclusive_proc_child(main_config_t const *config)
char const * sbin_dir
Definition main_config.h:76
bool write_pid
write the PID file
char const * log_dir
Definition main_config.h:67
bool allow_multiple_procs
Allow multiple instances of radiusd to run with the same config file.
uint32_t ins_max
max instruction count
bool log_line_number
Log src file/line the message was generated on.
Definition main_config.h:86
bool forbid_update
forbid "update" sections
char const * dict_dir
Where to load dictionaries from.
Definition main_config.h:94
uint32_t debug_level
The base log level for the server.
char const * prefix
Definition main_config.h:80
char const * raddb_dir
Path to raddb directory.
Definition main_config.h:78
fr_time_delta_t max_request_time
How long a request can be processed for before timing out.
Definition main_config.h:61
bool overwrite_config_name
Overwrite the configured name, as this was specified by the user on the command line.
Definition main_config.h:53
bool ins_countup
count up to "max"
bool reverse_lookups
Definition main_config.h:71
int main_config_init(main_config_t *config)
main_config_t const * main_config
Global configuration singleton.
Definition main_config.c:69
char * multi_proc_sem_path
Semaphore path.
bool allow_core_dumps
Whether the server is allowed to drop a core when receiving a fatal signal.
void main_config_raddb_dir_set(main_config_t *config, char const *path)
Set the global radius config directory.
CONF_SECTION * root_cs
Root of the server config.
Definition main_config.h:55
uint32_t max_requests
maximum number of requests outstanding
Definition main_config.h:98
char const * run_dir
Definition main_config.h:77
bool spawn_workers
Should the server spawn threads.
Definition main_config.h:58
char const * log_file
Definition main_config.h:84
bool main_config_migrate_option_get(char const *name)
Main server configuration.
Definition main_config.h:51
unsigned int uint32_t
static const conf_parser_t config[]
Definition base.c:183
static char const * name
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80