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 <freeradius-devel/bio/network.h>
Go to the source code of this file.
|
| 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, conf_parser_t const *transport_table[FR_BIO_FD_TRANSPORT_SIZE]) |
| | 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 | networks_forbidden (CONF_SECTION *subcs, char const *what) |
| | Check if the socket has a networks section where it doesn't make sense.
|
| |
| static int | networks_parse (TALLOC_CTX *ctx, UNUSED void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule) |
| | Parse the "networks" subsection, and create the trie which filters packets and connections.
|
| |
| 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()
|
| |
| 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.
|
| |
BIO abstractions for configuring file descriptors.
- Id
- c3c7009cca4f5a25ea278949d1ef57de1a94cc3c
- Copyright
- 2024 Network RADIUS SAS (legal.nosp@m.@net.nosp@m.workr.nosp@m.adiu.nosp@m.s.com)
Definition in file fd_config.c.
◆ NETWORKS_CONFIG
Value:
@ CONF_FLAG_OK_MISSING
OK if it's missing.
@ CONF_FLAG_SUBSECTION
Instead of putting the information into a configuration structure, the configuration file routines MA...
#define FR_CONF_POINTER(_name, _type, _flags, _res_p)
conf_parser_t which parses a single CONF_PAIR producing a single global result
static int networks_parse(TALLOC_CTX *ctx, UNUSED void *out, void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Parse the "networks" subsection, and create the trie which filters packets and connections.
static const conf_parser_t networks_config[]
Definition at line 116 of file fd_config.c.
◆ 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 379 of file fd_config.c.
◆ common_transport_parse()
Parse "transport" and then set the subconfig.
Definition at line 149 of file fd_config.c.
◆ mode_parse()
◆ networks_forbidden()
| static int networks_forbidden |
( |
CONF_SECTION * |
subcs, |
|
|
char const * |
what |
|
) |
| |
|
static |
Check if the socket has a networks section where it doesn't make sense.
Only unconnected UDP server sockets and TCP server listening sockets check the source of packets and connections. A client which makes outbound connections either makes connections to known destinations, or (for UDP) checks that responses match the 4-tuple of requests.
Definition at line 125 of file fd_config.c.
◆ networks_parse()
Parse the "networks" subsection, and create the trie which filters packets and connections.
The "networks" rule is the last rule of its transport subsection. The socket "ipaddr" has already been parsed, which means that we know the address family of the socket.
Definition at line 92 of file fd_config.c.
◆ send_recv_buf_parse()
| static int send_recv_buf_parse |
( |
TALLOC_CTX * |
ctx, |
|
|
void * |
out, |
|
|
void * |
parent, |
|
|
CONF_ITEM * |
ci, |
|
|
conf_parser_t const * |
rule |
|
) |
| |
|
static |
Parse a socket buffer size, and check that it fits into the "int" taken by setsockopt()
Note that this function parses a plain integer. cf_table_parse_uint32() looks the value up in a table taken from rule->uctx, and these rules have no uctx.
Definition at line 63 of file fd_config.c.
◆ 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 566 of file fd_config.c.
◆ client_file_config
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
static const conf_parser_t client_file_sub_config[]
Definition at line 351 of file fd_config.c.
◆ client_file_sub_config
Initial value:= {
}
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.
#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
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
#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
Configuration for sockets.
static int mode_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
Definition at line 341 of file fd_config.c.
◆ client_tcp_config
Initial value:= {
}
static const conf_parser_t client_tcp_sub_config[]
Definition at line 335 of file fd_config.c.
◆ client_tcp_sub_config
Initial value:= {
}
#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,...
#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
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()
@ 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 310 of file fd_config.c.
◆ client_tcp_unconnected_config
Initial value:= {
}
static const conf_parser_t client_tcp_unconnected_sub_config[]
Definition at line 303 of file fd_config.c.
◆ client_tcp_unconnected_sub_config
◆ client_transport_configs
Initial value:= {
}
@ FR_BIO_FD_TRANSPORT_TCP
TCP over IPv4 or IPv6.
@ FR_BIO_FD_TRANSPORT_UDP
UDP over IPv4 or IPv6.
@ FR_BIO_FD_TRANSPORT_UNIX
Unix domain socket, named by 'path'.
@ FR_BIO_FD_TRANSPORT_FILE
regular file, named by 'filename'
static conf_parser_t const client_file_config[]
static conf_parser_t const client_udp_config[]
static conf_parser_t const client_unix_config[]
static conf_parser_t const client_tcp_config[]
Definition at line 369 of file fd_config.c.
◆ client_udp_config
Initial value:= {
}
static const conf_parser_t client_udp_sub_config[]
Definition at line 251 of file fd_config.c.
◆ client_udp_sub_config
◆ client_udp_unconnected_config
Initial value:= {
}
static const conf_parser_t client_udp_unconnected_sub_config[]
Definition at line 278 of file fd_config.c.
◆ client_udp_unconnected_sub_config
◆ client_unix_config
Initial value:= {
}
static const conf_parser_t client_unix_sub_config[]
Definition at line 363 of file fd_config.c.
◆ client_unix_sub_config
◆ fr_bio_fd_client_config
Initial value:= {
}
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 at line 439 of file fd_config.c.
◆ fr_bio_fd_server_config
Initial value:= {
}
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 at line 614 of file fd_config.c.
◆ mode_names
Initial value:= {
{
L(
"read-only"), O_RDONLY },
{
L(
"read-write"), O_RDWR },
{
L(
"write-only"), O_WRONLY },
}
#define L(_str)
Helper for initialising arrays of string literals.
Definition at line 32 of file fd_config.c.
◆ mode_names_len
◆ networks_config
Initial value:= {
}
@ CONF_FLAG_MULTI
CONF_PAIR can have multiple copies.
@ FR_TYPE_COMBO_IP_PREFIX
IPv4 or IPv6 address prefix depending on length.
Definition at line 80 of file fd_config.c.
◆ server_file_config
Initial value:= {
}
static const conf_parser_t server_file_sub_config[]
Definition at line 520 of file fd_config.c.
◆ server_file_sub_config
◆ server_peercred_config
Initial value:= {
}
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.
int cf_parse_uid(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, conf_parser_t const *rule)
Definition at line 526 of file fd_config.c.
◆ server_tcp_config
Initial value:= {
}
static const conf_parser_t server_tcp_sub_config[]
Definition at line 504 of file fd_config.c.
◆ server_tcp_sub_config
◆ server_transport_configs
Initial value:= {
}
static conf_parser_t const server_unix_config[]
static conf_parser_t const server_file_config[]
static conf_parser_t const server_udp_config[]
static conf_parser_t const server_tcp_config[]
Definition at line 556 of file fd_config.c.
◆ server_udp_config
Initial value:= {
}
static const conf_parser_t server_udp_sub_config[]
Definition at line 477 of file fd_config.c.
◆ server_udp_sub_config
◆ server_unix_config
Initial value:= {
}
static const conf_parser_t server_unix_sub_config[]
Definition at line 547 of file fd_config.c.
◆ server_unix_sub_config
Initial value:= {
}
static const conf_parser_t server_peercred_config[]
Definition at line 533 of file fd_config.c.
◆ transport_types
Initial value:
Mapping table of transport names to the transport types.
Definition at line 138 of file fd_config.c.
◆ transport_types_len