The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Functions | Variables
fd_config.c File Reference

BIO abstractions for configuring file descriptors. More...

#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/util/perm.h>
#include <freeradius-devel/bio/fd_priv.h>
+ Include dependency graph for fd_config.c:

Go to the source code of this file.

Functions

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.
 
static int common_transport_parse (UNUSED TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule, fr_table_ptr_sorted_t const *transport_table, size_t transport_table_len)
 Parse "transport" and then set the subconfig.
 
static int mode_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 
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.
 

Variables

static conf_parser_t const client_file_config []
 
static const conf_parser_t client_file_sub_config []
 
static conf_parser_t const client_tcp_config []
 
static const conf_parser_t client_tcp_sub_config []
 
static fr_table_ptr_sorted_t client_transport_names []
 
static size_t client_transport_names_len = NUM_ELEMENTS(client_transport_names)
 
static conf_parser_t const client_udp_config []
 
static const conf_parser_t client_udp_sub_config []
 
static conf_parser_t const client_udp_unconnected_config []
 
static const conf_parser_t client_udp_unconnected_sub_config []
 
static conf_parser_t const client_unix_config []
 
static const conf_parser_t client_unix_sub_config []
 
const conf_parser_t fr_bio_fd_client_config []
 
const conf_parser_t fr_bio_fd_server_config []
 
static fr_table_num_sorted_t mode_names []
 
static size_t mode_names_len = NUM_ELEMENTS(mode_names)
 
static conf_parser_t const server_file_config []
 
static const conf_parser_t server_file_sub_config []
 
static const conf_parser_t server_peercred_config []
 
static conf_parser_t const server_tcp_config []
 
static const conf_parser_t server_tcp_sub_config []
 
static fr_table_ptr_sorted_t server_transport_names []
 
static size_t server_transport_names_len = NUM_ELEMENTS(server_transport_names)
 
static conf_parser_t const server_udp_config []
 
static const conf_parser_t server_udp_sub_config []
 
static conf_parser_t const server_unix_config []
 
static const conf_parser_t server_unix_sub_config []
 

Detailed Description

BIO abstractions for configuring file descriptors.

Id
2385740290d9179add001dbdda7f5158fa34de7e

Definition in file fd_config.c.

Function Documentation

◆ client_transport_parse()

static int client_transport_parse ( TALLOC_CTX *  ctx,
void *  out,
void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

Parse "transport" and then set the subconfig.

Definition at line 227 of file fd_config.c.

+ Here is the call graph for this function:

◆ common_transport_parse()

static int common_transport_parse ( UNUSED TALLOC_CTX *  ctx,
void *  out,
void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule,
fr_table_ptr_sorted_t const *  transport_table,
size_t  transport_table_len 
)
static

Parse "transport" and then set the subconfig.

Definition at line 58 of file fd_config.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mode_parse()

static int mode_parse ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Definition at line 39 of file fd_config.c.

+ Here is the call graph for this function:

◆ server_transport_parse()

static int server_transport_parse ( TALLOC_CTX *  ctx,
void *  out,
void *  parent,
CONF_ITEM ci,
conf_parser_t const *  rule 
)
static

Parse "transport" and then set the subconfig.

Definition at line 381 of file fd_config.c.

+ Here is the call graph for this function:

Variable Documentation

◆ client_file_config

conf_parser_t const client_file_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("file", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_file_sub_config },
}
#define CONF_PARSER_TERMINATOR
Definition cf_parse.h:658
#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:339
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition cf_parse.h:428
static const conf_parser_t client_file_sub_config[]
Definition fd_config.c:188

Definition at line 198 of file fd_config.c.

◆ client_file_sub_config

const conf_parser_t client_file_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
{ FR_CONF_OFFSET("mode", fr_bio_fd_config_t, flags), .dflt = "read-write", .func = mode_parse },
}
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:1676
#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:284
#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:272
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition cf_parse.h:434
Configuration for sockets.
Definition fd.h:81
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:39

Definition at line 188 of file fd_config.c.

◆ client_tcp_config

conf_parser_t const client_tcp_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("tcp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_tcp_sub_config },
}
static const conf_parser_t client_tcp_sub_config[]
Definition fd_config.c:157

