![]() |
The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <sys/stat.h>
#include <ctpublic.h>
#include "rlm_sql.h"
Go to the source code of this file.
Data Structures | |
struct | rlm_sql_freetds_conn_t |
Macros | |
#define | LOG_PREFIX "sql - freetds" |
#define | MAX_DATASTR_LEN 256 |
Functions | |
static int | _sql_socket_destructor (rlm_sql_freetds_conn_t *conn) |
static CS_RETCODE CS_PUBLIC | clientmsg_callback (CS_CONTEXT *context, UNUSED CS_CONNECTION *conn, CS_CLIENTMSG *emsgp) |
Client-Library error handler. More... | |
static CS_RETCODE CS_PUBLIC | csmsg_callback (CS_CONTEXT *context, CS_CLIENTMSG *emsgp) |
Client error handler. More... | |
static CS_RETCODE CS_PUBLIC | servermsg_callback (CS_CONTEXT *context, UNUSED CS_CONNECTION *conn, CS_SERVERMSG *msgp) |
Server error handler. 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, UNUSED rlm_sql_config_t const *config) |
Retrieves any errors associated with the query context. 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, UNUSED rlm_sql_config_t const *config) |
static sql_rcode_t | sql_finish_select_query (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static sql_rcode_t | sql_free_result (UNUSED fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static int | sql_num_fields (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config) |
static int | sql_num_rows (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static unlang_action_t | sql_query (rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, void *uctx) |
static unlang_action_t | sql_select_query (rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, void *uctx) |
Execute a query when we expected a result set. More... | |
static sql_rcode_t | sql_socket_init (rlm_sql_handle_t *handle, rlm_sql_config_t const *config, fr_time_delta_t timeout) |
Variables | |
rlm_sql_driver_t | rlm_sql_freetds |
struct rlm_sql_freetds_conn_t |
Definition at line 40 of file rlm_sql_freetds.c.
Data Fields | ||
---|---|---|
CS_COMMAND * | command | A prepared statement. |
CS_CONTEXT * | context | Structure FreeTDS uses to avoid creating globals. |
CS_CONNECTION * | db | Handle specifying a single connection to the database. |
char * | error | The last error string created by one of the call backs. |
bool | established | Set to false once the connection has been properly established. |
char ** | results | Result strings from statement execution. |
CS_INT | rows_affected | Rows affected by last INSERT / UPDATE / DELETE. |
#define LOG_PREFIX "sql - freetds" |
Definition at line 29 of file rlm_sql_freetds.c.
#define MAX_DATASTR_LEN 256 |
Definition at line 50 of file rlm_sql_freetds.c.
|
static |
|
static |
Client-Library error handler.
Callback for any errors raised by the Client-Library. Will overwrite any previous errors associated with a connection.
context | The FreeTDS library context. |
conn | DB connection handle. |
emsgp | Pointer to the error structure. |
Definition at line 62 of file rlm_sql_freetds.c.
|
static |
Client error handler.
Callback for any errors raised by the client. Will overwrite any previous errors associated with a connection.
context | The FreeTDS library context. |
emsgp | Pointer to the error structure. |
Definition at line 106 of file rlm_sql_freetds.c.
|
static |
Server error handler.
Callback for any messages sent back from the server.
There's no standard categorisation of messages sent back from the server, so we don't know they're errors, the only thing we can do is write them to the long as informational messages.
context | The FreeTDS library context. |
conn | DB connection handle. |
msgp | Pointer to the error structure. |
Definition at line 153 of file rlm_sql_freetds.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 414 of file rlm_sql_freetds.c.
|
static |
Definition at line 588 of file rlm_sql_freetds.c.
|
static |
|
static |
Definition at line 648 of file rlm_sql_freetds.c.
|
static |
|
static |
Definition at line 637 of file rlm_sql_freetds.c.
|
static |
|
static |
Definition at line 581 of file rlm_sql_freetds.c.
|
static |
|
static |
Execute a query when we expected a result set.
Definition at line 454 of file rlm_sql_freetds.c.
|
static |
rlm_sql_driver_t rlm_sql_freetds |
Definition at line 831 of file rlm_sql_freetds.c.