5 * realms.h Structures, prototypes and global variables
12 #include <freeradius-devel/ident.h>
13 RCSIDH(realms_h, "$Id$")
15 #define HOME_TYPE_AUTH (1)
16 #define HOME_TYPE_ACCT (2)
18 #define HOME_PING_CHECK_NONE (0)
19 #define HOME_PING_CHECK_STATUS_SERVER (1)
20 #define HOME_PING_CHECK_REQUEST (2)
22 #define HOME_STATE_ALIVE (0)
23 #define HOME_STATE_ZOMBIE (1)
24 #define HOME_STATE_IS_DEAD (2)
26 typedef struct home_server {
35 int type; /* auth/acct */
38 * Maybe also have list of source IP/ports, && socket?
47 int max_outstanding; /* don't overload it */
48 int currently_outstanding;
50 struct timeval zombie_period_start;
51 int zombie_period; /* unresponsive for T, mark it dead */
56 const char *ping_user_name;
57 const char *ping_user_password;
60 int num_pings_to_alive;
61 int num_received_pings;
64 int revive_interval; /* if it doesn't support pings */
68 typedef enum home_pool_type_t {
69 HOME_POOL_INVALID = 0,
70 HOME_POOL_LOAD_BALANCE,
72 HOME_POOL_CLIENT_BALANCE,
73 HOME_POOL_CLIENT_PORT_BALANCE
77 typedef struct home_pool_t {
79 home_pool_type_t type;
84 home_server *servers[1];
88 typedef struct _realm {
93 home_pool_t *auth_pool;
94 home_pool_t *acct_pool;
97 int realms_init(const char *filename);
98 void realms_free(void);
99 int realm_add(const char *filename, CONF_SECTION *cs);
100 REALM *realm_find(const char *name);
102 home_server *home_server_ldb(const char *realmname, home_pool_t *pool, REQUEST *request);
103 home_server *home_server_find(lrad_ipaddr_t *ipaddr, int port);
105 #endif /* REALMS_H */