The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
sql_fbapi.h
Go to the documentation of this file.
1#pragma once
2/*
3 * sql_fbapi.h Part of Firebird rlm_sql driver
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @copyright 2006 The FreeRADIUS server project
20 * @copyright 2006 Vitaly Bodzhgua (vitaly@eastera.net)
21 */
22RCSIDH(sql_fbapi_h, "$Id: 8417085a1adabb57913767fff9b70fcd53645290 $")
23
24#include <stdlib.h>
25#include <string.h>
26#include <ibase.h>
27
28#include <freeradius-devel/server/base.h>
29#include "rlm_sql.h"
30
31#define IS_ISC_ERROR(status) ((status[0] == 1) && (status[1] > 0))
32
33#define DEADLOCK_SQL_CODE -913
34#define DOWN_SQL_CODE -902
35#define DUPLICATE_KEY_SQL_CODE -803
36
37typedef struct {
38 isc_db_handle dbh;
39 isc_stmt_handle stmt;
40 isc_tr_handle trh;
41
42 ISC_STATUS status[20]; //!< Magic interbase status code array (holds multiple error codes used
43 //!< to construct more detailed error messages.
44
45 ISC_LONG sql_code;
46 XSQLDA *sqlda_out;
49 char *tpb;
51 char *dpb;
53 char *error;
54
57
58
63int fb_sql_query(rlm_sql_firebird_conn_t *conn, char const *query);
66void fb_free_sqlda(XSQLDA *sqlda);
#define RCSIDH(h, id)
Definition build.h:604
static const conf_parser_t config[]
Definition base.c:162
Prototypes and functions for the SQL module.
char ** rlm_sql_row_t
Definition rlm_sql.h:59
sql_rcode_t
Action to take at end of an SQL query.
Definition rlm_sql.h:44
int fb_sql_query(rlm_sql_firebird_conn_t *conn, char const *query)
Definition sql_fbapi.c:396
isc_tr_handle trh
Definition sql_fbapi.h:40
int fb_connect(rlm_sql_firebird_conn_t *conn, rlm_sql_config_t const *config)
Definition sql_fbapi.c:271
isc_stmt_handle stmt
Definition sql_fbapi.h:39
int fb_rollback(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:447
int fb_error(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:63
isc_db_handle dbh
Definition sql_fbapi.h:38
int fb_fetch(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:331
void fb_free_sqlda(XSQLDA *sqlda)
Definition sql_fbapi.c:111
rlm_sql_row_t row
Definition sql_fbapi.h:55
sql_rcode_t fb_store_row(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:133
int fb_disconnect(rlm_sql_firebird_conn_t *conn)
int fb_commit(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:456
int fb_affected_rows(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:413
int fb_free_result(rlm_sql_firebird_conn_t *conn)
void fb_free_statement(rlm_sql_firebird_conn_t *conn)
Definition sql_fbapi.c:440