Definition at line 182 of file fd_config.c.

◆ client_tcp_sub_config

const conf_parser_t client_tcp_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("port", fr_bio_fd_config_t, dst_port) },
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET("src_port", fr_bio_fd_config_t, src_port) },
{ FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
{ FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
{ FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, recv_buff) },
{ FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff) },
{ FR_CONF_OFFSET("delay_tcp_writes", fr_bio_fd_config_t, tcp_delay) },
}
#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:298
#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:241
@ 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.

Definition at line 157 of file fd_config.c.

◆ client_transport_names

fr_table_ptr_sorted_t client_transport_names[]
static
Initial value:
= {
{ L("file"), client_file_config },
{ L("tcp"), client_tcp_config },
{ L("udp"), client_udp_config },
{ L("unix"), client_unix_config },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition build.h:209
static conf_parser_t const client_file_config[]
Definition fd_config.c:198
static conf_parser_t const client_udp_config[]
Definition fd_config.c:127
static conf_parser_t const client_unix_config[]
Definition fd_config.c:210
static conf_parser_t const client_tcp_config[]
Definition fd_config.c:182

Definition at line 216 of file fd_config.c.

◆ client_transport_names_len

size_t client_transport_names_len = NUM_ELEMENTS(client_transport_names)
static

Definition at line 222 of file fd_config.c.

◆ client_udp_config

conf_parser_t const client_udp_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("udp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_udp_sub_config },
}
static const conf_parser_t client_udp_sub_config[]
Definition fd_config.c:104

Definition at line 127 of file fd_config.c.

◆ client_udp_sub_config

const conf_parser_t client_udp_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("port", fr_bio_fd_config_t, dst_port) },
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET("src_port", fr_bio_fd_config_t, src_port) },
{ FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
{ FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
{ FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, recv_buff) },
{ FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff) },
}

Definition at line 104 of file fd_config.c.

◆ client_udp_unconnected_config

conf_parser_t const client_udp_unconnected_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("udp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_udp_unconnected_sub_config },
}
static const conf_parser_t client_udp_unconnected_sub_config[]
Definition fd_config.c:134

Definition at line 150 of file fd_config.c.

◆ client_udp_unconnected_sub_config

const conf_parser_t client_udp_unconnected_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv4addr", FR_TYPE_IPV4_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET_TYPE_FLAGS("src_ipv6addr", FR_TYPE_IPV6_ADDR, 0, fr_bio_fd_config_t, src_ipaddr) },
{ FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
{ FR_CONF_OFFSET("src_port_start", fr_bio_fd_config_t, src_port_start) },
{ FR_CONF_OFFSET("src_port_end", fr_bio_fd_config_t, src_port_end) },
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, recv_buff) },
{ FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff) },
}

Definition at line 134 of file fd_config.c.

◆ client_unix_config

conf_parser_t const client_unix_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("unix", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) client_unix_sub_config },
}
static const conf_parser_t client_unix_sub_config[]
Definition fd_config.c:204

Definition at line 210 of file fd_config.c.

◆ client_unix_sub_config

const conf_parser_t client_unix_sub_config[]
static
Initial value:

Definition at line 204 of file fd_config.c.

◆ fr_bio_fd_client_config

const conf_parser_t fr_bio_fd_client_config[]
Initial value:
= {
{ FR_CONF_OFFSET("transport", fr_bio_fd_config_t, transport), .func = client_transport_parse },
{ FR_CONF_OFFSET("async", fr_bio_fd_config_t, async), .dflt = "true" },
}
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:227

Definition at line 263 of file fd_config.c.

◆ fr_bio_fd_server_config

const conf_parser_t fr_bio_fd_server_config[]
Initial value:
= {
{ FR_CONF_OFFSET("transport", fr_bio_fd_config_t, transport), .func = server_transport_parse },
{ FR_CONF_OFFSET("async", fr_bio_fd_config_t, async), .dflt = "true" },
}
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:381

Definition at line 407 of file fd_config.c.

◆ mode_names

