5 * realms.h Structures, prototypes and global variables
12 #include <freeradius-devel/ident.h>
13 RCSIDH(realms_h, "$Id$")
15 #define HOME_TYPE_INVALID (0)
16 #define HOME_TYPE_AUTH (1)
17 #define HOME_TYPE_ACCT (2)
19 #define HOME_PING_CHECK_NONE (0)
20 #define HOME_PING_CHECK_STATUS_SERVER (1)
21 #define HOME_PING_CHECK_REQUEST (2)
23 #define HOME_STATE_ALIVE (0)
24 #define HOME_STATE_ZOMBIE (1)
25 #define HOME_STATE_IS_DEAD (2)
27 typedef struct home_server {
36 int type; /* auth/acct */
39 * Maybe also have list of source IP/ports, && socket?
48 int max_outstanding; /* don't overload it */
49 int currently_outstanding;
50 uint32_t total_requests_sent;
52 struct timeval zombie_period_start;
53 int zombie_period; /* unresponsive for T, mark it dead */
58 const char *ping_user_name;
59 const char *ping_user_password;
62 int num_pings_to_alive;
63 int num_received_pings;
66 int revive_interval; /* if it doesn't support pings */
71 typedef enum home_pool_type_t {
72 HOME_POOL_INVALID = 0,
73 HOME_POOL_LOAD_BALANCE,
75 HOME_POOL_CLIENT_BALANCE,
76 HOME_POOL_CLIENT_PORT_BALANCE,
77 HOME_POOL_KEYED_BALANCE
81 typedef struct home_pool_t {
83 home_pool_type_t type;
88 const char *virtual_server;
91 home_server *servers[1];
95 typedef struct _realm {
100 home_pool_t *auth_pool;
101 home_pool_t *acct_pool;
104 int realms_init(CONF_SECTION *config);
105 void realms_free(void);
106 REALM *realm_find(const char *name);
108 home_server *home_server_ldb(const char *realmname, home_pool_t *pool, REQUEST *request);
109 home_server *home_server_find(fr_ipaddr_t *ipaddr, int port);
111 #endif /* REALMS_H */