All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rlm_sql_oracle.c File Reference
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/rad_assert.h>
#include <sys/stat.h>
#include <oci.h>
#include "rlm_sql.h"
+ Include dependency graph for rlm_sql_oracle.c:

Go to the source code of this file.

Data Structures

struct  rlm_sql_oracle_conn_t
 

Macros

#define MAX_DATASTR_LEN   64
 

Typedefs

typedef struct
rlm_sql_oracle_conn_t 
rlm_sql_oracle_conn_t
 

Functions

static int _sql_socket_destructor (rlm_sql_oracle_conn_t *conn)
 
static int sql_affected_rows (rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static int sql_check_reconnect (rlm_sql_handle_t *handle, rlm_sql_config_t *config)
 
static size_t sql_error (TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, rlm_sql_handle_t *handle, 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, rlm_sql_config_t *config)
 
static sql_rcode_t sql_finish_query (UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
 
static sql_rcode_t sql_finish_select_query (rlm_sql_handle_t *handle, UNUSED 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, UNUSED rlm_sql_config_t *config)
 
static int sql_num_rows (rlm_sql_handle_t *handle, UNUSED 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 int sql_snprint_error (char *out, size_t outlen, rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
 Write the last Oracle error out to a buffer. More...
 
static sql_rcode_t sql_socket_init (rlm_sql_handle_t *handle, rlm_sql_config_t *config, UNUSED struct timeval const *timeout)
 

Variables

rlm_sql_module_t rlm_sql_oracle
 

Data Structure Documentation

struct rlm_sql_oracle_conn_t

Definition at line 48 of file rlm_sql_oracle.c.

Data Fields
int col_count Number of columns associated with the result set.
OCISvcCtx * ctx
OCIEnv * env
OCIError * error
int id
sb2 * ind
OCIStmt * query
char ** row
struct timeval tv

Macro Definition Documentation

#define MAX_DATASTR_LEN   64

Definition at line 60 of file rlm_sql_oracle.c.

Typedef Documentation

Function Documentation

static int _sql_socket_destructor ( rlm_sql_oracle_conn_t conn)
static

Definition at line 130 of file rlm_sql_oracle.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 488 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

static int sql_check_reconnect ( rlm_sql_handle_t handle,
rlm_sql_config_t config 
)
static

Definition at line 116 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static size_t sql_error ( TALLOC_CTX *  ctx,
sql_log_entry_t  out[],
size_t  outlen,
rlm_sql_handle_t handle,
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_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 99 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

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 428 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

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

Definition at line 206 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

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

Definition at line 472 of file rlm_sql_oracle.c.

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

Definition at line 477 of file rlm_sql_oracle.c.

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

Definition at line 458 of file rlm_sql_oracle.c.

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

Definition at line 194 of file rlm_sql_oracle.c.

+ Here is the caller graph for this function:

static int sql_num_rows ( rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t config 
)
static

Definition at line 417 of file rlm_sql_oracle.c.

+ 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 247 of file rlm_sql_oracle.c.

+ Here is the call 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 282 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

static int sql_snprint_error ( char *  out,
size_t  outlen,
rlm_sql_handle_t handle,
UNUSED rlm_sql_config_t config 
)
static

Write the last Oracle error out to a buffer.

Parameters
outWhere to write the error (should be at least 512 bytes).
outlenThe length of the error buffer.
handlesql handle.
configInstance config.
Returns
  • 0 on success.
  • -1 if there was no error.

Definition at line 72 of file rlm_sql_oracle.c.

+ Here is the caller graph for this function:

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

Definition at line 140 of file rlm_sql_oracle.c.

+ Here is the call graph for this function:

Variable Documentation

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

Definition at line 495 of file rlm_sql_oracle.c.