fr_table_num_sorted_t mode_names[]
static
Initial value:
= {
{ L("read-only"), O_RDONLY },
{ L("read-write"), O_RDWR },
{ L("ro"), O_RDONLY },
{ L("rw"), O_RDWR },
}

Definition at line 31 of file fd_config.c.

◆ mode_names_len

size_t mode_names_len = NUM_ELEMENTS(mode_names)
static

Definition at line 37 of file fd_config.c.

◆ server_file_config

conf_parser_t const server_file_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("file", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_file_sub_config },
}
static const conf_parser_t server_file_sub_config[]
Definition fd_config.c:324

Definition at line 334 of file fd_config.c.

◆ server_file_sub_config

const conf_parser_t server_file_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
{ FR_CONF_OFFSET("mkdir", fr_bio_fd_config_t, mkdir) },
}

Definition at line 324 of file fd_config.c.

◆ server_peercred_config

const conf_parser_t server_peercred_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("uid", fr_bio_fd_config_t, uid), .func = cf_parse_uid },
{ FR_CONF_OFFSET("gid", fr_bio_fd_config_t, gid), .func = cf_parse_gid },
}
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:1661
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:1646

Definition at line 340 of file fd_config.c.

◆ server_tcp_config

conf_parser_t const server_tcp_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("tcp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_tcp_sub_config },
}
static const conf_parser_t server_tcp_sub_config[]
Definition fd_config.c:301

Definition at line 318 of file fd_config.c.

◆ server_tcp_sub_config

const conf_parser_t server_tcp_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("port", fr_bio_fd_config_t, src_port) },
{ FR_CONF_OFFSET("interface", fr_bio_fd_config_t, interface) },
{ FR_CONF_OFFSET_IS_SET("recv_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, recv_buff) },
{ FR_CONF_OFFSET_IS_SET("send_buff", FR_TYPE_UINT32, 0, fr_bio_fd_config_t, send_buff) },
{ FR_CONF_OFFSET("delay_tcp_writes", fr_bio_fd_config_t, tcp_delay) },
}

Definition at line 301 of file fd_config.c.

◆ server_transport_names

fr_table_ptr_sorted_t server_transport_names[]
static
Initial value:
= {
{ L("file"), server_file_config },
{ L("tcp"), server_tcp_config },
{ L("udp"), server_udp_config },
{ L("unix"), server_unix_config },
}
static conf_parser_t const server_unix_config[]
Definition fd_config.c:361
static conf_parser_t const server_file_config[]
Definition fd_config.c:334
static conf_parser_t const server_udp_config[]
Definition fd_config.c:295
static conf_parser_t const server_tcp_config[]
Definition fd_config.c:318

Definition at line 370 of file fd_config.c.

◆ server_transport_names_len

size_t server_transport_names_len = NUM_ELEMENTS(server_transport_names)
static

Definition at line 376 of file fd_config.c.

◆ server_udp_config

conf_parser_t const server_udp_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("udp", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_udp_sub_config },
}
static const conf_parser_t server_udp_sub_config[]
Definition fd_config.c:280

Definition at line 295 of file fd_config.c.

◆ server_udp_sub_config

const conf_parser_t server_udp_sub_config[]
static
Initial value:

Definition at line 280 of file fd_config.c.

◆ server_unix_config

conf_parser_t const server_unix_config[]
static
Initial value:
= {
{ FR_CONF_POINTER("unix", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_unix_sub_config },
}
static const conf_parser_t server_unix_sub_config[]
Definition fd_config.c:347

Definition at line 361 of file fd_config.c.

◆ server_unix_sub_config

const conf_parser_t server_unix_sub_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("permissions", fr_bio_fd_config_t, perm), .dflt = "0600", .func = cf_parse_permissions },
{ FR_CONF_OFFSET("mode", fr_bio_fd_config_t, flags), .dflt = "read-only", .func = mode_parse },
{ FR_CONF_OFFSET("mkdir", fr_bio_fd_config_t, mkdir) },
{ FR_CONF_POINTER("peercred", 0, CONF_FLAG_SUBSECTION, NULL), .subcs = (void const *) server_peercred_config },
}
static const conf_parser_t server_peercred_config[]
Definition fd_config.c:340

Definition at line 347 of file fd_config.c.