The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
rlm_sql.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or (at
6  * your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: 76d359c8268173a106db85087ae0b6395f143df8 $
20  * @file rlm_sql.h
21  * @brief Prototypes and functions for the SQL module
22  *
23  * @copyright 2012-2014 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
24  * @copyright 2000,2006 The FreeRADIUS server project
25  * @copyright 2000 Mike Machado (mike@innercite.com)
26  * @copyright 2000 Alan DeKok (aland@freeradius.org)
27  */
28 RCSIDH(rlm_sql_h, "$Id: 76d359c8268173a106db85087ae0b6395f143df8 $")
29 
30 #include <freeradius-devel/server/base.h>
31 #include <freeradius-devel/server/pool.h>
32 #include <freeradius-devel/server/modpriv.h>
33 #include <freeradius-devel/server/exfile.h>
34 #include <freeradius-devel/server/trunk.h>
35 #include <freeradius-devel/unlang/function.h>
36 
37 #define FR_ITEM_CHECK 0
38 #define FR_ITEM_REPLY 1
39 
40 
41 /** Action to take at end of an SQL query
42  *
43  */
44 typedef enum {
45  RLM_SQL_QUERY_INVALID = -3, //!< Query syntax error.
46  RLM_SQL_ERROR = -2, //!< General connection/server error.
47  RLM_SQL_OK = 0, //!< Success.
48  RLM_SQL_RECONNECT = 1, //!< Stale connection, should reconnect.
49  RLM_SQL_ALT_QUERY, //!< Key constraint violation, use an alternative query.
50  RLM_SQL_NO_MORE_ROWS, //!< No more rows available
51 } sql_rcode_t;
52 
53 typedef enum {
58 
59 typedef char **rlm_sql_row_t;
60 
61 typedef struct {
62  fr_log_type_t type; //!< Type of log entry L_ERR, L_WARN, L_INFO,
63  ///< L_DBG etc.
64  char const *msg; //!< Log message.
66 
67 typedef struct {
68  char const *sql_state; //!< 2-5 char error code.
69  char const *meaning; //!< Verbose description.
70  sql_rcode_t rcode; //!< What should happen if we receive this error.
72 
73 typedef struct {
74  char const *sql_server; //!< Server to connect to.
75  uint32_t sql_port; //!< Port to connect to.
76  char const *sql_login; //!< Login credentials to use.
77  char const *sql_password; //!< Login password to use.
78  char const *sql_db; //!< Database to run queries against.
79 
80  char const *group_attribute; //!< Name of the group attribute.
81 
82  bool cache_groups; //!< cache group names in &control.SQL-Group
83 
84  bool read_groups; //!< Read user groups by default.
85  //!< If false, Fall-Through = yes is required
86  //!< in the previous reply list to process
87  //!< groups.
88  bool read_profiles; //!< Read user profiles by default.
89  //!< If false, Fall-Through = yes is required
90  //!< in the previous reply list to process
91  //!< profiles.
92 
93  char const *allowed_chars; //!< Chars which done need escaping..
94  fr_time_delta_t query_timeout; //!< How long to allow queries to run for.
95 
96  char const *connect_query; //!< Query executed after establishing
97  //!< new connection.
98 
99  trunk_conf_t trunk_conf; //!< Configuration for trunk connections.
101 
102 typedef struct sql_inst rlm_sql_t;
103 
104 /*
105  * Per-thread instance data structure
106  */
107 typedef struct {
108  trunk_t *trunk; //!< Trunk connection for this thread.
109  rlm_sql_t const *inst; //!< Module instance data.
110  void *sql_escape_arg; //!< Thread specific argument to be passed to escape function.
112 
113 typedef struct {
114  void *conn; //!< Database specific connection handle.
115  rlm_sql_t const *inst; //!< The rlm_sql instance this connection belongs to.
116  TALLOC_CTX *log_ctx; //!< Talloc pool used to avoid allocing memory
117  //!< when log strings need to be copied.
119 
120 typedef enum {
124 
125 /** Status of an SQL query
126  */
127 typedef enum {
128  SQL_QUERY_FAILED = -1, //!< Failed to submit.
129  SQL_QUERY_PREPARED = 0, //!< Ready to submit.
130  SQL_QUERY_SUBMITTED, //!< Submitted for execution.
131  SQL_QUERY_RETURNED, //!< Query has executed.
132  SQL_QUERY_FETCHING_RESULTS, //!< Fetching results from server.
133  SQL_QUERY_RESULTS_FETCHED, //!< Results fetched from the server.
134  SQL_QUERY_CANCELLED //!< A cancellation has been sent to the server.
136 
137 typedef struct {
138  rlm_sql_t const *inst; //!< Module instance for this query.
139  request_t *request; //!< Request this query relates to.
140  rlm_sql_handle_t *handle; //!< Connection handle this query is being run on.
141  trunk_t *trunk; //!< Trunk this query is being run on.
142  trunk_connection_t *tconn; //!< Trunk connection this query is being run on.
143  trunk_request_t *treq; //!< Trunk request for this query.
144  char const *query_str; //!< Query string to run.
145  fr_sql_query_type_t type; //!< Type of query.
146  fr_sql_query_status_t status; //!< Status of the query.
147  sql_rcode_t rcode; //!< Result code.
148  rlm_sql_row_t row; //!< Row data from the last query.
149  void *uctx; //!< Driver specific data.
151 
152 /** Context used when fetching attribute value pairs as a map list
153  */
154 typedef struct {
155  TALLOC_CTX *ctx; //!< To allocate map entries in.
156  rlm_sql_t const *inst; //!< Module instance data.
157  fr_value_box_t *query; //!< Query string used for fetching pairs.
158  fr_sql_query_t *query_ctx; //!< Query context.
159  fr_dict_attr_t const *list; //!< Default list for pair evaluation.
160  map_list_t *out; //!< List to append entries to.
161  int rows; //!< How many rows the query returned.
163 
165 extern size_t sql_rcode_description_table_len;
167 extern size_t sql_rcode_table_len;
168 
169 /*
170  * Capabilities flags for drivers
171  */
172 #define RLM_SQL_RCODE_FLAGS_ALT_QUERY 1 //!< Can distinguish between other errors and those
173  //!< resulting from a unique key violation.
174 #define RLM_SQL_MULTI_QUERY_CONN 2 //!< Can support multiple queries on a single connection.
175 
176 /** Retrieve errors from the last query operation
177  *
178  * @note Buffers allocated in the context provided will be automatically freed. The driver
179  * should not free these buffers explicitly.
180  * @note If the driver uses its own buffers to aggregate messages, they should be cleared
181  * on sql_query_finish, and after each call to sql_error, to prevent the same messages
182  * being printed multiple times.
183  *
184  * @param[in,out] ctx to allocate any buffers required. If static buffers are provided by the
185  * driver they need not be talloc_strdupd, just write the pointer to those buffers to the
186  * .msg field of a sql_log_entry_t element.
187  * @param[out] out a pre-allocated array of log entries to fill. Need not be NULL terminated.
188  * @param[in] outlen Number of log entries available for populating. Do not write to index
189  * out[outlen] or higher.
190  * @param[in] handle to retrieve errors from.
191  * @param[in] config of the SQL instance.
192  * @return
193  * 0 - If no error messages are available.
194  * >0 - Number of log entries
195  */
196 typedef size_t (*sql_error_t)(TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, fr_sql_query_t *handle);
197 
198 typedef struct {
199  rlm_sql_t const *sql;
202 
203 typedef struct {
204  module_t common; //!< Common fields for all loadable modules.
205 
206  int flags;
207 
210 
211  unlang_function_t sql_query; //!< Run an SQL query on a pool connection.
212  unlang_function_t sql_select_query; //!< Run an SQL select query on a pool connection.
213 
214  unlang_function_t sql_query_resume; //!< Callback run after an SQL trunk query is run.
215  unlang_function_t sql_select_query_resume; //!< Callback run after an SQL select trunk query is run.
216 
219 
221  sql_rcode_t (*sql_fields)(char const **out[], fr_sql_query_t *query_ctx, rlm_sql_config_t const *config);
223 
224  sql_error_t sql_error; //!< Get any errors from the previous query.
225 
228 
230  void *(*sql_escape_arg_alloc)(TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx);
231  void (*sql_escape_arg_free)(void *uctx);
232 
233  bool uses_trunks; //!< Transitional flag for drivers which use trunks.
234  trunk_io_funcs_t trunk_io_funcs; //!< Trunk callback functions for this driver.
236 
237 struct sql_inst {
240 
241  fr_dict_attr_t const *sql_user; //!< Cached pointer to SQL-User-Name
242  //!< dictionary attribute.
244 
245  module_instance_t *driver_submodule; //!< Driver's submodule.
246  rlm_sql_driver_t const *driver; //!< Driver's exported interface.
247 
250  void *sql_escape_arg; //!< Instance specific argument to be passed to escape function.
254  fr_sql_query_t *(*query_alloc)(TALLOC_CTX *ctx, rlm_sql_t const *inst, request_t *request, rlm_sql_handle_t *handle, trunk_t *trunk, char const *query_str, fr_sql_query_type_t type);
255 
256  char const *name; //!< Module instance name.
257  fr_dict_attr_t const *group_da; //!< Group dictionary attribute.
258  module_instance_t const *mi; //!< Module instance data for thread lookups.
259 };
260 
261 void *sql_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout);
263 void rlm_sql_query_log(rlm_sql_t const *inst, char const *filename, char const *query) CC_HINT(nonnull);
264 unlang_action_t rlm_sql_select_query(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx);
265 unlang_action_t rlm_sql_query(rlm_rcode_t *p_result, int *priority, request_t *request, void *uctx);
266 unlang_action_t rlm_sql_trunk_query(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx);
267 unlang_action_t rlm_sql_fetch_row(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx);
268 void rlm_sql_print_error(rlm_sql_t const *inst, request_t *request, fr_sql_query_t *query_ctx, bool force_debug);
269 fr_sql_query_t *fr_sql_query_alloc(TALLOC_CTX *ctx, rlm_sql_t const *inst, request_t *request, rlm_sql_handle_t *handle, trunk_t *trunk, char const *query_str, fr_sql_query_type_t type);
270 
271 /*
272  * sql_state.c
273  */
274 fr_trie_t *sql_state_trie_alloc(TALLOC_CTX *ctx);
275 int sql_state_entries_from_table(fr_trie_t *states, sql_state_entry_t const table[]);
276 int sql_state_entries_from_cs(fr_trie_t *states, CONF_SECTION *overrides);
277 sql_state_entry_t const *sql_state_entry_find(fr_trie_t const *states, char const *sql_state);
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition: action.h:35
#define RCSIDH(h, id)
Definition: build.h:482
#define UNUSED
Definition: build.h:313
A section grouping multiple CONF_PAIR.
Definition: cf_priv.h:101
fr_dcursor_eval_t void const * uctx
Definition: dcursor.h:546
static fr_time_delta_t timeout
Definition: dhcpclient.c:54
unlang_action_t(* unlang_function_t)(rlm_rcode_t *p_result, int *priority, request_t *request, void *uctx)
A generic function pushed by a module or xlat to functions deeper in the C call stack to create resum...
Definition: function.h:49
Stores all information relating to an event list.
Definition: event.c:411
fr_log_type_t
Definition: log.h:54
size_t(* xlat_escape_legacy_t)(request_t *request, char *out, size_t outlen, char const *in, void *arg)
Definition: merged_model.c:213
unsigned int uint32_t
Definition: merged_model.c:33
unsigned long int size_t
Definition: merged_model.c:25
A connection pool.
Definition: pool.c:87
static const conf_parser_t config[]
Definition: base.c:183
rlm_rcode_t
Return codes indicating the result of the module call.
Definition: rcode.h:40
char const * msg
Log message.
Definition: rlm_sql.h:64
rlm_sql_t const * inst
The rlm_sql instance this connection belongs to.
Definition: rlm_sql.h:115
int sql_state_entries_from_table(fr_trie_t *states, sql_state_entry_t const table[])
Insert the contents of a state table into the state trie.
Definition: sql_state.c:124
sql_rcode_t rcode
What should happen if we receive this error.
Definition: rlm_sql.h:70
char const * sql_db
Database to run queries against.
Definition: rlm_sql.h:78
fr_log_type_t type
Type of log entry L_ERR, L_WARN, L_INFO, L_DBG etc.
Definition: rlm_sql.h:62
trunk_t * trunk
Trunk connection for this thread.
Definition: rlm_sql.h:108
fr_sql_query_status_t status
Status of the query.
Definition: rlm_sql.h:146
trunk_connection_t * tconn
Trunk connection this query is being run on.
Definition: rlm_sql.h:142
TALLOC_CTX * log_ctx
Talloc pool used to avoid allocing memory when log strings need to be copied.
Definition: rlm_sql.h:116
size_t sql_rcode_table_len
Definition: sql.c:63
rlm_sql_t const * inst
Module instance data.
Definition: rlm_sql.h:109
fr_sql_query_type_t type
Type of query.
Definition: rlm_sql.h:145
unlang_action_t rlm_sql_fetch_row(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
Call the driver's sql_fetch_row function.
Definition: sql.c:308
void * conn
Database specific connection handle.
Definition: rlm_sql.h:114
unlang_action_t rlm_sql_query(rlm_rcode_t *p_result, int *priority, request_t *request, void *uctx)
void rlm_sql_query_log(rlm_sql_t const *inst, char const *filename, char const *query)
Definition: sql.c:774
unlang_action_t sql_get_map_list(request_t *request, fr_sql_map_ctx_t *map_ctx, rlm_sql_handle_t **handle, trunk_t *trunk)
Submit the query to get any user / group check or reply pairs.
Definition: sql.c:756
unlang_action_t rlm_sql_select_query(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
Call the driver's sql_select_query method, reconnecting if necessary.
Definition: sql.c:646
char const * meaning
Verbose description.
Definition: rlm_sql.h:69
void * uctx
Driver specific data.
Definition: rlm_sql.h:149
trunk_t * trunk
Trunk this query is being run on.
Definition: rlm_sql.h:141
rlm_sql_handle_t * handle
Definition: rlm_sql.h:200
fr_table_num_sorted_t const sql_rcode_table[]
Definition: sql.c:55
char const * group_attribute
Name of the group attribute.
Definition: rlm_sql.h:80
fr_trie_t * sql_state_trie_alloc(TALLOC_CTX *ctx)
Allocate a sql_state trie, and insert the initial set of entries.
Definition: sql_state.c:102
char const * allowed_chars
Chars which done need escaping..
Definition: rlm_sql.h:93
rlm_sql_t const * inst
Module instance for this query.
Definition: rlm_sql.h:138
char const * query_str
Query string to run.
Definition: rlm_sql.h:144
request_t * request
Request this query relates to.
Definition: rlm_sql.h:139
fr_sql_query_t * query_ctx
Query context.
Definition: rlm_sql.h:158
map_list_t * out
List to append entries to.
Definition: rlm_sql.h:160
sql_rcode_t
Action to take at end of an SQL query.
Definition: rlm_sql.h:44
@ RLM_SQL_QUERY_INVALID
Query syntax error.
Definition: rlm_sql.h:45
@ RLM_SQL_ALT_QUERY
Key constraint violation, use an alternative query.
Definition: rlm_sql.h:49
@ RLM_SQL_RECONNECT
Stale connection, should reconnect.
Definition: rlm_sql.h:48
@ RLM_SQL_ERROR
General connection/server error.
Definition: rlm_sql.h:46
@ RLM_SQL_OK
Success.
Definition: rlm_sql.h:47
@ RLM_SQL_NO_MORE_ROWS
No more rows available.
Definition: rlm_sql.h:50
fr_sql_query_type_t
Definition: rlm_sql.h:120
@ SQL_QUERY_SELECT
Definition: rlm_sql.h:121
@ SQL_QUERY_OTHER
Definition: rlm_sql.h:122
fr_time_delta_t query_timeout
How long to allow queries to run for.
Definition: rlm_sql.h:94
unlang_action_t rlm_sql_trunk_query(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx)
Submit an SQL query using a trunk connection.
Definition: sql.c:572
bool cache_groups
cache group names in &control.SQL-Group
Definition: rlm_sql.h:82
rlm_sql_handle_t * handle
Connection handle this query is being run on.
Definition: rlm_sql.h:140
char const * sql_server
Server to connect to.
Definition: rlm_sql.h:74
TALLOC_CTX * ctx
To allocate map entries in.
Definition: rlm_sql.h:155
void * sql_escape_arg
Thread specific argument to be passed to escape function.
Definition: rlm_sql.h:110
char const * sql_state
2-5 char error code.
Definition: rlm_sql.h:68
size_t(* sql_error_t)(TALLOC_CTX *ctx, sql_log_entry_t out[], size_t outlen, fr_sql_query_t *handle)
Retrieve errors from the last query operation.
Definition: rlm_sql.h:196
sql_fall_through_t
Definition: rlm_sql.h:53
@ FALL_THROUGH_NO
Definition: rlm_sql.h:54
@ FALL_THROUGH_DEFAULT
Definition: rlm_sql.h:56
@ FALL_THROUGH_YES
Definition: rlm_sql.h:55
char ** rlm_sql_row_t
Definition: rlm_sql.h:59
rlm_sql_t const * inst
Module instance data.
Definition: rlm_sql.h:156
char const * sql_login
Login credentials to use.
Definition: rlm_sql.h:76
int rows
How many rows the query returned.
Definition: rlm_sql.h:161
sql_state_entry_t const * sql_state_entry_find(fr_trie_t const *states, char const *sql_state)
Lookup an SQL state based on an error code returned from the SQL server or client library.
Definition: sql_state.c:203
void rlm_sql_print_error(rlm_sql_t const *inst, request_t *request, fr_sql_query_t *query_ctx, bool force_debug)
Retrieve any errors from the SQL driver.
Definition: sql.c:352
rlm_sql_row_t row
Row data from the last query.
Definition: rlm_sql.h:148
int sql_state_entries_from_cs(fr_trie_t *states, CONF_SECTION *overrides)
Insert the contents of a CONF_SECTION into the state trie.
Definition: sql_state.c:153
sql_rcode_t rcode
Result code.
Definition: rlm_sql.h:147
char const * sql_password
Login password to use.
Definition: rlm_sql.h:77
void * sql_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout)
Definition: sql.c:65
fr_value_box_t * query
Query string used for fetching pairs.
Definition: rlm_sql.h:157
trunk_request_t * treq
Trunk request for this query.
Definition: rlm_sql.h:143
bool read_profiles
Read user profiles by default.
Definition: rlm_sql.h:88
rlm_sql_t const * sql
Definition: rlm_sql.h:199
uint32_t sql_port
Port to connect to.
Definition: rlm_sql.h:75
fr_sql_query_t * fr_sql_query_alloc(TALLOC_CTX *ctx, rlm_sql_t const *inst, request_t *request, rlm_sql_handle_t *handle, trunk_t *trunk, char const *query_str, fr_sql_query_type_t type)
Allocate an sql query structure.
Definition: sql.c:413
size_t sql_rcode_description_table_len
Definition: sql.c:53
char const * connect_query
Query executed after establishing new connection.
Definition: rlm_sql.h:96
trunk_conf_t trunk_conf
Configuration for trunk connections.
Definition: rlm_sql.h:99
fr_table_num_sorted_t const sql_rcode_description_table[]
Definition: sql.c:45
fr_sql_query_status_t
Status of an SQL query.
Definition: rlm_sql.h:127
@ SQL_QUERY_CANCELLED
A cancellation has been sent to the server.
Definition: rlm_sql.h:134
@ SQL_QUERY_RETURNED
Query has executed.
Definition: rlm_sql.h:131
@ SQL_QUERY_FETCHING_RESULTS
Fetching results from server.
Definition: rlm_sql.h:132
@ SQL_QUERY_FAILED
Failed to submit.
Definition: rlm_sql.h:128
@ SQL_QUERY_SUBMITTED
Submitted for execution.
Definition: rlm_sql.h:130
@ SQL_QUERY_PREPARED
Ready to submit.
Definition: rlm_sql.h:129
@ SQL_QUERY_RESULTS_FETCHED
Results fetched from the server.
Definition: rlm_sql.h:133
fr_dict_attr_t const * list
Default list for pair evaluation.
Definition: rlm_sql.h:159
bool read_groups
Read user groups by default.
Definition: rlm_sql.h:84
Context used when fetching attribute value pairs as a map list.
Definition: rlm_sql.h:154
Definition: rlm_sql.h:61
Definition: rlm_sql.h:67
static sql_rcode_t sql_fields(char const **out[], fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
static int sql_num_rows(fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
static int sql_affected_rows(UNUSED fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
static sql_rcode_t sql_finish_query(fr_sql_query_t *query_ctx, 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 sql_rcode_t sql_finish_select_query(fr_sql_query_t *query_ctx, UNUSED rlm_sql_config_t const *config)
static void sql_escape_arg_free(void *uctx)
static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t const *config, UNUSED fr_time_delta_t timeout)
Definition: rlm_sql_null.c:32
Module instance data.
Definition: module.h:265
Struct exported by a rlm_* module.
Definition: module.h:195
eap_aka_sim_process_conf_t * inst
fr_aka_sim_id_type_t type
module_t common
Common fields for all loadable modules.
Definition: rlm_sql.h:204
unlang_function_t sql_query
Run an SQL query on a pool connection.
Definition: rlm_sql.h:211
sql_error_t sql_error
Get any errors from the previous query.
Definition: rlm_sql.h:224
bool uses_trunks
Transitional flag for drivers which use trunks.
Definition: rlm_sql.h:233
trunk_io_funcs_t trunk_io_funcs
Trunk callback functions for this driver.
Definition: rlm_sql.h:234
xlat_escape_legacy_t sql_escape_func
Definition: rlm_sql.h:229
unlang_function_t sql_query_resume
Callback run after an SQL trunk query is run.
Definition: rlm_sql.h:214
unlang_function_t sql_fetch_row
Definition: rlm_sql.h:220
unlang_function_t sql_select_query
Run an SQL select query on a pool connection.
Definition: rlm_sql.h:212
unlang_function_t sql_select_query_resume
Callback run after an SQL select trunk query is run.
Definition: rlm_sql.h:215
unlang_function_t fetch_row
Definition: rlm_sql.h:253
unlang_function_t query
Definition: rlm_sql.h:251
module_instance_t * driver_submodule
Driver's submodule.
Definition: rlm_sql.h:245
char const * name
Module instance name.
Definition: rlm_sql.h:256
fr_dict_attr_t const * group_da
Group dictionary attribute.
Definition: rlm_sql.h:257
exfile_t * ef
Definition: rlm_sql.h:243
fr_pool_t * pool
Definition: rlm_sql.h:239
fr_dict_attr_t const * sql_user
Cached pointer to SQL-User-Name dictionary attribute.
Definition: rlm_sql.h:241
unlang_function_t select
Definition: rlm_sql.h:252
fr_value_box_escape_t box_escape_func
Definition: rlm_sql.h:249
rlm_sql_config_t config
Definition: rlm_sql.h:238
rlm_sql_driver_t const * driver
Driver's exported interface.
Definition: rlm_sql.h:246
xlat_escape_legacy_t sql_escape_func
Definition: rlm_sql.h:248
module_instance_t const * mi
Module instance data for thread lookups.
Definition: rlm_sql.h:258
void * sql_escape_arg
Instance specific argument to be passed to escape function.
Definition: rlm_sql.h:250
An element in a lexicographically sorted array of name to num mappings.
Definition: table.h:49
A time delta, a difference in time measured in nanoseconds.
Definition: time.h:80
Associates request queues with a connection.
Definition: trunk.c:131
Wraps a normal request.
Definition: trunk.c:97
Main trunk management handle.
Definition: trunk.c:195
Common configuration parameters for a trunk.
Definition: trunk.h:224
I/O functions to pass to trunk_alloc.
Definition: trunk.h:724
static fr_event_list_t * el
int(* fr_value_box_escape_t)(fr_value_box_t *vb, void *uctx)
Escape a value box.
Definition: value.h:651
int nonnull(2, 5))
static size_t char ** out
Definition: value.h:997