7d28f7746abc8e4d390b0b2cb160eddac8e39e85
[freeradius.git] / src / modules / rlm_sql / conf.h
1 #ifndef SQL_CONF_H
2 #define SQL_CONF_H
3 /***************************************************************************
4 *  conf.h                             rlm_sql - FreeRADIUS SQL Module      *
5 *                                                                          *
6 *      Configuration options for the SQL module                            *
7 *                                                                          *
8 *                                     Mike Machado <mike@innercite.com>    *
9 ***************************************************************************/
10
11 #include <freeradius-devel/ident.h>
12 RCSIDH(conf_h, "$Id$")
13
14 typedef struct sql_config {
15         char   *sql_driver;
16         char   *sql_server;
17         char   *sql_port;
18         char   *sql_login;
19         char   *sql_password;
20         char   *sql_db;
21         char   *query_user;
22         char   *default_profile;
23         char   *nas_query;
24         char   *authorize_check_query;
25         char   *authorize_reply_query;
26         char   *authorize_group_check_query;
27         char   *authorize_group_reply_query;
28         char   *accounting_onoff_query;
29         char   *accounting_update_query;
30         char   *accounting_update_query_alt;
31         char   *accounting_start_query;
32         char   *accounting_start_query_alt;
33         char   *accounting_stop_query;
34         char   *accounting_stop_query_alt;
35         char   *simul_count_query;
36         char   *simul_verify_query;
37         char   *groupmemb_query;
38         int     sqltrace;
39         int     do_clients;
40         int     read_groups;
41         char   *tracefile;
42         char   *xlat_name;
43         int     deletestalesessions;
44         int     num_sql_socks;
45         int     lifetime;
46         int     max_queries;
47         int     connect_failure_retry_delay;
48         char   *postauth_query;
49         char   *allowed_chars;
50         int     query_timeout;
51
52         /* individual driver config */
53         void    *localcfg;
54
55 } SQL_CONFIG;
56
57
58 #define CHECKRAD1               "/usr/sbin/checkrad"
59 #define CHECKRAD2               "/usr/local/sbin/checkrad"
60
61 /* Hack for funky ascend ports on MAX 4048 (and probably others)
62    The "NAS-Port-Id" value is "xyyzz" where "x" = 1 for digital, 2 for analog;
63    "yy" = line number (1 for first PRI/T1/E1, 2 for second, so on);
64    "zz" = channel number (on the PRI or Channelized T1/E1).
65     This should work with normal terminal servers, unless you have a TS with
66         more than 9999 ports ;^).
67     The "ASCEND_CHANNELS_PER_LINE" is the number of channels for each line into
68         the unit.  For my US/PRI that's 23.  A US/T1 would be 24, and a
69         European E1 would be 30 (I think ... never had one ;^).
70     This will NOT change the "NAS-Port-Id" reported in the detail log.  This
71         is simply to fix the dynamic IP assignments a la Cistron.
72     WARNING: This hack works for me, but I only have one PRI!!!  I've not
73         tested it on 2 or more (or with models other than the Max 4048)
74     Use at your own risk!
75   -- dgreer@austintx.com
76 */
77
78 #define ASCEND_PORT_HACK
79 #define ASCEND_CHANNELS_PER_LINE        23
80 #define CISCO_ACCOUNTING_HACK
81
82 /* SQL defines */
83 #define MAX_QUERY_LEN                   4096
84 #define SQL_LOCK_LEN                    MAX_QUERY_LEN
85 #define SQLTRACEFILE                    RADLOG_DIR "/sqltrace.sql"
86
87 /* SQL Errors */
88 #define SQL_DOWN                        1 /* for re-connect */
89
90 #define MAX_COMMUNITY_LEN               50
91 #define MAX_SQL_SOCKS                   256
92 #define MAX_TABLE_LEN                   20
93 #define MAX_AUTH_QUERY_LEN              256
94 #define AUTH_STRING_LEN                 128
95
96 #endif /* SQL_CONF_H */