The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/util/debug.h>
#include <sys/stat.h>
#include <libpq-fe.h>
#include <postgres_ext.h>
#include "config.h"
#include "rlm_sql.h"
#include "rlm_sql_trunk.h"
Go to the source code of this file.
Data Structures | |
struct | rlm_sql_postgres_conn_t |
struct | rlm_sql_postgresql_t |
PostgreSQL configuration. More... | |
Macros | |
#define | LOG_PREFIX "sql - postgresql" |
#define | NAMEDATALEN 64 |
Functions | |
static void | _sql_connect_io_notify (fr_event_list_t *el, int fd, UNUSED int flags, void *uctx) |
static void | _sql_connection_close (fr_event_list_t *el, void *h, UNUSED void *uctx) |
static int | affected_rows (PGresult *result) |
Return the number of affected rows of the result as an int instead of the string that postgresql provides. More... | |
CC_NO_UBSAN (function) | |
static void | free_result_row (rlm_sql_postgres_conn_t *conn) |
Free the row of the current result that's stored in the conn struct. More... | |
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
static int | mod_load (void) |
static int | sql_affected_rows (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
static sql_rcode_t | sql_classify_error (UNUSED PGresult const *result) |
static size_t | sql_error (TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, fr_sql_query_t *query_ctx) |
Retrieves any errors associated with the query context. More... | |
static void * | sql_escape_arg_alloc (TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx) |
static void | sql_escape_arg_free (void *uctx) |
static ssize_t | sql_escape_func (request_t *request, char *out, size_t outlen, char const *in, void *arg) |
static unlang_action_t | sql_fetch_row (rlm_rcode_t *p_result, UNUSED int *priority, UNUSED request_t *request, void *uctx) |
SQL_QUERY_FAIL static SQL_QUERY_RESUME 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_free_result (fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config) |
Variables | |
static conf_parser_t | driver_config [] |
rlm_sql_driver_t | rlm_sql_postgresql |
static sql_state_entry_t | sql_state_table [] |
These are PostgreSQL specific error codes which are not covered in SQL 2011. More... | |
struct rlm_sql_postgres_conn_t |
Definition at line 69 of file rlm_sql_postgresql.c.
Data Fields | ||
---|---|---|
int | affected_rows | |
connection_t * | conn | Generic connection structure for this connection. |
int | cur_row | |
PGconn * | db | |
int | fd | fd for this connection's I/O events. |
int | num_fields | |
fr_sql_query_t * | query_ctx | Current query running on this connection. |
PGresult * | result | |
char ** | row |
struct rlm_sql_postgresql_t |
PostgreSQL configuration.
Definition at line 63 of file rlm_sql_postgresql.c.
Data Fields | ||
---|---|---|
char const * | db_string | Text based configuration string. |
bool | send_application_name | Whether we send the application name to PostgreSQL. |
fr_trie_t * | states | sql state trie. |
#define LOG_PREFIX "sql - postgresql" |
Definition at line 42 of file rlm_sql_postgresql.c.
#define NAMEDATALEN 64 |
Definition at line 57 of file rlm_sql_postgresql.c.
|
static |
Definition at line 230 of file rlm_sql_postgresql.c.
|
static |
Definition at line 330 of file rlm_sql_postgresql.c.
|
static |
Return the number of affected rows of the result as an int instead of the string that postgresql provides.
Definition at line 141 of file rlm_sql_postgresql.c.
CC_NO_UBSAN | ( | function | ) |
|
static |
Free the row of the current result that's stored in the conn struct.
Definition at line 149 of file rlm_sql_postgresql.c.
|
static |
|
static |
Definition at line 797 of file rlm_sql_postgresql.c.
|
static |
Definition at line 651 of file rlm_sql_postgresql.c.
|
static |
Definition at line 223 of file rlm_sql_postgresql.c.
|
static |
Retrieves any errors associated with the query context.
ctx | to allocate temporary error buffers in. |
out | Array of sql_log_entrys to fill. |
outlen | Length of out array. |
query_ctx | Query context to retrieve error for. |
config | rlm_sql config. |
Definition at line 626 of file rlm_sql_postgresql.c.
|
static |
|
static |
|
static |
Definition at line 658 of file rlm_sql_postgresql.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 81 of file rlm_sql_postgresql.c.
rlm_sql_driver_t rlm_sql_postgresql |
Definition at line 839 of file rlm_sql_postgresql.c.
|
static |
These are PostgreSQL specific error codes which are not covered in SQL 2011.
Definition at line 89 of file rlm_sql_postgresql.c.