5 * realms.h Structures, prototypes and global variables
12 #include <freeradius-devel/ident.h>
13 RCSIDH(realms_h, "$Id$")
19 #define HOME_TYPE_INVALID (0)
20 #define HOME_TYPE_AUTH (1)
21 #define HOME_TYPE_ACCT (2)
23 #define HOME_TYPE_COA (3)
26 #define HOME_PING_CHECK_NONE (0)
27 #define HOME_PING_CHECK_STATUS_SERVER (1)
28 #define HOME_PING_CHECK_REQUEST (2)
30 #define HOME_STATE_ALIVE (0)
31 #define HOME_STATE_ZOMBIE (1)
32 #define HOME_STATE_IS_DEAD (2)
34 typedef struct home_server {
38 const char *server; /* for internal proxying */
43 int type; /* auth/acct */
47 int num_connections; /* protected by proxy mutex */
48 int max_requests; /* for one connection */
53 * Maybe also have list of source IP/ports, && socket?
63 int max_outstanding; /* don't overload it */
64 int currently_outstanding;
65 int message_authenticator;
68 struct timeval revive_time;
69 struct timeval zombie_period_start;
70 int zombie_period; /* unresponsive for T, mark it dead */
75 const char *ping_user_name;
76 const char *ping_user_password;
79 int num_pings_to_alive;
80 int num_received_pings;
83 int revive_interval; /* if it doesn't support pings */
94 fr_ipaddr_t src_ipaddr; /* preferred source IP address */
103 typedef enum home_pool_type_t {
104 HOME_POOL_INVALID = 0,
105 HOME_POOL_LOAD_BALANCE,
107 HOME_POOL_CLIENT_BALANCE,
108 HOME_POOL_CLIENT_PORT_BALANCE,
109 HOME_POOL_KEYED_BALANCE
113 typedef struct home_pool_t {
115 home_pool_type_t type;
120 const char *virtual_server; /* for pre/post-proxy */
122 home_server *fallback;
124 int num_home_servers;
125 home_server *servers[1];
129 typedef struct _realm {
134 home_pool_t *auth_pool;
135 home_pool_t *acct_pool;
138 int realms_init(CONF_SECTION *config);
139 void realms_free(void);
140 REALM *realm_find(const char *name); /* name is from a packet */
141 REALM *realm_find2(const char *name); /* ... with name taken from realm_find */
143 home_server *home_server_ldb(const char *realmname, home_pool_t *pool, REQUEST *request);
144 home_server *home_server_find(fr_ipaddr_t *ipaddr, int port, int proto);
146 home_server *home_server_byname(const char *name, int type);
149 home_server *home_server_bynumber(int number);
151 home_pool_t *home_pool_byname(const char *name, int type);
157 #endif /* REALMS_H */