The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Declarations for functions that parse and manipulate virtual server sections. More...
#include <freeradius-devel/io/schedule.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/unlang/module.h>
#include <freeradius-devel/unlang/mod_action.h>
#include <freeradius-devel/util/dict.h>
Go to the source code of this file.
Data Structures | |
struct | virtual_server_compile_t |
Processing sections which are allowed in this virtual server. More... | |
Macros | |
#define | COMPILE_TERMINATOR { .section = NULL } |
Typedefs | |
typedef struct virtual_server_s | virtual_server_t |
Functions | |
fr_listen_t * | listen_find_any (fr_listen_t *li) |
See if another global listener is using a particular IP / port. | |
bool | listen_record (fr_listen_t *li) |
Record that we're listening on a particular IP / port. | |
int | virtual_server_compile_sections (virtual_server_t const *vs, tmpl_rules_t const *rules) |
Compile sections for a virtual server. | |
unlang_action_t | virtual_server_push (request_t *request, CONF_SECTION *server_cs, bool top_frame) |
Set the request processing function. | |
section_name_t const ** | virtual_server_section_methods (virtual_server_t const *vs, section_name_t const *section) |
Find the component for a section. | |
int | virtual_server_section_register (virtual_server_t *vs, virtual_server_compile_t const *entry) |
Register name1 / name2 as allowed processing sections. | |
Variables | |
const conf_parser_t | virtual_servers_config [] |
const conf_parser_t | virtual_servers_on_read_config [] |
Debug functions | |
void | virtual_server_listen_debug (void) |
Print all the loaded listener instances. | |
void | virtual_server_process_debug (void) |
Print all the loaded process module instances. | |
Resolution functions | |
module_instance_t * | virtual_server_listener_by_data (void const *data) |
Resolve proto data to a module instance. | |
Callbacks for dealing with transports | |
int | virtual_server_listen_transport_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule) |
Generic conf_parser_t func for loading drivers. | |
Namespace management | |
fr_dict_t const * | virtual_server_dict_by_child_ci (CONF_ITEM const *ci) |
Return the namespace for a given virtual server specified by a CONF_ITEM within the virtual server. | |
fr_dict_t const * | virtual_server_dict_by_cs (CONF_SECTION const *server_cs) |
Return the namespace for the virtual server specified by a config section. | |
fr_dict_t const * | virtual_server_dict_by_name (char const *virtual_server) |
Return the namespace for the named virtual server. | |
int | virtual_server_has_namespace (CONF_SECTION **out, char const *virtual_server, fr_dict_t const *namespace, CONF_ITEM *ci)) |
Verify that a given virtual_server exists and is of a particular namespace. | |
Lookup and namespace management | |
virtual_server_t const * | virtual_server_by_child (CONF_ITEM const *ci) |
Find a virtual server using one of its sections. | |
int | virtual_server_cf_parse (TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule)) |
CONF_SECTION * | virtual_server_cs (virtual_server_t const *vs) |
Return the configuration section for a virtual server. | |
virtual_server_t const * | virtual_server_find (char const *name) |
Return virtual server matching the specified name. | |
Parsing, bootstrap and instantiation | |
int | virtual_server_section_attribute_define (CONF_SECTION *server_cs, char const *subcs_name, fr_dict_attr_t const *da) |
Define a values for Auth-Type attributes by the sections present in a virtual-server. | |
int | virtual_servers_bootstrap (CONF_SECTION *config) |
Load protocol modules and call their bootstrap methods. | |
int | virtual_servers_free (void) |
int | virtual_servers_init (void) |
Performs global initialisation for the virtual server code. | |
int | virtual_servers_instantiate (void) |
Instantiate all the virtual servers. | |
int | virtual_servers_open (fr_schedule_t *sc) |
Open all the listen sockets. | |
void | virtual_servers_thread_detach (void) |
Free thread-specific data for all process modules and listeners. | |
int | virtual_servers_thread_instantiate (TALLOC_CTX *ctx, fr_event_list_t *el) |
Perform thread instantiation for all process modules and listeners. | |
Declarations for functions that parse and manipulate virtual server sections.
Definition in file virtual_servers.h.
struct virtual_server_compile_t |
Processing sections which are allowed in this virtual server.
Definition at line 100 of file virtual_servers.h.
Data Fields | ||
---|---|---|
unlang_mod_actions_t const * | actions | Default actions for this section. |
bool | dont_cache | If true, the CONF_SECTION pointer won't be written and the offset will be ignored. |
size_t | instruction | where the instruction pointer is written |
section_name_t const ** | methods | list of auxilliary module methods which are allowed in if the main name doesn't match. |
size_t | offset | where the CONF_SECTION pointer is written |
section_name_t const * | section | Identifier for the section. |
#define COMPILE_TERMINATOR { .section = NULL } |
Definition at line 111 of file virtual_servers.h.
typedef struct virtual_server_s virtual_server_t |
Definition at line 32 of file virtual_servers.h.
fr_listen_t * listen_find_any | ( | fr_listen_t * | li | ) |
See if another global listener is using a particular IP / port.
Definition at line 861 of file virtual_servers.c.
bool listen_record | ( | fr_listen_t * | li | ) |
Record that we're listening on a particular IP / port.
Definition at line 872 of file virtual_servers.c.
virtual_server_t const * virtual_server_by_child | ( | CONF_ITEM const * | ci | ) |
Find a virtual server using one of its sections.
[in] | ci | to find parent virtual server for. |
Definition at line 923 of file virtual_servers.c.
int virtual_server_cf_parse | ( | TALLOC_CTX * | ctx, |
void * | out, | ||
void * | parent, | ||
CONF_ITEM * | ci, | ||
conf_parser_t const * | rule | ||
) |
int virtual_server_compile_sections | ( | virtual_server_t const * | vs, |
tmpl_rules_t const * | rules | ||
) |
Compile sections for a virtual server.
When the "proto_foo" module calls fr_app_process_instantiate(), it loads the compile list from the fr_app_worker_t, and calls this function.
This function walks down the registration table, compiling each named section.
[in] | vs | to to compile sections for. |
[in] | rules | to apply for pass1. |
Definition at line 974 of file virtual_servers.c.
CONF_SECTION * virtual_server_cs | ( | virtual_server_t const * | vs | ) |
Return the configuration section for a virtual server.
[in] | vs | to return conf section for |
Definition at line 889 of file virtual_servers.c.
Return the namespace for a given virtual server specified by a CONF_ITEM within the virtual server.
[in] | ci | to look for namespace in. |
Definition at line 608 of file virtual_servers.c.
fr_dict_t const * virtual_server_dict_by_cs | ( | CONF_SECTION const * | server_cs | ) |
Return the namespace for the virtual server specified by a config section.
[in] | server_cs | to look for namespace in. |
Definition at line 587 of file virtual_servers.c.
fr_dict_t const * virtual_server_dict_by_name | ( | char const * | virtual_server | ) |
Return the namespace for the named virtual server.
[in] | virtual_server | to look for namespace in. |
Definition at line 570 of file virtual_servers.c.
virtual_server_t const * virtual_server_find | ( | char const * | name | ) |
Return virtual server matching the specified name.
[in] | name | of virtual server. |
Definition at line 903 of file virtual_servers.c.
int virtual_server_has_namespace | ( | CONF_SECTION ** | out, |
char const * | virtual_server, | ||
fr_dict_t const * | namespace, | ||
CONF_ITEM * | ci | ||
) |
Verify that a given virtual_server exists and is of a particular namespace.
Mostly used by modules to check virtual servers specified by their configs.
[out] | out | we found. May be NULL if just checking for existence. |
[in] | virtual_server | to check. |
[in] | namespace | the virtual server must belong to. |
[in] | ci | to log errors against. May be NULL if caller doesn't want errors logged. |
Definition at line 636 of file virtual_servers.c.
void virtual_server_listen_debug | ( | void | ) |
Print all the loaded listener instances.
Definition at line 174 of file virtual_servers.c.
int virtual_server_listen_transport_parse | ( | TALLOC_CTX * | ctx, |
void * | out, | ||
void * | parent, | ||
CONF_ITEM * | ci, | ||
conf_parser_t const * | rule | ||
) |
Generic conf_parser_t func for loading drivers.
Definition at line 202 of file virtual_servers.c.
module_instance_t * virtual_server_listener_by_data | ( | void const * | data | ) |
Resolve proto data to a module instance.
[in] | data | Pointer to the proto data. |
Definition at line 194 of file virtual_servers.c.
void virtual_server_process_debug | ( | void | ) |
Print all the loaded process module instances.
Definition at line 182 of file virtual_servers.c.
unlang_action_t virtual_server_push | ( | request_t * | request, |
CONF_SECTION * | server_cs, | ||
bool | top_frame | ||
) |
Set the request processing function.
Short-term hack
Definition at line 699 of file virtual_servers.c.
int virtual_server_section_attribute_define | ( | CONF_SECTION * | server_cs, |
char const * | subcs_name, | ||
fr_dict_attr_t const * | da | ||
) |
Define a values for Auth-Type attributes by the sections present in a virtual-server.
The.name2 value of any sections found will be converted into values of the specified da.
[in] | server_cs | The virtual server containing the sections. |
[in] | subcs_name | of the subsection to search for. |
[in] | da | to add enumeration values for. |
Definition at line 1176 of file virtual_servers.c.
section_name_t const ** virtual_server_section_methods | ( | virtual_server_t const * | vs, |
section_name_t const * | section | ||
) |
Find the component for a section.
Definition at line 1137 of file virtual_servers.c.
int virtual_server_section_register | ( | virtual_server_t * | vs, |
virtual_server_compile_t const * | entry | ||
) |
Register name1 / name2 as allowed processing sections.
This function is called from the virtual server bootstrap routine, which happens before module_bootstrap();
Definition at line 1092 of file virtual_servers.c.
int virtual_servers_bootstrap | ( | CONF_SECTION * | config | ) |
Load protocol modules and call their bootstrap methods.
[in] | config | section containing the virtual servers to bootstrap. |
Definition at line 1679 of file virtual_servers.c.
int virtual_servers_free | ( | void | ) |
Definition at line 1700 of file virtual_servers.c.
int virtual_servers_init | ( | void | ) |
Performs global initialisation for the virtual server code.
This has to be done separately and explicitly, because the above code makes use of "onread" callbacks.
Will automatically free module lists on exit, but all modules should have been removed from this list by the point that happens.
Definition at line 1726 of file virtual_servers.c.
int virtual_servers_instantiate | ( | void | ) |
Instantiate all the virtual servers.
Definition at line 1549 of file virtual_servers.c.
int virtual_servers_open | ( | fr_schedule_t * | sc | ) |
Open all the listen sockets.
[in] | sc | Scheduler to add I/O paths to. |
Definition at line 1455 of file virtual_servers.c.
void virtual_servers_thread_detach | ( | void | ) |
Free thread-specific data for all process modules and listeners.
Definition at line 1524 of file virtual_servers.c.
int virtual_servers_thread_instantiate | ( | TALLOC_CTX * | ctx, |
fr_event_list_t * | el | ||
) |
Perform thread instantiation for all process modules and listeners.
Definition at line 1533 of file virtual_servers.c.
|
extern |
Definition at line 158 of file virtual_servers.c.
|
extern |
Definition at line 130 of file virtual_servers.c.