The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
rlm_sql_unixodbc.c File Reference
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <sqltypes.h>
#include "rlm_sql.h"
#include <sql.h>
#include <sqlext.h>
+ Include dependency graph for rlm_sql_unixodbc.c:

Go to the source code of this file.

Data Structures

struct  rlm_sql_unixodbc_conn_t
 

Macros

#define LOG_PREFIX   "sql - unixodbc"
 

Functions

static int _sql_socket_destructor (rlm_sql_unixodbc_conn_t *conn)
 
static int sql_affected_rows (rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static USES_APPLE_DEPRECATED_API int sql_check_error (long err_handle, rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static sql_rcode_t sql_check_error (long error_handle, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
 Checks the error code to determine if the connection needs to be re-esttablished. More...
 
static size_t sql_error (TALLOC_CTX *ctx, sql_log_entry_t out[], NDEBUG_UNUSED size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
 Retrieves any errors associated with the connection handle. More...
 
static sql_rcode_t sql_fetch_row (rlm_sql_row_t *out, rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static sql_rcode_t sql_fields (char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
 
static sql_rcode_t sql_finish_query (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
 
static sql_rcode_t sql_finish_select_query (rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static sql_rcode_t sql_free_result (rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static sql_rcode_t sql_free_result (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
 
static int sql_num_fields (rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
 
static sql_rcode_t sql_query (rlm_sql_handle_t *handle, rlm_sql_config_t const *config, char const *query)
 
static sql_rcode_t sql_select_query (rlm_sql_handle_t *handle, rlm_sql_config_t const *config, char const *query)
 
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_unixodbc
 

Data Structure Documentation

◆ rlm_sql_unixodbc_conn_t

struct rlm_sql_unixodbc_conn_t

Definition at line 32 of file rlm_sql_unixodbc.c.

Data Fields
void * conn
SQLHDBC dbc
SQLHENV env
rlm_sql_row_t row
SQLHSTMT stmt

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "sql - unixodbc"

Definition at line 24 of file rlm_sql_unixodbc.c.

Function Documentation

◆ _sql_socket_destructor()

static int _sql_socket_destructor ( rlm_sql_unixodbc_conn_t conn)
static

Definition at line 50 of file rlm_sql_unixodbc.c.

+ Here is the caller graph for this function:

◆ sql_affected_rows()

static int sql_affected_rows ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static

Definition at line 376 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_check_error() [1/2]

static USES_APPLE_DEPRECATED_API int sql_check_error ( long  err_handle,
rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static
+ Here is the caller graph for this function:

◆ sql_check_error() [2/2]

static sql_rcode_t sql_check_error ( long  error_handle,
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t const *  config 
)
static

Checks the error code to determine if the connection needs to be re-esttablished.

Parameters
error_handleReturn code from a failed unixodbc call.
handlerlm_sql connection handle.
configrlm_sql config.
Returns

Definition at line 322 of file rlm_sql_unixodbc.c.

◆ sql_error()

static size_t sql_error ( TALLOC_CTX *  ctx,
sql_log_entry_t  out[],
NDEBUG_UNUSED size_t  outlen,
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t const *  config 
)
static

Retrieves any errors associated with the connection handle.

Note
Caller will free any memory allocated in ctx.
Parameters
ctxto allocate temporary error buffers in.
outArray of sql_log_entry_t to fill.
outlenLength of out array.
handlerlm_sql connection handle.
configrlm_sql config.
Returns
number of errors written to the sql_log_entry_t array.

Definition at line 290 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_fetch_row()

static sql_rcode_t sql_fetch_row ( rlm_sql_row_t out,
rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static

Definition at line 218 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_fields()

static sql_rcode_t sql_fields ( char const **  out[],
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 180 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_finish_query()

static sql_rcode_t sql_finish_query ( rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 261 of file rlm_sql_unixodbc.c.

◆ sql_finish_select_query()

static sql_rcode_t sql_finish_select_query ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static

Definition at line 238 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_free_result() [1/2]

static sql_rcode_t sql_free_result ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static
+ Here is the caller graph for this function:

◆ sql_free_result() [2/2]

static sql_rcode_t sql_free_result ( rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 270 of file rlm_sql_unixodbc.c.

◆ sql_num_fields()

static int sql_num_fields ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config 
)
static

Definition at line 168 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sql_query()

static sql_rcode_t sql_query ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config,
char const *  query 
)
static

Definition at line 120 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sql_select_query()

static sql_rcode_t sql_select_query ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config,
char const *  query 
)
static

Definition at line 137 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

◆ sql_socket_init()

static sql_rcode_t sql_socket_init ( rlm_sql_handle_t handle,
rlm_sql_config_t const *  config,
fr_time_delta_t  timeout 
)
static

Definition at line 66 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

Variable Documentation

◆ rlm_sql_unixodbc

rlm_sql_driver_t rlm_sql_unixodbc
Initial value:
= {
.common = {
.name = "sql_unixodbc"
},
.number = 6,
.sql_socket_init = sql_socket_init,
.sql_query = sql_query,
.sql_select_query = sql_select_query,
.sql_num_fields = sql_num_fields,
.sql_affected_rows = sql_affected_rows,
.sql_fields = sql_fields,
.sql_fetch_row = sql_fetch_row,
.sql_free_result = sql_free_result,
.sql_error = sql_error,
.sql_finish_query = sql_finish_query,
.sql_finish_select_query = sql_finish_select_query
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, rlm_sql_config_t const *config, fr_time_delta_t timeout)
static sql_rcode_t sql_fetch_row(rlm_sql_row_t *out, rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
static sql_rcode_t sql_free_result(rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
static sql_rcode_t sql_finish_query(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
static int sql_num_fields(rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
static size_t sql_error(TALLOC_CTX *ctx, sql_log_entry_t out[], NDEBUG_UNUSED size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Retrieves any errors associated with the connection handle.
static int sql_affected_rows(rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
static sql_rcode_t sql_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t const *config, char const *query)
static sql_rcode_t sql_finish_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
static sql_rcode_t sql_query(rlm_sql_handle_t *handle, rlm_sql_config_t const *config, char const *query)
static sql_rcode_t sql_fields(char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)

Definition at line 391 of file rlm_sql_unixodbc.c.