All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions | Variables
rlm_sql_unixodbc.c File Reference
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.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
 

Typedefs

typedef
USES_APPLE_DEPRECATED_API
struct rlm_sql_unixodbc_conn 
rlm_sql_unixodbc_conn_t
 

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 *config)
 
static
USES_APPLE_DEPRECATED_API int 
sql_check_error (long err_handle, rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static sql_rcode_t sql_check_error (long error_handle, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *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[], size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *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 *config)
 
static sql_rcode_t sql_fields (char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
 
static sql_rcode_t sql_finish_query (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
 
static sql_rcode_t sql_finish_select_query (rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static sql_rcode_t sql_free_result (rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static sql_rcode_t sql_free_result (rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
 
static int sql_num_fields (rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static sql_rcode_t sql_query (rlm_sql_handle_t *handle, rlm_sql_config_t *config, char const *query)
 
static sql_rcode_t sql_select_query (rlm_sql_handle_t *handle, rlm_sql_config_t *config, char const *query)
 
static sql_rcode_t sql_socket_init (rlm_sql_handle_t *handle, rlm_sql_config_t *config, struct timeval const *timeout)
 

Variables

rlm_sql_module_t rlm_sql_unixodbc
 

Data Structure Documentation

struct rlm_sql_unixodbc_conn

Definition at line 31 of file rlm_sql_unixodbc.c.

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

Typedef Documentation

Function Documentation

static int _sql_socket_destructor ( rlm_sql_unixodbc_conn_t conn)
static

Definition at line 49 of file rlm_sql_unixodbc.c.

+ Here is the caller graph for this function:

static int sql_affected_rows ( rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

Definition at line 386 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

static USES_APPLE_DEPRECATED_API int sql_check_error ( long  err_handle,
rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

+ Here is the caller graph for this function:

static sql_rcode_t sql_check_error ( long  error_handle,
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t 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 332 of file rlm_sql_unixodbc.c.

static size_t sql_error ( TALLOC_CTX *  ctx,
sql_log_entry_t  out[],
size_t  outlen,
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t 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 300 of file rlm_sql_unixodbc.c.

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

Definition at line 228 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

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

Definition at line 190 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

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

Definition at line 271 of file rlm_sql_unixodbc.c.

static sql_rcode_t sql_finish_select_query ( rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

Definition at line 248 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

static sql_rcode_t sql_free_result ( rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

+ Here is the caller graph for this function:

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

Definition at line 280 of file rlm_sql_unixodbc.c.

static int sql_num_fields ( rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

Definition at line 178 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 126 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 148 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

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

Definition at line 65 of file rlm_sql_unixodbc.c.

+ Here is the call graph for this function:

Variable Documentation

rlm_sql_module_t rlm_sql_unixodbc
Initial value:
= {
.name = "rlm_sql_unixodbc",
.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
}
static size_t sql_error(TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Retrieves any errors associated with the connection handle.
static sql_rcode_t sql_fetch_row(rlm_sql_row_t *out, rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static sql_rcode_t sql_fields(char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
static sql_rcode_t sql_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t *config, char const *query)
static int sql_affected_rows(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, rlm_sql_config_t *config, struct timeval const *timeout)
static int sql_num_fields(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static sql_rcode_t sql_finish_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static sql_rcode_t sql_free_result(rlm_sql_handle_t *handle, rlm_sql_config_t *config)
static sql_rcode_t sql_query(rlm_sql_handle_t *handle, rlm_sql_config_t *config, char const *query)
static sql_rcode_t sql_finish_query(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)

Definition at line 401 of file rlm_sql_unixodbc.c.