The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
conf.c
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15 */
16
17/**
18 * $Id: 8d2d380b06961cdf1f6d00d60813aafa3d0ece62 $
19 *
20 * @file ldap/conf.c
21 * @brief Configuration parsing for LDAP server connections.
22 *
23 * @copyright 2022 The FreeRADIUS server project
24 */
25RCSID("$Id: 8d2d380b06961cdf1f6d00d60813aafa3d0ece62 $")
26
27#include <freeradius-devel/ldap/base.h>
28#include <freeradius-devel/ldap/conf.h>
29
36
37/*
38 * TLS Configuration
39 */
41 /*
42 * Deprecated attributes
43 */
45
47
48 { FR_CONF_OFFSET_FLAGS("certificate_file", CONF_FLAG_FILE_READABLE, fr_ldap_config_t, tls_certificate_file) },
49
50 { FR_CONF_OFFSET_FLAGS("private_key_file", CONF_FLAG_FILE_READABLE, fr_ldap_config_t, tls_private_key_file) },
51
52 /*
53 * LDAP Specific TLS attributes
54 */
55 { FR_CONF_OFFSET("start_tls", fr_ldap_config_t, start_tls), .dflt = "no" },
56
57 { FR_CONF_OFFSET("require_cert", fr_ldap_config_t, tls_require_cert_str) },
58
59 { FR_CONF_OFFSET("tls_min_version", fr_ldap_config_t, tls_min_version_str) },
60
62};
63
64/*
65 * Various options that don't belong in the main configuration.
66 *
67 * Note that these overlap a bit with the connection pool code!
68 */
70 /*
71 * Pool config items
72 */
73 { FR_CONF_OFFSET("chase_referrals", fr_ldap_config_t, chase_referrals) },
74
75 { FR_CONF_OFFSET("use_referral_credentials", fr_ldap_config_t, use_referral_credentials), .dflt = "no" },
76
77 { FR_CONF_OFFSET("referral_depth", fr_ldap_config_t, referral_depth), .dflt = "5" },
78
79 { FR_CONF_OFFSET("rebind", fr_ldap_config_t, rebind) },
80
81 { FR_CONF_OFFSET("sasl_secprops", fr_ldap_config_t, sasl_secprops) },
82
83 { FR_CONF_OFFSET("idle", fr_ldap_config_t, keepalive_idle), .dflt = "60", .func = cf_parse_time_delta_bounded, .uctx = &cf_time_delta_bounds_int_sec },
84
85 { FR_CONF_OFFSET("probes", fr_ldap_config_t, keepalive_probes), .dflt = "3" },
86
87 { FR_CONF_OFFSET("interval", fr_ldap_config_t, keepalive_interval), .dflt = "30", .func = cf_parse_time_delta_bounded, .uctx = &cf_time_delta_bounds_int_sec },
88
89 { FR_CONF_OFFSET("dereference", fr_ldap_config_t, dereference_str) },
90
91 /* allow server unlimited time for search (server-side limit) */
92 { FR_CONF_OFFSET("srv_timelimit", fr_ldap_config_t, srv_timelimit), .dflt = "20" },
93
94 { FR_CONF_OFFSET("idle_timeout", fr_ldap_config_t, idle_timeout), .dflt = "300" },
95
96 /*
97 * Replaced by the connection timeout and reconnect delay of the
98 * connection pool, and by a "timeout" section around the module call.
99 */
100 { FR_CONF_V3_DEPRECATED("net_timeout", fr_ldap_config_t, NULL) },
101 { FR_CONF_V3_DEPRECATED("res_timeout", fr_ldap_config_t, NULL) },
102 { FR_CONF_V3_DEPRECATED("reconnection_delay", fr_ldap_config_t, NULL) },
103
105};
#define RCSID(id)
Definition build.h:603
cf_time_delta_bounds_t const cf_time_delta_bounds_int_sec
Bounds which keep a time delta within an int of seconds, for libraries which take one.
Definition cf_parse.c:1891
int cf_parse_time_delta_bounded(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Parse a time delta, and force it within the bounds passed as the rule's uctx.
Definition cf_parse.c:1909
#define CONF_PARSER_TERMINATOR
Definition cf_parse.h:722
cf_parse_t func
Override default parsing behaviour for the specified type with a custom parsing function.
Definition cf_parse.h:666
#define FR_CONF_V3_DEPRECATED(_name, _struct, _field)
conf_parser_t entry which raises an error if a deprecated v3 item is found
Definition cf_parse.h:446
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:280
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition cf_parse.h:484
@ CONF_FLAG_FILE_READABLE
File matching value must exist, and must be readable.
Definition cf_parse.h:472
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition cf_parse.h:268
Defines a CONF_PAIR to C data type mapping.
Definition cf_parse.h:649
Connection configuration.
Definition base.h:230
conf_parser_t const fr_ldap_sasl_mech_static[]
Definition conf.c:30
conf_parser_t const fr_ldap_option_config[]
Definition conf.c:69
conf_parser_t const fr_ldap_tls_config[]
Definition conf.c:40