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

Go to the source code of this file.

Data Structures

struct  rlm_sql_db2_conn_t
 

Macros

#define LOG_PREFIX   "sql - db2"
 

Functions

static int _sql_socket_destructor (rlm_sql_db2_conn_t *conn)
 
static int sql_affected_rows (rlm_sql_handle_t *handle, UNUSED 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. 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 (UNUSED 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, 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 sql_rcode_t sql_query (rlm_sql_handle_t *handle, UNUSED 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, UNUSED fr_time_delta_t timeout)
 

Variables

rlm_sql_driver_t rlm_sql_db2
 

Data Structure Documentation

◆ rlm_sql_db2_conn_t

struct rlm_sql_db2_conn_t

Definition at line 42 of file rlm_sql_db2.c.

Data Fields
SQLHANDLE dbc_handle
SQLHANDLE env_handle
SQLHANDLE stmt

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   "sql - db2"

Definition at line 32 of file rlm_sql_db2.c.

Function Documentation

◆ _sql_socket_destructor()

static int _sql_socket_destructor ( rlm_sql_db2_conn_t conn)
static

Definition at line 48 of file rlm_sql_db2.c.

+ Here is the caller graph for this function:

◆ sql_affected_rows()

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

Definition at line 277 of file rlm_sql_db2.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_entrys 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 244 of file rlm_sql_db2.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 188 of file rlm_sql_db2.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 150 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

◆ sql_finish_query()

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

Definition at line 267 of file rlm_sql_db2.c.

+ Here is the caller graph for this function:

◆ 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 272 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

◆ sql_free_result()

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

Definition at line 222 of file rlm_sql_db2.c.

◆ sql_num_fields()

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

Definition at line 140 of file rlm_sql_db2.c.

+ Here is the caller graph for this function:

◆ sql_query()

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

Definition at line 109 of file rlm_sql_db2.c.

+ 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 135 of file rlm_sql_db2.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,
UNUSED fr_time_delta_t  timeout 
)
static

Definition at line 62 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

Variable Documentation

◆ rlm_sql_db2

rlm_sql_driver_t rlm_sql_db2
Initial value:
= {
.common = {
.name = "sql_db2",
},
.number = 8,
.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_fetch_row(rlm_sql_row_t *out, rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:188
static sql_rcode_t sql_finish_query(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:267
static sql_rcode_t sql_free_result(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:222
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.
Definition: rlm_sql_db2.c:244
static sql_rcode_t sql_query(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config, char const *query)
Definition: rlm_sql_db2.c:109
static sql_rcode_t sql_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t const *config, char const *query)
Definition: rlm_sql_db2.c:135
static sql_rcode_t sql_finish_select_query(rlm_sql_handle_t *handle, rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:272
static int sql_affected_rows(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:277
static int sql_num_fields(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:140
static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, rlm_sql_config_t const *config, UNUSED fr_time_delta_t timeout)
Definition: rlm_sql_db2.c:62
static sql_rcode_t sql_fields(char const **out[], rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:150

Definition at line 289 of file rlm_sql_db2.c.