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
2786f0f76ea3fe506835d49f19d26fc0ba380221

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 220 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 374 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:642
#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:323
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
Definition cf_parse.h:412
static const conf_parser_t client_file_sub_config[]
Definition fd_config.c:181

Definition at line 191 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:1632
#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:268
#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:256
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition cf_parse.h:418
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 181 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:152

Definition at line 175 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("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:282
#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 152 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:191
static conf_parser_t const client_udp_config[]
Definition fd_config.c:125
static conf_parser_t const client_unix_config[]
Definition fd_config.c:203
static conf_parser_t const client_tcp_config[]
Definition fd_config.c:175

Definition at line 209 of file fd_config.c.

◆ client_transport_names_len

size_t client_transport_names_len = NUM_ELEMENTS(client_transport_names)
static

Definition at line 215 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 125 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("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:132

Definition at line 145 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_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 132 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:197

Definition at line 203 of file fd_config.c.

◆ client_unix_sub_config

const conf_parser_t client_unix_sub_config[]
static
Initial value:

Definition at line 197 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:220

Definition at line 256 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:374

Definition at line 400 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:317

Definition at line 327 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 317 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:1617
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:1602

Definition at line 333 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:294

Definition at line 311 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 294 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:354
static conf_parser_t const server_file_config[]
Definition fd_config.c:327
static conf_parser_t const server_udp_config[]
Definition fd_config.c:288
static conf_parser_t const server_tcp_config[]
Definition fd_config.c:311

Definition at line 363 of file fd_config.c.

◆ server_transport_names_len

size_t server_transport_names_len = NUM_ELEMENTS(server_transport_names)
static

Definition at line 369 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:273

Definition at line 288 of file fd_config.c.

◆ server_udp_sub_config

const conf_parser_t server_udp_sub_config[]
static
Initial value:

Definition at line 273 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:340

Definition at line 354 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:333

Definition at line 340 of file fd_config.c.