The FreeRADIUS server $Id: f3670dba8951ca10eb4948feb3dc3db9423a334f $
Loading...
Searching...
No Matches
fd_config.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 (at
5 * 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: 33a753a7af2635d087c4f332373d30d0f47ceba3 $
19 * @file lib/bio/fd_config.c
20 * @brief BIO abstractions for configuring file descriptors.
21 *
22 * @copyright 2024 Network RADIUS SAS (legal@networkradius.com)
23 */
24
25#include <freeradius-devel/server/cf_parse.h>
26#include <freeradius-devel/server/tmpl.h>
27#include <freeradius-devel/util/perm.h>
28
29#include <freeradius-devel/bio/fd_priv.h>
30
32 { L("read-only"), O_RDONLY },
33 { L("read-write"), O_RDWR },
34 { L("ro"), O_RDONLY },
35 { L("rw"), O_RDWR },
36 { L("wo"), O_WRONLY },
37 { L("write-only"), O_WRONLY },
38};
40
41static int mode_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
42{
43 int mode;
44 char const *name = cf_pair_value(cf_item_to_pair(ci));
45
47 if (mode < 0) {
48 cf_log_err(ci, "Invalid mode name \"%s\"", name);
49 return -1;
50 }
51
52 *(int *) out = mode;
53
54 return 0;
55}
56
57/** Parse a socket buffer size, and check that it fits into the "int" taken by setsockopt()
58 *
59 * Note that this function parses a plain integer. cf_table_parse_uint32() looks the value up in
60 * a table taken from rule->uctx, and these rules have no uctx.
61 */
62static int send_recv_buf_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
63{
64 int ret;
65 uint32_t size;
66
67 ret = cf_pair_parse_value(ctx, out, parent, ci, rule);
68 if (ret < 0) return ret;
69
70 size = *(uint32_t *) out;
71 if (size > INT_MAX) {
72 cf_log_err(ci, "Invalid value - it is too large");
73 return -1;
74 }
75
76 return 0;
77}
78
79/** Mapping table of transport names to the transport types/
80 */
82 { L("file"), FR_BIO_FD_TRANSPORT_FILE },
83 { L("tcp"), FR_BIO_FD_TRANSPORT_TCP },
84 { L("udp"), FR_BIO_FD_TRANSPORT_UDP },
85 { L("unix"), FR_BIO_FD_TRANSPORT_UNIX },
86};
88
89/** Parse "transport" and then set the subconfig
90 *
91 */
92static int common_transport_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule,
93 conf_parser_t const *transport_table[FR_BIO_FD_TRANSPORT_SIZE])
94{
95 int socket_type = SOCK_STREAM;
96 conf_parser_t const *rules;
97 char const *name = cf_pair_value(cf_item_to_pair(ci));
99 CONF_SECTION *cs, *subcs;
100 fr_bio_fd_transport_t transport_type;
101
103 if (transport_type == FR_BIO_FD_TRANSPORT_INVALID) {
104 invalid:
105 cf_log_err(ci, "Invalid transport name \"%s\"", name);
106 return -1;
107 }
108
109 /*
110 * A NULL entry means that this side does not allow that transport.
111 */
112 rules = transport_table[transport_type];
113 if (!rules) goto invalid;
114
116
117 /*
118 * Find the relevant subsection. Note that we don't do anything with it, as we push a parse
119 * rule in the parent which then points to the subsection.
120 */
121 subcs = cf_section_find(cs, name, NULL);
122 if (!subcs) {
123 cf_log_perr(ci, "Failed finding transport configuration section %s { ... }", name);
124 return -1;
125 }
126
127 /*
128 * Note that these offsets will get interpreted as being offsets from base of the subsection.
129 * i.e. the parent section and the subsection have to be parsed with the same base pointer.
130 */
131 if (cf_section_rules_push(cs, rules) < 0) {
132 cf_log_perr(ci, "Failed updating parse rules");
133 return -1;
134 }
135
136 if (transport_type == FR_BIO_FD_TRANSPORT_UDP) socket_type = SOCK_DGRAM;
137
138 /*
139 * Client sockets are always connected.
140 */
141 fd_config->socket_type = socket_type;
142 fd_config->transport_type = transport_type;
143 *(char const **) out = name;
144
145 return 0;
146}
147
150 { FR_CONF_OFFSET_TYPE_FLAGS("ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, dst_ipaddr) },
151 { FR_CONF_OFFSET_TYPE_FLAGS("ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, dst_ipaddr) },
152
153 { FR_CONF_OFFSET("port", fr_bio_fd_config_t, dst_port) },
154
155 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipaddr", FR_TYPE_COMBO_IP_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
156 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
157 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
158
159 { FR_CONF_OFFSET("src_port", fr_bio_fd_config_t, src_port) },
160 { FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
161 { FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
162
163 { FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
164
165#if (defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)) || defined(IP_DONTFRAG)
166 { FR_CONF_OFFSET("exceed_mtu", fr_bio_fd_config_t, exceed_mtu), .dflt = "yes" },
167#endif
168
170 { FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff), .func = send_recv_buf_parse },
171
173};
174
176 { FR_CONF_POINTER("udp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_udp_sub_config },
177
179};
180
181
183 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipaddr", FR_TYPE_COMBO_IP_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
184 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
185 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
186
187 { FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
188
189 { FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
190 { FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
191
192#if (defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)) || defined(IP_DONTFRAG)
193 { FR_CONF_OFFSET("exceed_mtu", fr_bio_fd_config_t, exceed_mtu), .dflt = "yes" },
194#endif
195
197 { FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff), .func = send_recv_buf_parse },
198
200};
201
207
208
211 { FR_CONF_OFFSET_TYPE_FLAGS("ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, dst_ipaddr) },
212 { FR_CONF_OFFSET_TYPE_FLAGS("ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, dst_ipaddr) },
213
214 { FR_CONF_OFFSET("port", fr_bio_fd_config_t, dst_port) },
215
216 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipaddr", FR_TYPE_COMBO_IP_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
217 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
218 { FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
219
220 { FR_CONF_OFFSET("src_port", fr_bio_fd_config_t, src_port) },
221 { FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
222 { FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
223
224 { FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
225
227 { FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff), .func = send_recv_buf_parse },
228
229 { FR_CONF_OFFSET("delay_tcp_writes", fr_bio_fd_config_t, tcp_delay) },
230
232};
233
235 { FR_CONF_POINTER("tcp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_tcp_sub_config },
236
238};
239
242
243 { FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
244
245 { FR_CONF_OFFSET("mode", fr_bio_fd_config_t, flags), .dflt = "read-write", .func = mode_parse },
246
248};
249
251 { FR_CONF_POINTER("file", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_file_sub_config },
252
254};
255
261
263 { FR_CONF_POINTER("unix", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_unix_sub_config },
264
266};
267
274
275/** Parse "transport" and then set the subconfig
276 *
277 */
278static int client_transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
279{
281
282 /*
283 * Unconnected UDP sockets can only take src_ipaddr, but not port, and not dst_ipaddr.
284 */
286 char const *name = cf_pair_value(cf_item_to_pair(ci));
288
289 if (strcmp(name, "udp") != 0) {
290 cf_log_err(ci, "Invalid transport for unconnected UDP socket");
291 return -1;
292 }
293
295 cf_log_perr(ci, "Failed updating parse rules");
296 return -1;
297 }
298
299 fd_config->socket_type = SOCK_DGRAM;
301 *(char const **) out = name;
302
303 return 0;
304 }
305
307
309}
310
311/*
312 * Client uses src_ipaddr for our address, and ipaddr for their address.
313 */
315 { FR_CONF_OFFSET("transport", fr_bio_fd_config_t, transport), .func = client_transport_parse },
316
317 { FR_CONF_OFFSET("async", fr_bio_fd_config_t, async), .dflt = "true" },
318
320};
321
322/*
323 * Server configuration
324 *
325 * "ipaddr" is src_ipaddr
326 * There's no "dst_ipaddr" or "src_ipaddr" in the config.
327 *
328 * Files have permissions which can be set.
329 */
330
333 { FR_CONF_OFFSET_TYPE_FLAGS("ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
334 { FR_CONF_OFFSET_TYPE_FLAGS("ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
335
336 { FR_CONF_OFFSET("port", fr_bio_fd_config_t, src_port) },
337
338 { FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
339
341 { FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff), .func = send_recv_buf_parse },
342
343#if (defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)) || defined(IP_DONTFRAG)
344 { FR_CONF_OFFSET("exceed_mtu", fr_bio_fd_config_t, exceed_mtu), .dflt = "yes" },
345#endif
346
348};
349
351 { FR_CONF_POINTER("udp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_udp_sub_config },
352
354};
355
358 { FR_CONF_OFFSET_TYPE_FLAGS("ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
359 { FR_CONF_OFFSET_TYPE_FLAGS("ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
360
361 { FR_CONF_OFFSET("port", fr_bio_fd_config_t, src_port) },
362
363 { FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
364
365 { FR_CONF_OFFSET_IS_SET("backlog", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, backlog) },
366
368 { FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff), .func = send_recv_buf_parse },
369
370 { FR_CONF_OFFSET("delay_tcp_writes", fr_bio_fd_config_t, tcp_delay) },
371
373};
374
376 { FR_CONF_POINTER("tcp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_tcp_sub_config },
377
379};
380
383
384 { FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
385
386 { FR_CONF_OFFSET("mkdir", fr_bio_fd_config_t, mkdir) },
387
389};
390
392 { FR_CONF_POINTER("file", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_file_sub_config },
393
395};
396
403
406
407 { FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
408
409 { FR_CONF_OFFSET("mode", fr_bio_fd_config_t, flags), .dflt = "read-only", .func = mode_parse },
410
411 { FR_CONF_OFFSET("mkdir", fr_bio_fd_config_t, mkdir) },
412
413 { FR_CONF_POINTER("peercred", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_peercred_config },
414
416};
417
419 { FR_CONF_POINTER("unix", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_unix_sub_config },
420
422};
423
424/*
425 * @todo - move this to client/server config in the same struct?
426 */
433
434/** Parse "transport" and then set the subconfig
435 *
436 */
437static int server_transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
438{
439 int rcode;
441
442 fd_config->server = true;
443
445 if (rcode < 0) return rcode;
446
447 /*
448 * Automatically set the BIO type, too.
449 *
450 * A server reads datagrams from anyone, and listens for new stream connections. A file is
451 * neither: it is opened and then read or written, which is what a connected bio does.
452 */
453 switch (fd_config->transport_type) {
456 break;
457
461 break;
462
465
466 /*
467 * A server reads and writes its file. There is no "mode" item for a server file, so
468 * the default is the only mode, and 'flags' would otherwise be left as O_RDONLY, which
469 * is zero.
470 */
471 fd_config->flags = O_RDWR;
472 break;
473
475 fr_assert(0);
476 return -1;
477 }
478
479 return 0;
480}
481
482/*
483 * Server uses ipaddr for our address, and doesn't use src_ipaddr.
484 */
486 { FR_CONF_OFFSET("transport", fr_bio_fd_config_t, transport), .func = server_transport_parse },
487
488 { FR_CONF_OFFSET("async", fr_bio_fd_config_t, async), .dflt = "true" },
489
491};
#define L(_str)
Helper for initialising arrays of string literals.
Definition build.h:228
#define UNUSED
Definition build.h:384
#define NUM_ELEMENTS(_t)
Definition build.h:406
int cf_pair_parse_value(TALLOC_CTX *ctx, void *out, UNUSED void *base, CONF_ITEM *ci, conf_parser_t const *rule)
Parses a CONF_PAIR into a C data type.
Definition cf_parse.c:252
int cf_parse_gid(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Generic function for resolving GID strings to uid_t values.
Definition cf_parse.c:1869
int cf_parse_permissions(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Generic function for resolving permissions to a mode-t.
Definition cf_parse.c:1884
int cf_parse_uid(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Generic function for resolving UID strings to uid_t values.
Definition cf_parse.c:1854
#define CONF_PARSER_TERMINATOR
Definition cf_parse.h:696
cf_parse_t func
Override default parsing behaviour for the specified type with a custom parsing function.
Definition cf_parse.h:650
#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
#define cf_section_rules_push(_cs, _rule)
Definition cf_parse.h:728
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
Definition cf_parse.h:334
#define FR_CONF_OFFSET_IS_SET(_name, _type, _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:294
#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
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition cf_parse.h:450
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition cf_parse.h:444
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _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:238
Defines a CONF_PAIR to C data type mapping.
Definition cf_parse.h:633
Common header for all CONF_* types.
Definition cf_priv.h:54
A section grouping multiple CONF_PAIR.
Definition cf_priv.h:106
CONF_SECTION * cf_section_find(CONF_SECTION const *cs, char const *name1, char const *name2)
Find a CONF_SECTION with name1 and optionally name2.
Definition cf_util.c:1235
CONF_SECTION * cf_item_to_section(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_SECTION.
Definition cf_util.c:671
CONF_PAIR * cf_item_to_pair(CONF_ITEM const *ci)
Cast a CONF_ITEM to a CONF_PAIR.
Definition cf_util.c:651
char const * cf_pair_value(CONF_PAIR const *pair)
Return the value of a CONF_PAIR.
Definition cf_util.c:1746
#define cf_log_err(_cf, _fmt,...)
Definition cf_util.h:340
#define cf_parent(_cf)
Definition cf_util.h:115
#define cf_log_perr(_cf, _fmt,...)
Definition cf_util.h:347
fr_bio_fd_transport_t
The type of transport used by a FD BIO.
Definition fd.h:76
@ FR_BIO_FD_TRANSPORT_TCP
TCP over IPv4 or IPv6.
Definition fd.h:79
@ FR_BIO_FD_TRANSPORT_UDP
UDP over IPv4 or IPv6.
Definition fd.h:80
@ FR_BIO_FD_TRANSPORT_INVALID
not set
Definition fd.h:77
@ FR_BIO_FD_TRANSPORT_UNIX
Unix domain socket, named by 'path'.
Definition fd.h:81
@ FR_BIO_FD_TRANSPORT_FILE
regular file, named by 'filename'
Definition fd.h:78
@ FR_BIO_FD_CONNECTED
connected client sockets (UDP or TCP)
Definition fd.h:63
@ FR_BIO_FD_INVALID
not set
Definition fd.h:59
@ FR_BIO_FD_UNCONNECTED
unconnected UDP / datagram only
Definition fd.h:60
@ FR_BIO_FD_LISTEN
call fr_bio_fd_accept() for each new connection
Definition fd.h:64
fr_bio_fd_type_t type
accept, connected, unconnected, etc.
Definition fd.h:93
bool server
is this a client or a server?
Definition fd.h:98
int socket_type
SOCK_STREAM or SOCK_DGRAM.
Definition fd.h:95
fr_bio_fd_transport_t transport_type
which transport, as a number instead of a name
Definition fd.h:97
#define FR_BIO_FD_TRANSPORT_SIZE
Definition fd.h:83
int flags
O_RDONLY, etc.
Definition fd.h:124
Configuration for sockets.
Definition fd.h:92
static int send_recv_buf_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Parse a socket buffer size, and check that it fits into the "int" taken by setsockopt()
Definition fd_config.c:62
const conf_parser_t fr_bio_fd_server_config[]
Definition fd_config.c:485
static conf_parser_t const client_udp_unconnected_config[]
Definition fd_config.c:202
static conf_parser_t const client_file_config[]
Definition fd_config.c:250
static const conf_parser_t server_unix_sub_config[]
Definition fd_config.c:404
static conf_parser_t const server_unix_config[]
Definition fd_config.c:418
static fr_table_num_sorted_t transport_types[]
Mapping table of transport names to the transport types/.
Definition fd_config.c:81
static const conf_parser_t server_udp_sub_config[]
Definition fd_config.c:331
static int mode_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Definition fd_config.c:41
static const conf_parser_t client_udp_sub_config[]
Definition fd_config.c:148
static const conf_parser_t server_file_sub_config[]
Definition fd_config.c:381
static conf_parser_t const * server_transport_configs[FR_BIO_FD_TRANSPORT_SIZE]
Definition fd_config.c:427
static const conf_parser_t client_unix_sub_config[]
Definition fd_config.c:256
static const conf_parser_t client_udp_unconnected_sub_config[]
Definition fd_config.c:182
const conf_parser_t fr_bio_fd_client_config[]
Definition fd_config.c:314
static conf_parser_t const client_udp_config[]
Definition fd_config.c:175
static int server_transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Parse "transport" and then set the subconfig.
Definition fd_config.c:437
static int common_transport_parse(UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule, conf_parser_t const *transport_table[FR_BIO_FD_TRANSPORT_SIZE])
Parse "transport" and then set the subconfig.
Definition fd_config.c:92
static const conf_parser_t client_file_sub_config[]
Definition fd_config.c:240
static int client_transport_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Parse "transport" and then set the subconfig.
Definition fd_config.c:278
static conf_parser_t const client_unix_config[]
Definition fd_config.c:262
static const conf_parser_t client_tcp_sub_config[]
Definition fd_config.c:209
static size_t transport_types_len
Definition fd_config.c:87
static conf_parser_t const server_file_config[]
Definition fd_config.c:391
static conf_parser_t const server_udp_config[]
Definition fd_config.c:350
static const conf_parser_t server_peercred_config[]
Definition fd_config.c:397
static const conf_parser_t server_tcp_sub_config[]
Definition fd_config.c:356
static size_t mode_names_len
Definition fd_config.c:39
static conf_parser_t const * client_transport_configs[FR_BIO_FD_TRANSPORT_SIZE]
Definition fd_config.c:268
static fr_table_num_sorted_t mode_names[]
Definition fd_config.c:31
static conf_parser_t const server_tcp_config[]
Definition fd_config.c:375
static conf_parser_t const client_tcp_config[]
Definition fd_config.c:234
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_IPV6_ADDR
128 Bit IPv6 Address.
@ FR_TYPE_COMBO_IP_ADDR
IPv4 or IPv6 address depending on length.
unsigned int uint32_t
#define fr_assert(_expr)
Definition rad_assert.h:37
static fr_bio_fd_config_t fd_config
static char const * name
#define fr_table_value_by_str(_table, _name, _def)
Convert a string to a value using a sorted or ordered table.
Definition table.h:685
An element in a lexicographically sorted array of name to num mappings.
Definition table.h:49
static fr_slen_t parent
Definition pair.h:864
static fr_sbuff_err_t char ** out
Definition value.h:1061