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 <sqlcli1.h>
#include <sqlstate.h>
#include "rlm_sql.h"
#include "rlm_sql_trunk.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 void _sql_connection_close (UNUSED fr_event_list_t *el, void *h, UNUSED void *uctx)
 
 CC_NO_UBSAN (function)
 
static int sql_affected_rows (fr_sql_query_t *query_ctx, 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, fr_sql_query_t *query_ctx)
 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 (UNUSED fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
 
static sql_rcode_t sql_free_result (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
 
static void sql_request_fail (request_t *request, void *preq, UNUSED void *rctx, UNUSED trunk_request_state_t state, UNUSED void *uctx)
 

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 44 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_connection_close()

static void _sql_connection_close ( UNUSED fr_event_list_t el,
void *  h,
UNUSED void *  uctx 
)
static

Definition at line 50 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

◆ CC_NO_UBSAN()

CC_NO_UBSAN ( function  )

Definition at line 66 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

◆ sql_affected_rows()

static int sql_affected_rows ( fr_sql_query_t query_ctx,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 291 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,
fr_sql_query_t query_ctx 
)
static

Retrieves any errors associated with the query context.

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.
query_ctxQuery context to retrieve error for.
configrlm_sql config.
Returns
number of errors written to the sql_log_entry_t array.

Definition at line 263 of file rlm_sql_db2.c.

+ Here is the call graph for this function:

◆ sql_fetch_row()

static unlang_action_t sql_fetch_row ( rlm_rcode_t p_result,
UNUSED int *  priority,
UNUSED request_t request,
void *  uctx 
)
static

Definition at line 204 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[],
fr_sql_query_t query_ctx,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 166 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 fr_sql_query_t query_ctx,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 286 of file rlm_sql_db2.c.

◆ sql_free_result()

static sql_rcode_t sql_free_result ( fr_sql_query_t query_ctx,
UNUSED rlm_sql_config_t const *  config 
)
static

Definition at line 241 of file rlm_sql_db2.c.

◆ sql_request_fail()

static void sql_request_fail ( request_t request,
void *  preq,
UNUSED void *  rctx,
UNUSED trunk_request_state_t  state,
UNUSED void *  uctx 
)
static

Definition at line 301 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",
},
.sql_query_resume = sql_query_resume,
.sql_select_query_resume = sql_query_resume,
.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_query,
.uses_trunks = true,
.trunk_io_funcs = {
.connection_alloc = sql_trunk_connection_alloc,
.request_mux = sql_trunk_request_mux,
.request_fail = sql_request_fail,
}
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
#define RLM_SQL_RCODE_FLAGS_ALT_QUERY
Can distinguish between other errors and those.
Definition: rlm_sql.h:172
static sql_rcode_t sql_fields(char const **out[], fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:166
static size_t sql_error(TALLOC_CTX *ctx, sql_log_entry_t out[], NDEBUG_UNUSED size_t outlen, fr_sql_query_t *query_ctx)
Retrieves any errors associated with the query context.
Definition: rlm_sql_db2.c:263
static unlang_action_t sql_fetch_row(rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, void *uctx)
Definition: rlm_sql_db2.c:204
static sql_rcode_t sql_finish_query(UNUSED fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:286
static sql_rcode_t sql_free_result(fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:241
static int sql_affected_rows(fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
Definition: rlm_sql_db2.c:291
static void sql_request_fail(request_t *request, void *preq, UNUSED void *rctx, UNUSED trunk_request_state_t state, UNUSED void *uctx)
Definition: rlm_sql_db2.c:301

Definition at line 313 of file rlm_sql_db2.c.