Allocates an IPv4 address from pools stored in SQL. More...
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <ctype.h>
#include <rlm_sql.h>
Go to the source code of this file.
Data Structures | |
struct | rlm_sqlippool_t |
Macros | |
#define | DO(_x) sqlippool_command(inst->_x, handle, inst, request, NULL, 0) |
#define | MAX_QUERY_LEN 4096 |
Typedefs | |
typedef struct rlm_sqlippool_t | rlm_sqlippool_t |
Functions | |
static int | CC_HINT (nonnull(1, 3, 4, 5)) |
static rlm_rcode_t | CC_HINT (nonnull) |
static int | do_logging (REQUEST *request, char const *str, int rcode) |
static int | mod_accounting_alive (rlm_sql_handle_t *handle, rlm_sqlippool_t *inst, REQUEST *request) |
static int | mod_accounting_off (rlm_sql_handle_t *handle, rlm_sqlippool_t *inst, REQUEST *request) |
static int | mod_accounting_on (rlm_sql_handle_t *handle, rlm_sqlippool_t *inst, REQUEST *request) |
static int | mod_accounting_start (rlm_sql_handle_t *handle, rlm_sqlippool_t *inst, REQUEST *request) |
static int | mod_accounting_stop (rlm_sql_handle_t *handle, rlm_sqlippool_t *inst, REQUEST *request) |
static int | mod_instantiate (CONF_SECTION *conf, void *instance) |
static int | sqlippool_command (char const *fmt, rlm_sql_handle_t *handle, rlm_sqlippool_t *data, REQUEST *request, char *param, int param_len) |
Perform a single sqlippool query. More... | |
static int | sqlippool_expand (char *out, int outlen, char const *fmt, rlm_sqlippool_t *data, char *param, int param_len) |
Variables | |
static CONF_PARSER | message_config [] |
static CONF_PARSER | module_config [] |
module_t | rlm_sqlippool |
Allocates an IPv4 address from pools stored in SQL.
Definition in file rlm_sqlippool.c.
struct rlm_sqlippool_t |
Definition at line 40 of file rlm_sqlippool.c.
Data Fields | ||
---|---|---|
char const * | alive_begin | SQL query to begin. |
char const * | alive_commit | SQL query to commit. |
char const * | alive_update | SQL query to update an IP entry. |
char const * | allocate_begin | SQL query to begin. |
char const * | allocate_clear | SQL query to clear an IP. |
char const * | allocate_commit | SQL query to commit. |
char const * | allocate_find | SQL query to find an unused IP. |
char const * | allocate_update | SQL query to mark an IP as used. |
char const * | defaultpool | Default Pool-Name if there is none in the check items. |
int | framed_ip_address | the attribute number for Framed-IP(v6)-Address |
bool | ipv6 | Whether or not we do IPv6 pools. |
time_t | last_clear | So we only do it once a second. |
uint32_t | lease_duration | |
char const * | log_clear | We successfully deallocated ip address from pool. |
char const * | log_exists | There was an ip address already assigned. |
char const * | log_failed | Failed to allocate ip from the pool. |
char const * | log_nopool | There was no Framed-IP-Address but also no Pool-Name. |
char const * | log_success | We successfully allocated ip address from pool. |
char const * | off_begin | SQL query to begin. |
char const * | off_clear | SQL query to clear an entire NAS. |
char const * | off_commit | SQL query to commit. |
char const * | on_begin | SQL query to begin. |
char const * | on_clear | SQL query to clear an entire NAS. |
char const * | on_commit | SQL query to commit. |
char const * | pool_check | Query to check for the existence of the pool. |
char const * | pool_name | |
rlm_sql_t * | sql_inst | |
char const * | sql_instance_name | |
char const * | start_begin | SQL query to begin. |
char const * | start_commit | SQL query to commit. |
char const * | start_update | SQL query to update an IP entry. |
char const * | stop_begin | SQL query to begin. |
char const * | stop_clear | SQL query to clear an IP. |
char const * | stop_commit | SQL query to commit. |
#define DO | ( | _x | ) | sqlippool_command(inst->_x, handle, inst, request, NULL, 0) |
Definition at line 306 of file rlm_sqlippool.c.
#define MAX_QUERY_LEN 4096 |
Definition at line 35 of file rlm_sqlippool.c.
typedef struct rlm_sqlippool_t rlm_sqlippool_t |
|
static |
|
static |
|
static |
Definition at line 424 of file rlm_sqlippool.c.
|
static |
Definition at line 593 of file rlm_sqlippool.c.
|
static |
Definition at line 622 of file rlm_sqlippool.c.
|
static |
Definition at line 612 of file rlm_sqlippool.c.
|
static |
Definition at line 583 of file rlm_sqlippool.c.
|
static |
|
static |
|
static |
Perform a single sqlippool query.
Mostly wrapper around sql_query which does some special sqlippool sequence substitutions and expands the format string.
fmt | sql query to expand. |
handle | sql connection handle. |
data | Instance of rlm_sqlippool. |
request | Current request. |
param | ip address string. |
param_len | ip address string len. |
Definition at line 269 of file rlm_sqlippool.c.
|
static |
Definition at line 187 of file rlm_sqlippool.c.
|
static |
Definition at line 97 of file rlm_sqlippool.c.
|
static |
Definition at line 115 of file rlm_sqlippool.c.
module_t rlm_sqlippool |
Definition at line 712 of file rlm_sqlippool.c.