Manage clients allowed to communicate with the server.
More...
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <sys/stat.h>
#include <ctype.h>
#include <fcntl.h>
Go to the source code of this file.
|
#define | namecmp(a) ((!old->a && !client->a) || (old->a && client->a && (strcmp(old->a, client->a) == 0))) |
|
|
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) |
| Add a client from a result set (SQL) More...
|
|
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 * | 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) |
|
static int | client_ipaddr_cmp (void const *one, void const *two) |
|
void | client_list_free (RADCLIENT_LIST *clients) |
|
RADCLIENT_LIST * | client_list_init (CONF_SECTION *cs) |
|
RADCLIENT_LIST * | client_list_parse_section (CONF_SECTION *section, UNUSED bool tls_required) |
| Create the linked list of clients from the new configuration type. More...
|
|
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...
|
|
static int | client_num_cmp (void const *one, void const *two) |
|
RADCLIENT * | client_read (char const *filename, int in_server, int flag) |
|
Manage clients allowed to communicate with the server.
- Id:
- 566b4cc08ae8bd0513a90dc1267f52bad581a9d9
- Copyright
- 2015 Arran Cudbard-Bell a.cud.nosp@m.bard.nosp@m.b@fre.nosp@m.erad.nosp@m.ius.o.nosp@m.rg
-
2000,2006 The FreeRADIUS server project
-
2000 Alan DeKok aland.nosp@m.@ox..nosp@m.org
-
2000 Miquel van Smoorenburg mique.nosp@m.ls@c.nosp@m.istro.nosp@m.n.nl
Definition in file client.c.
Definition at line 43 of file client.c.
Data Fields |
uint32_t |
min_prefix |
|
rbtree_t * |
trees[129] |
|
#define namecmp |
( |
|
a | ) |
((!old->a && !client->a) || (old->a && client->a && (strcmp(old->a, client->a) == 0))) |
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 |
|
) |
| |
Add a client from a result set (SQL)
- Todo:
- This function should die. SQL should use client_afrom_cs.
- Parameters
-
ctx | Talloc context. |
identifier | Client IP Address / IPv4 subnet / IPv6 subnet / FQDN. |
secret | Client secret. |
shortname | Client friendly name. |
type | NAS-Type. |
server | Virtual-Server to associate clients with. |
require_ma | If true all packets from client must include a message-authenticator. |
- Returns
- New client.
- NULL on error.
Definition at line 1131 of file client.c.
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.
static int client_ipaddr_cmp |
( |
void const * |
one, |
|
|
void const * |
two |
|
) |
| |
|
static |
Create the linked list of clients from the new configuration type.
Definition at line 532 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.
static int client_num_cmp |
( |
void const * |
one, |
|
|
void const * |
two |
|
) |
| |
|
static |
RADCLIENT* client_read |
( |
char const * |
filename, |
|
|
int |
in_server, |
|
|
int |
flag |
|
) |
| |
char const* cl_srcipaddr = NULL |
|
static |
Initial value:= {
}
#define CONF_PARSER_TERMINATOR
Describes a host allowed to send packets to the server.
#define FR_CONF_OFFSET(_n, _t, _s, _f)
static char const * secret
String of printable characters.
Definition at line 688 of file client.c.
char const* hs_proto = NULL |
|
static |
Initial value:= {
}
uint32_t lifetime
How long before the client is removed.
#define CONF_PARSER_TERMINATOR
Describes a host allowed to send packets to the server.
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition at line 484 of file client.c.