The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
SQLite driver. More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sqlite3.h>
#include "rlm_sql.h"
#include "rlm_sql_trunk.h"
#include "config.h"
Go to the source code of this file.
Data Structures | |
struct | rlm_sql_sqlite_conn_t |
struct | rlm_sql_sqlite_t |
Macros | |
#define | BOOTSTRAP_MAX (1048576 * 10) |
#define | LOG_PREFIX "sql - sqlite" |
#define | SQLITE_OPEN_NOMUTEX 0 |
Typedefs | |
typedef sqlite_int64 | sqlite3_int64 |
Functions | |
static void | _sql_connection_close (UNUSED fr_event_list_t *el, void *h, UNUSED void *uctx) |
static void | _sql_greatest (sqlite3_context *ctx, int num_values, sqlite3_value **values) |
CC_NO_UBSAN (function) | |
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
static int | mod_load (void) |
static int | sql_affected_rows (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static sql_rcode_t | sql_check_error (sqlite3 *db, int status) |
Determine if an error occurred, and what type of error it was. More... | |
static size_t | sql_error (UNUSED TALLOC_CTX *ctx, sql_log_entry_t out[], NDEBUG_UNUSED size_t outlen, fr_sql_query_t *query_ctx) |
Retrieves any errors associated with the query context. More... | |
static sql_rcode_t | sql_error_to_rcode (int status) |
Convert an sqlite status code to an sql_rcode_t. More... | |
static unlang_action_t | sql_fetch_row (rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, void *uctx) |
static sql_rcode_t | sql_fields (char const **out[], fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static sql_rcode_t | sql_finish_query (fr_sql_query_t *query_ctx, rlm_sql_config_t const *config) |
static sql_rcode_t | sql_free_result (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static int | sql_loadfile (TALLOC_CTX *ctx, sqlite3 *db, char const *filename) |
static void | sql_print_error (sqlite3 *db, int status, char const *fmt,...)) |
Print an error to the global debug log. More... | |
static void | sql_request_complete (UNUSED request_t *request, void *preq, UNUSED void *rctx, UNUSED void *uctx) |
static SQL_QUERY_RESUME void | sql_request_fail (UNUSED request_t *request, void *preq, UNUSED void *rctx, UNUSED trunk_request_state_t state, UNUSED void *uctx) |
Variables | |
static const conf_parser_t | driver_config [] |
rlm_sql_driver_t | rlm_sql_sqlite |
SQLite driver.
Definition in file rlm_sql_sqlite.c.
struct rlm_sql_sqlite_conn_t |
Definition at line 53 of file rlm_sql_sqlite.c.
Data Fields | ||
---|---|---|
int | col_count | |
sqlite3 * | db | |
sqlite3_stmt * | statement |
struct rlm_sql_sqlite_t |
Definition at line 59 of file rlm_sql_sqlite.c.
Data Fields | ||
---|---|---|
bool | bootstrap | |
char const * | filename |
#define BOOTSTRAP_MAX (1048576 * 10) |
Definition at line 40 of file rlm_sql_sqlite.c.
#define LOG_PREFIX "sql - sqlite" |
Definition at line 27 of file rlm_sql_sqlite.c.
#define SQLITE_OPEN_NOMUTEX 0 |
Definition at line 46 of file rlm_sql_sqlite.c.
typedef sqlite_int64 sqlite3_int64 |
Definition at line 50 of file rlm_sql_sqlite.c.
|
static |
Definition at line 422 of file rlm_sql_sqlite.c.
|
static |
CC_NO_UBSAN | ( | function | ) |
|
static |
|
static |
Definition at line 784 of file rlm_sql_sqlite.c.
|
static |
Definition at line 597 of file rlm_sql_sqlite.c.
|
static |
Determine if an error occurred, and what type of error it was.
db | handle to extract error from (may be NULL). |
status | to check (if unused, set to SQLITE_OK). |
Definition at line 125 of file rlm_sql_sqlite.c.
|
static |
Retrieves any errors associated with the query context.
ctx | to allocate temporary error buffers in. |
out | Array of sql_log_entrys to fill. |
outlen | Length of out array. |
query_ctx | Query context to retrieve error for. |
config | rlm_sql config. |
Definition at line 575 of file rlm_sql_sqlite.c.
|
static |
Convert an sqlite status code to an sql_rcode_t.
status | to convert. |
Definition at line 78 of file rlm_sql_sqlite.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 228 of file rlm_sql_sqlite.c.
|
static |
Print an error to the global debug log.
If status does not indicate success, write an error to the global error log.
db | handle to extract error from (may be NULL). |
status | to check (if unused, set to SQLITE_OK). |
fmt | to prepend. |
... | arguments to fmt. |
Definition at line 173 of file rlm_sql_sqlite.c.
|
static |
Definition at line 649 of file rlm_sql_sqlite.c.
|
static |
Definition at line 64 of file rlm_sql_sqlite.c.
rlm_sql_driver_t rlm_sql_sqlite |
Definition at line 797 of file rlm_sql_sqlite.c.