#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <ctype.h>
#include "rlm_sql.h"
Go to the source code of this file.
|
fr_sql_query_t * | fr_sql_query_alloc (TALLOC_CTX *ctx, rlm_sql_t const *inst, request_t *request, trunk_t *trunk, char const *query_str, fr_sql_query_type_t type) |
| Allocate an sql query structure.
|
|
static int | fr_sql_query_free (fr_sql_query_t *to_free) |
| Automatically run the correct finish function when freeing an SQL query.
|
|
unlang_action_t | rlm_sql_fetch_row (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
| Call the driver's sql_fetch_row function.
|
|
void | rlm_sql_print_error (rlm_sql_t const *inst, request_t *request, fr_sql_query_t *query_ctx, bool force_debug) |
| Retrieve any errors from the SQL driver.
|
|
void | rlm_sql_query_log (rlm_sql_t const *inst, char const *filename, char const *query) |
|
unlang_action_t | rlm_sql_trunk_query (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
| Submit an SQL query using a trunk connection.
|
|
unlang_action_t | sql_get_map_list (request_t *request, fr_sql_map_ctx_t *map_ctx, trunk_t *trunk) |
| Submit the query to get any user / group check or reply pairs.
|
|
static unlang_action_t | sql_get_map_list_resume (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
| Process the results of an SQL query to produce a map list.
|
|
static void | sql_trunk_query_cancel (UNUSED request_t *request, UNUSED fr_signal_t action, void *uctx) |
| Cancel an SQL query submitted on a trunk.
|
|
static unlang_action_t | sql_trunk_query_start (UNUSED rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, UNUSED void *uctx) |
| Yield processing after submitting a trunk request.
|
|
◆ LOG_PREFIX
Definition at line 29 of file sql.c.
◆ fr_sql_query_alloc()
Allocate an sql query structure.
Definition at line 184 of file sql.c.
◆ fr_sql_query_free()
Automatically run the correct finish
function when freeing an SQL query.
And mark any associated trunk request as complete.
Definition at line 168 of file sql.c.
◆ rlm_sql_fetch_row()
Call the driver's sql_fetch_row function.
Calls the driver's sql_fetch_row logging any errors. On success, will write row data to uctx->row
.
The rcode within the query context is updated to
- Parameters
-
p_result | Result of current module call. |
priority | Unused. |
request | Current request. |
uctx | query context containing query to execute. |
- Returns
- an unlang_action_t.
Definition at line 80 of file sql.c.
◆ rlm_sql_print_error()
Retrieve any errors from the SQL driver.
Retrieves errors from the driver from the last operation and writes them to to request/global log, in the ERROR, WARN, INFO and DEBUG categories.
- Parameters
-
inst | Instance of rlm_sql. |
request | Current request, may be NULL. |
query_ctx | Query context to retrieve errors for. |
force_debug | Force all errors to be logged as debug messages. |
Definition at line 123 of file sql.c.
◆ rlm_sql_query_log()
void rlm_sql_query_log |
( |
rlm_sql_t const * |
inst, |
|
|
char const * |
filename, |
|
|
char const * |
query |
|
) |
| |
◆ rlm_sql_trunk_query()
Submit an SQL query using a trunk connection.
- Parameters
-
p_result | Result of current module call. |
priority | Unused. |
request | Current request. |
uctx | query context containing query to execute. |
- Returns
- an unlang_action_t.
Definition at line 235 of file sql.c.
◆ sql_get_map_list()
Submit the query to get any user / group check or reply pairs.
Definition at line 342 of file sql.c.
◆ sql_get_map_list_resume()
Process the results of an SQL query to produce a map list.
Definition at line 295 of file sql.c.
◆ sql_trunk_query_cancel()
Cancel an SQL query submitted on a trunk.
Definition at line 210 of file sql.c.
◆ sql_trunk_query_start()
Yield processing after submitting a trunk request.
Definition at line 202 of file sql.c.
◆ sql_rcode_description_table
Initial value:= {
}
#define L(_str)
Helper for initialising arrays of string literals.
@ RLM_SQL_QUERY_INVALID
Query syntax error.
@ RLM_SQL_ALT_QUERY
Key constraint violation, use an alternative query.
@ RLM_SQL_RECONNECT
Stale connection, should reconnect.
@ RLM_SQL_ERROR
General connection/server error.
@ RLM_SQL_NO_MORE_ROWS
No more rows available.
Definition at line 45 of file sql.c.
◆ sql_rcode_description_table_len
Definition at line 53 of file sql.c.
◆ sql_rcode_table
Initial value:
Definition at line 55 of file sql.c.
◆ sql_rcode_table_len
Definition at line 63 of file sql.c.