![]() |
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"
Include dependency graph for rlm_sql_sqlite.c: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 connection_state_t | _sql_connection_init (void **h, connection_t *conn, void *uctx) |
| static void | _sql_greatest (sqlite3_context *ctx, int num_values, sqlite3_value **values) |
| 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. | |
| 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. | |
| static sql_rcode_t | sql_error_to_rcode (int status) |
| Convert an sqlite status code to an sql_rcode_t. | |
| static unlang_action_t | sql_fetch_row (unlang_result_t *p_result, 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. | |
| 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) |
| static SQL_TRUNK_CONNECTION_ALLOC void | sql_trunk_request_mux (UNUSED fr_event_list_t *el, trunk_connection_t *tconn, connection_t *conn, 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.
Collaboration diagram for rlm_sql_sqlite_t:| Data Fields | ||
|---|---|---|
| bool | bootstrap | |
| fr_time_delta_t | busy_timeout | |
| 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 431 of file rlm_sql_sqlite.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 807 of file rlm_sql_sqlite.c.
|
static |
Definition at line 605 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 128 of file rlm_sql_sqlite.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
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. |
Definition at line 583 of file rlm_sql_sqlite.c.
|
static |
Convert an sqlite status code to an sql_rcode_t.
| status | to convert. |
Definition at line 80 of file rlm_sql_sqlite.c.
Here is the caller graph for this function:
|
static |
|
static |
Definition at line 445 of file rlm_sql_sqlite.c.
|
static |
|
static |
|
static |
Definition at line 231 of file rlm_sql_sqlite.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 176 of file rlm_sql_sqlite.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 671 of file rlm_sql_sqlite.c.
|
static |
|
static |
Definition at line 65 of file rlm_sql_sqlite.c.
| rlm_sql_driver_t rlm_sql_sqlite |
Definition at line 820 of file rlm_sql_sqlite.c.
1.9.8