#endif
} REALM;
+typedef struct realm_config realm_config_t;
+
int realms_init(CONF_SECTION *config);
void realms_free(void);
REALM *realm_find(char const *name); /* name is from a packet */
REALM *realm_find2(char const *name); /* ... with name taken from realm_find */
void realm_home_server_sanitize(home_server_t *home, CONF_SECTION *cs);
-int realm_home_server_add(home_server_t *home, CONF_SECTION *cs, int dual);
+int realm_home_server_add(realm_config_t *rc, home_server_t *home, CONF_SECTION *cs, int dual);
int realm_pool_add(home_pool_t *pool, CONF_SECTION *cs);
void realm_pool_free(home_pool_t *pool);
int realm_realm_add( REALM *r, CONF_SECTION *cs);
#endif /* HAVE_REGEX */
-typedef struct realm_config_t {
+struct realm_config {
CONF_SECTION *cs;
uint32_t dead_time;
uint32_t retry_count;
bool dynamic;
bool fallback;
bool wake_all_if_all_dead;
-} realm_config_t;
+};
static realm_config_t *realm_config = NULL;
static bool realms_initialized = false;
hs_srcipaddr = NULL;
- return realm_home_server_add(home, cs, dual);
+ return realm_home_server_add(rc, home, cs, dual);
}
-
-int realm_home_server_add(home_server_t *home, CONF_SECTION *cs, int dual)
+int realm_home_server_add(realm_config_t *rc, home_server_t *home, CONF_SECTION *cs, int dual)
{
const char *name2 = home->name;
realm_home_server_sanitize(home, cs);
if (dual) {
- home_server_t *home2 = talloc(home, home_server_t);
+ home_server_t *home2 = talloc(rc, home_server_t);
memcpy(home2, home, sizeof(*home2));