All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rlm_sql_null.c
Go to the documentation of this file.
1 /*
2  * sql_null.c SQL Module
3  *
4  * Version: $Id: 1870db8111205fd649d0226c0c2224daaf983023 $
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  *
20  * Copyright 2012 Alan DeKok <aland@freeradius.org>
21  */
22 
23 RCSID("$Id: 1870db8111205fd649d0226c0c2224daaf983023 $")
24 
25 #include <freeradius-devel/radiusd.h>
26 
27 #include "rlm_sql.h"
28 
29 
30 /* Prototypes */
32 
33 static const void *fake = "fake";
34 
36  UNUSED struct timeval const *timeout)
37 {
38  memcpy(&handle->conn, &fake, sizeof(handle->conn));
39  return 0;
40 }
41 
43  UNUSED rlm_sql_config_t *config, UNUSED char const *query)
44 {
45  return 0;
46 }
47 
49 {
50  return 0;
51 }
52 
54  UNUSED rlm_sql_config_t *config, UNUSED char const *query)
55 {
56  return 0;
57 }
58 
60 {
61  return 0;
62 }
63 
65  UNUSED rlm_sql_config_t *config)
66 {
67  *out = NULL;
68 
69  return 0;
70 }
71 
73 {
74  return 0;
75 }
76 
77 /** Stub function for retrieving errors, should not be called
78  *
79  */
80 static size_t sql_error(UNUSED TALLOC_CTX *ctx, UNUSED sql_log_entry_t out[], UNUSED size_t outlen,
82 {
83  return 0;
84 }
85 
87 {
88  return 0;
89 }
90 
92 {
93  return 0;
94 }
95 
97 {
98  return 1;
99 }
100 
101 /* Exported to rlm_sql */
103 rlm_sql_module_t rlm_sql_null = {
104  .name = "rlm_sql_null",
105  .sql_socket_init = sql_socket_init,
106  .sql_query = sql_query,
107  .sql_select_query = sql_select_query,
108  .sql_num_fields = sql_num_fields,
109  .sql_num_rows = sql_num_rows,
110  .sql_fetch_row = sql_fetch_row,
111  .sql_free_result = sql_free_result,
112  .sql_error = sql_error,
113  .sql_finish_query = sql_finish_query,
114  .sql_finish_select_query = sql_finish_select_query,
115  .sql_affected_rows = sql_affected_rows
116 };
static int sql_affected_rows(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:96
static sql_rcode_t sql_finish_query(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:86
Prototypes and functions for the SQL module.
char ** rlm_sql_row_t
Definition: rlm_sql.h:59
static sql_rcode_t sql_socket_init(rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config, UNUSED struct timeval const *timeout)
Definition: rlm_sql_null.c:35
#define UNUSED
Definition: libradius.h:134
rlm_sql_module_t rlm_sql_null
Definition: rlm_sql_null.c:103
static float timeout
Definition: radclient.c:43
static int sql_num_fields(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:48
static int sql_num_rows(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:59
static sql_rcode_t sql_select_query(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config, UNUSED char const *query)
Definition: rlm_sql_null.c:53
static sql_rcode_t sql_free_result(rlm_sql_handle_t *, rlm_sql_config_t *)
char const * name
Definition: rlm_sql.h:191
sql_rcode_t
Definition: rlm_sql.h:44
Definition: rlm_sql.h:61
static sql_rcode_t sql_query(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config, UNUSED char const *query)
Definition: rlm_sql_null.c:42
void * conn
Database specific connection handle.
Definition: rlm_sql.h:153
static sql_rcode_t sql_fetch_row(rlm_sql_row_t *out, UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:64
static const void * fake
Definition: rlm_sql_null.c:33
static sql_rcode_t sql_finish_select_query(UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Definition: rlm_sql_null.c:91
static size_t sql_error(UNUSED TALLOC_CTX *ctx, UNUSED sql_log_entry_t out[], UNUSED size_t outlen, UNUSED rlm_sql_handle_t *handle, UNUSED rlm_sql_config_t *config)
Stub function for retrieving errors, should not be called.
Definition: rlm_sql_null.c:80
#define RCSID(id)
Definition: build.h:135