![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
MySQL driver. More...
#include <freeradius-devel/server/base.h>#include <freeradius-devel/util/debug.h>#include <sys/stat.h>#include "config.h"#include "rlm_sql.h"#include "rlm_sql_trunk.h"
Include dependency graph for rlm_sql_mysql.c:Go to the source code of this file.
Data Structures | |
| struct | rlm_sql_mysql_conn_t |
| struct | rlm_sql_mysql_t |
Macros | |
| #define | LOG_PREFIX log_prefix |
| #define | LOG_PREFIX "rlm_sql_mysql" |
| #define | LOG_PREFIX log_prefix |
Enumerations | |
| enum | rlm_sql_mysql_warnings { SERVER_WARNINGS_AUTO = 0 , SERVER_WARNINGS_YES , SERVER_WARNINGS_NO } |
Variables | |
| static const conf_parser_t | driver_config [] |
| rlm_sql_driver_t | rlm_sql_mysql |
| static fr_table_num_sorted_t const | server_warnings_table [] |
| static size_t | server_warnings_table_len = NUM_ELEMENTS(server_warnings_table) |
| static conf_parser_t | tls_config [] |
MySQL driver.
Definition in file rlm_sql_mysql.c.
| struct rlm_sql_mysql_conn_t |
Definition at line 68 of file rlm_sql_mysql.c.
Collaboration diagram for rlm_sql_mysql_conn_t:| Data Fields | ||
|---|---|---|
| connection_t * | conn | Generic connection structure for this connection. |
| MYSQL | db | Structure representing connection details. |
| int | fd | fd for this connection's I/O events. |
| fr_sql_query_t * | query_ctx | Current query running on this connection. |
| MYSQL_RES * | result | Result from most recent query. |
| MYSQL * | sock | Connection details as returned by connection init functions. |
| int | status | returned by the most recent non-blocking function call. |
| struct rlm_sql_mysql_t |
Definition at line 78 of file rlm_sql_mysql.c.
| Data Fields | ||
|---|---|---|
| char const * | character_set | Character set to use on connections. |
| char const * | tls_ca_file | Path to the CA used to validate the server's certificate. |
| char const * | tls_ca_path | Directory containing CAs that may be used to validate the servers certificate. |
| char const * | tls_certificate_file | Public certificate we present to the server. |
| bool | tls_check_cert | Verify there's a trust relationship between the server's cert and one of the CAs we have configured. |
| bool | tls_check_cert_cn | Verify that the CN in the server cert matches the host we passed to mysql_real_connect(). |
| char const * | tls_cipher | Colon separated list of TLS ciphers for TLS <= 1.2. |
| char const * | tls_crl_file | Public certificate we present to the server. |
| char const * | tls_crl_path | Private key for the certificate we present to the server. |
| char const * | tls_private_key_file | Private key for the certificate we present to the server. |
| bool | tls_required | Require that the connection is encrypted. |
| rlm_sql_mysql_warnings | warnings | mysql_warning_count() doesn't appear to work with NDB cluster |
| char const * | warnings_str | Whether we always query the server for additional warnings. |
| #define LOG_PREFIX log_prefix |
Definition at line 29 of file rlm_sql_mysql.c.
| #define LOG_PREFIX "rlm_sql_mysql" |
Definition at line 29 of file rlm_sql_mysql.c.
| #define LOG_PREFIX log_prefix |
Definition at line 29 of file rlm_sql_mysql.c.
| Enumerator | |
|---|---|
| SERVER_WARNINGS_AUTO | |
| SERVER_WARNINGS_YES | |
| SERVER_WARNINGS_NO | |
Definition at line 55 of file rlm_sql_mysql.c.
|
static |
Callback for I/O events in response to mysql_real_connect_start()
Definition at line 192 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 231 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 392 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 264 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 140 of file rlm_sql_mysql.c.
|
static |
Definition at line 176 of file rlm_sql_mysql.c.
|
static |
Definition at line 171 of file rlm_sql_mysql.c.
|
static |
Definition at line 844 of file rlm_sql_mysql.c.
|
static |
Analyse the last error that occurred on the socket, and determine an action.
| server | Socket from which to extract the server error. May be NULL. |
| client_errno | Error from the client. |
Definition at line 411 of file rlm_sql_mysql.c.
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 702 of file rlm_sql_mysql.c.
Here is the call graph for this function:
|
static |
Allocate the argument used for the SQL escape function.
In this case, a dedicated connection to allow the escape function to have access to server side parameters, though no packets ever flow after the connection is made.
Definition at line 1111 of file rlm_sql_mysql.c.
Here is the call graph for this function:
|
static |
|
static |
Definition at line 851 of file rlm_sql_mysql.c.
|
static |
|
static |
Definition at line 511 of file rlm_sql_mysql.c.
|
static |
Finish query.
As a single SQL statement may return multiple results sets, (for example stored procedures) it is necessary to check whether more results exist and process them in turn if so.
Definition at line 778 of file rlm_sql_mysql.c.
Here is the call graph for this function:
|
static |
Here is the caller graph for this function:
|
static |
Definition at line 610 of file rlm_sql_mysql.c.
|
static |
Definition at line 502 of file rlm_sql_mysql.c.
|
static |
Definition at line 1055 of file rlm_sql_mysql.c.
|
static |
|
static |
Definition at line 1085 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 482 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
|
static |
|
static |
Retrieves any warnings associated with the last query.
MySQL stores a limited number of warnings associated with the last query executed. These can be very useful in diagnosing issues, or in some cases working around bugs in MySQL which causes it to return the wrong error.
| ctx | to allocate temporary error buffers in. |
| out | Array of sql_log_entrys to fill. |
| outlen | Length of out array. |
| conn | MySQL connection the query was run on. |
Definition at line 639 of file rlm_sql_mysql.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 129 of file rlm_sql_mysql.c.
| rlm_sql_driver_t rlm_sql_mysql |
Definition at line 1142 of file rlm_sql_mysql.c.
|
static |
Definition at line 61 of file rlm_sql_mysql.c.
|
static |
Definition at line 66 of file rlm_sql_mysql.c.
|
static |
Definition at line 103 of file rlm_sql_mysql.c.
1.9.8