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: fe8901b3ee62daa9231a44907e0715f62a47499f $
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: fe8901b3ee62daa9231a44907e0715f62a47499f $")
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#include <freeradius-devel/io/worker.h>
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_worker_config_t worker; //!< Worker thread configuration.
62
63 bool drop_requests; //!< Administratively disable request processing.
64 bool suppress_secrets; //!< suppress secrets (or not)
65
66 char const *log_dir;
67 char const *local_state_dir;
68
71
72 char const *radacct_dir;
73 char const *lib_dir;
74 char const *sbin_dir;
75 char const *run_dir;
76 char const *raddb_dir; //!< Path to raddb directory
77
78 char const *prefix;
79
80 char const *log_dest;
81
82 char const *log_file;
84 bool log_line_number; //!< Log src file/line the message was generated on.
85
89
91
92 char const *dict_dir; //!< Where to load dictionaries from.
93
94 bool write_pid; //!< write the PID file
95
96#ifdef HAVE_SETUID
97 uid_t server_uid; //!< UID we're running as.
98 gid_t server_gid; //!< GID we're running as.
99 uid_t uid; //!< UID we should run as.
100 bool uid_is_set;
101 gid_t gid; //!< GID we should run as.
102 bool gid_is_set;
103#endif
104
105#ifdef ENABLE_OPENSSL_VERSION_CHECK
106 char const *allow_vulnerable_openssl; //!< The CVE number of the last security issue acknowledged.
107#endif
108
109#ifdef WITH_TLS
110 bool openssl_fips_mode; //!< Whether OpenSSL fips mode is enabled or disabled.
111 bool openssl_fips_mode_is_set; //!< Whether the user specified a value.
112
113 size_t openssl_async_pool_init; //!< Tuning option to set the minimum number of requests
114 ///< in the async ctx pool.
115
116 size_t openssl_async_pool_max; //!< Tuning option to set the maximum number of requests
117 ///< in the async ctx pool.
118#endif
119
120 fr_dict_t *dict; //!< Main dictionary.
121
122
123 /*
124 * Debugging options
125 */
126 bool allow_core_dumps; //!< Whether the server is allowed to drop a core when
127 //!< receiving a fatal signal.
128
129 char const *panic_action; //!< Command to execute if the server receives a fatal
130 //!< signal.
131
132 uint32_t debug_level; //!< The base log level for the server.
133
134 bool talloc_memory_report; //!< Print a memory report on what's left unfreed.
135 //!< Can only be used when the server is running in single
136 //!< threaded mode.
137
138 bool allow_multiple_procs; //!< Allow multiple instances of radiusd to run with the
139 ///< same config file.
140
141 int multi_proc_sem_id; //!< Semaphore we use to prevent multiple processes running.
142 char *multi_proc_sem_path; //!< Semaphore path.
143
144 uint32_t max_networks; //!< for the scheduler
145 uint32_t max_workers; //!< for the scheduler
146 fr_time_delta_t stats_interval; //!< for the scheduler
147
148#ifndef NDEBUG
149 uint32_t ins_max; //!< max instruction count
150 bool ins_countup; //!< count up to "max"
151#endif
152
153 /*
154 * Migration tools
155 */
156 bool rewrite_update; //!< rewrite "update" to be new edit sections
157 bool forbid_update; //!< forbid "update" sections
158};
159
160void main_config_name_set_default(main_config_t *config, char const *name, bool overwrite_config);
161void main_config_raddb_dir_set(main_config_t *config, char const *path);
162void main_config_dict_dir_set(main_config_t *config, char const *path);
163
164int main_config_parse_option(char const *value); /* flat / nested migration */
165
166bool main_config_migrate_option_get(char const *name);
167
171
172main_config_t *main_config_alloc(TALLOC_CTX *ctx);
177
178#ifdef __cplusplus
179}
180#endif
#define RCSIDH(h, id)
Definition build.h:486
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:80
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:90
fr_time_delta_t stats_interval
for the scheduler
uint32_t max_networks
for the scheduler
char const * radacct_dir
Definition main_config.h:72
int main_config_parse_option(char const *value)
char const * lib_dir
Definition main_config.h:73
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:70
bool talloc_memory_report
Print a memory report on what's left unfreed.
char const * local_state_dir
Definition main_config.h:67
void main_config_hup(main_config_t *config)
bool drop_requests
Administratively disable request processing.
Definition main_config.h:63
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)
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:88
fr_dict_t * dict
Main dictionary.
fr_worker_config_t worker
Worker thread configuration.
Definition main_config.h:61
char const * pid_file
Path to write out PID file.
Definition main_config.h:59
void hup_logfile(main_config_t *config)
bool suppress_secrets
suppress secrets (or not)
Definition main_config.h:64
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:74
bool write_pid
write the PID file
Definition main_config.h:94
char const * log_dir
Definition main_config.h:66
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:84
bool forbid_update
forbid "update" sections
char const * dict_dir
Where to load dictionaries from.
Definition main_config.h:92
uint32_t debug_level
The base log level for the server.
char const * prefix
Definition main_config.h:78
char const * raddb_dir
Path to raddb directory.
Definition main_config.h:76
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:69
int main_config_init(main_config_t *config)
main_config_t const * main_config
Global configuration singleton.
Definition main_config.c:58
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
char const * run_dir
Definition main_config.h:75
bool spawn_workers
Should the server spawn threads.
Definition main_config.h:58
char const * log_file
Definition main_config.h:82
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