API to add client definitions to the server, both on startup and at runtime.
More...
Go to the source code of this file.
|
struct | radclient |
| Describes a host allowed to send packets to the server. More...
|
|
|
bool | client_add (RADCLIENT_LIST *clients, RADCLIENT *client) |
| Add a client to a RADCLIENT_LIST. More...
|
|
bool | client_add_dynamic (RADCLIENT_LIST *clients, RADCLIENT *master, RADCLIENT *c) |
| Add a dynamic client. More...
|
|
RADCLIENT * | client_afrom_cs (TALLOC_CTX *ctx, CONF_SECTION *cs, bool in_server, bool with_coa) |
| Allocate a new client from a config section. More...
|
|
RADCLIENT * | client_afrom_query (TALLOC_CTX *ctx, char const *identifier, char const *secret, char const *shortname, char const *type, char const *server, bool require_ma) CC_HINT(nonnull(2 |
|
RADCLIENT * | client_afrom_request (RADCLIENT_LIST *clients, REQUEST *request) |
| Create a new client, consuming all attributes in the control list of the request. More...
|
|
void | client_delete (RADCLIENT_LIST *clients, RADCLIENT *client) |
|
RADCLIENT RADCLIENT * | client_find (RADCLIENT_LIST const *clients, fr_ipaddr_t const *ipaddr, int proto) |
|
RADCLIENT * | client_find_old (fr_ipaddr_t const *ipaddr) |
|
RADCLIENT * | client_findbynumber (RADCLIENT_LIST const *clients, int number) |
|
void | client_free (RADCLIENT *client) |
|
void | client_list_free (RADCLIENT_LIST *clients) |
|
RADCLIENT_LIST * | client_list_init (CONF_SECTION *cs) |
|
RADCLIENT_LIST * | client_list_parse_section (CONF_SECTION *section, bool tls_required) |
|
int | client_map_section (CONF_SECTION *out, CONF_SECTION const *map, client_value_cb_t func, void *data) |
| Create a client CONF_SECTION using a mapping section to map values from a result set to client attributes. More...
|
|
RADCLIENT * | client_read (char const *filename, int in_server, int flag) |
|
API to add client definitions to the server, both on startup and at runtime.
- Id:
- 3de383ea58cdc983dcc430dac180f64ad489e527
- Author
- Arran Cudbard-Bell a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg
- Copyright
- 2015 The FreeRADIUS server project
Definition in file clients.h.
Describes a host allowed to send packets to the server.
Definition at line 35 of file clients.h.
Data Fields |
fr_stats_t |
acct |
Accounting stats. |
fr_stats_t |
auth |
Authentication stats. |
char const * |
client_server |
Virtual server associated with this dynamic client. Only used where client specifies a network of potential clients.
|
fr_stats_t |
coa |
Change of Authorization stats. |
char const * |
coa_name |
Name of the CoA home server or pool. |
home_pool_t * |
coa_pool |
The CoA home_pool_t the client is associated with. Must be used exclusively from coa_server.
|
home_server_t * |
coa_server |
The CoA home_server_t the client is associated with. Must be used exclusively from coa_pool.
|
time_t |
created |
When the client was created. |
CONF_SECTION * |
cs |
CONF_SECTION that was parsed to generate the client. |
bool |
defines_coa_server |
Client also defines a home_server. |
fr_stats_t |
dsc |
Disconnect-Request stats. |
uint32_t |
dynamic |
Whether the client was dynamically defined. |
fr_ipaddr_t |
ipaddr |
IPv4/IPv6 address of the host. |
time_t |
last_new_client |
Used for relate limiting addition and deletion of dynamic clients. |
uint32_t |
lifetime |
How long before the client is removed. |
fr_socket_limit_t |
limit |
Connections per client (TCP clients only). |
char const * |
login |
Username to use for simultaneous use checks. |
char const * |
longname |
Client identifier. |
bool |
message_authenticator |
Require RADIUS message authenticator in requests. |
char const * |
nas_type |
Type of client (arbitrary). |
int |
number |
Unique client number. |
char const * |
password |
Password to use for simultaneous use checks. |
int |
proto |
Protocol number. |
bool |
rate_limit |
Where addition of clients should be rate limited. |
struct timeval |
response_window |
How long the client has to respond. |
char const * |
secret |
Secret PSK. |
char const * |
server |
Virtual server client is associated with. |
char const * |
shortname |
Client nickname. |
fr_ipaddr_t |
src_ipaddr |
IPv4/IPv6 address to send responses from (family must match ipaddr). |
typedef int(* client_value_cb_t)(char **out, CONF_PAIR const *cp, void *data) |
Callback for retrieving values when building client sections.
Example:
int _client_value_cb(
char **out,
CONF_PAIR const *cp,
void *
data)
{
my_result *result =
data;
char *value;
if (!value) {
out = NULL;
return 0;
}
out = talloc_strdup(value);
free_attribute(value);
if (!*out) return -1;
return 0;
}
- Parameters
-
[out] | out | Where to write a pointer to the talloced value buffer. |
[in] | cp | The value of the CONF_PAIR specifies the attribute name to retrieve from the result. |
[in] | data | Pointer to the result struct to copy values from. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 136 of file clients.h.
Describes a host allowed to send packets to the server.
Add a client to a RADCLIENT_LIST.
- Parameters
-
clients | list to add client to, may be NULL if global client list is being used. |
client | to add. |
- Returns
- true on success.
- false on failure.
Definition at line 192 of file client.c.
Add a dynamic client.
Definition at line 708 of file client.c.
Allocate a new client from a config section.
- Parameters
-
ctx | to allocate new clients in. |
cs | to process as a client. |
in_server | Whether the client should belong to a specific virtual server. |
with_coa | If true and coa_server or coa_pool aren't specified automatically, create a coa home_server section and add it to the client CONF_SECTION. |
- Returns
- new RADCLIENT struct.
Definition at line 858 of file client.c.
RADCLIENT* client_afrom_query |
( |
TALLOC_CTX * |
ctx, |
|
|
char const * |
identifier, |
|
|
char const * |
secret, |
|
|
char const * |
shortname, |
|
|
char const * |
type, |
|
|
char const * |
server, |
|
|
bool |
require_ma |
|
) |
| |
Create a new client, consuming all attributes in the control list of the request.
- Parameters
-
clients | list to add new client to. |
request | Fake request. |
- Returns
- New client on success.
- NULL on error.
Definition at line 1175 of file client.c.
Create a client CONF_SECTION using a mapping section to map values from a result set to client attributes.
If we hit a CONF_SECTION we recurse and process its CONF_PAIRS too.
- Note
- Caller should free CONF_SECTION passed in as out, on error. Contents of that section will be in an undefined state.
- Parameters
-
[in,out] | out | Section to perform mapping on. Either the root of the client config, or a parent section (when this function is called recursively). Should be alloced with cf_section_alloc, or if there's a separate template section, the result of calling cf_section_dup on that section. |
[in] | map | section. |
[in] | func | to call to retrieve CONF_PAIR values. Must return a talloced buffer containing the value. |
[in] | data | to pass to func, usually a result pointer. |
- Returns
- 0 on success.
- -1 on failure.
Definition at line 775 of file client.c.
RADCLIENT* client_read |
( |
char const * |
filename, |
|
|
int |
in_server, |
|
|
int |
flag |
|
) |
| |