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?
46 int max_outstanding; /* don't overload it */
47 int currently_outstanding;
49 struct timeval zombie_period_start;
50 int zombie_period; /* unresponsive for T, mark it dead */
55 const char *ping_user_name;
56 const char *ping_user_password;
59 int num_pings_to_alive;
60 int num_received_pings;
62 int revive_interval; /* if it doesn't support pings */
66 typedef enum home_pool_type_t {
67 HOME_POOL_INVALID = 0,
68 HOME_POOL_LOAD_BALANCE,
73 typedef struct home_pool_t {
75 home_pool_type_t type;
80 home_server *servers[1];
84 typedef struct _realm {
89 home_pool_t *auth_pool;
90 home_pool_t *acct_pool;
93 int realms_init(const char *filename);
94 void realms_free(void);
95 int realm_add(const char *filename, CONF_SECTION *cs);
96 REALM *realm_find(const char *name);
98 home_server *home_server_ldb(REALM *realm, int code);
99 home_server *home_server_find(lrad_ipaddr_t *ipaddr, int port);
101 #endif /* REALMS_H */