Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 1997 - 2002 Pekka Riikonen
+ Copyright (C) 1997 - 2005 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
SET_PARAM_DEFAULT(qos_bytes_limit, SILC_SERVER_QOS_BYTES_LIMIT);
SET_PARAM_DEFAULT(qos_limit_sec, SILC_SERVER_QOS_LIMIT_SEC);
SET_PARAM_DEFAULT(qos_limit_usec, SILC_SERVER_QOS_LIMIT_USEC);
+ SET_PARAM_DEFAULT(chlimit, SILC_SERVER_CH_JOIN_LIMIT);
#undef SET_PARAM_DEFAULT
}
if (auth_data && auth_data_len) {
if (!silc_utf8_valid(p, strlen(p))) {
*auth_data_len = silc_utf8_encoded_len(p, strlen(p),
- SILC_STRING_LANGUAGE);
+ SILC_STRING_LOCALE);
*auth_data = silc_calloc(*auth_data_len, sizeof(unsigned char));
- silc_utf8_encode(p, strlen(p), SILC_STRING_LANGUAGE, *auth_data,
+ silc_utf8_encode(p, strlen(p), SILC_STRING_LOCALE, *auth_data,
*auth_data_len);
} else {
*auth_data = (void *) strdup(p);
}
if (*auth_data &&
- silc_hash_table_find_ext(*auth_data, public_key, (void **)&cached_key,
+ silc_hash_table_find_ext(*auth_data, public_key, (void *)&cached_key,
NULL, silc_hash_public_key, NULL,
silc_hash_public_key_compare, NULL)) {
silc_pkcs_public_key_free(public_key);
NULL, NULL,
my_free_public_key, NULL,
TRUE);
+ SILC_LOG_DEBUG(("Adding public key '%s' to authentication cache",
+ public_key->identifier));
silc_hash_table_add(*auth_data, public_key, public_key);
}
} else
else if (!strcmp(name, "qos_limit_usec")) {
config->param.qos_limit_usec = *(SilcUInt32 *)val;
}
+ else if (!strcmp(name, "channel_join_limit")) {
+ config->param.chlimit = *(SilcUInt32 *)val;
+ }
else if (!strcmp(name, "debug_string")) {
CONFIG_IS_DOUBLE(config->debug_string);
config->debug_string = (*(char *)val ? strdup((char *) val) : NULL);
config->tmp = NULL;
return SILC_CONFIG_OK;
}
- SILC_SERVER_CONFIG_ALLOCTMP(SilcServerConfigConnParams);
+ if (!tmp) {
+ SILC_SERVER_CONFIG_ALLOCTMP(SilcServerConfigConnParams);
+ tmp->reconnect_keep_trying = TRUE;
+ }
if (!strcmp(name, "name")) {
CONFIG_IS_DOUBLE(tmp->name);
else if (!strcmp(name, "passphrase")) {
CONFIG_IS_DOUBLE(tmp->passphrase);
if (!my_parse_authdata(SILC_AUTH_PASSWORD, (char *) val,
- (void **)&tmp->passphrase,
+ (void *)&tmp->passphrase,
&tmp->passphrase_len)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
else if (!strcmp(name, "publickey")) {
if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
- (void **)&tmp->publickeys, NULL)) {
+ (void *)&tmp->publickeys, NULL)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
}
else if (!strcmp(name, "publickeydir")) {
- if (!my_parse_publickeydir((char *) val, (void **)&tmp->publickeys)) {
+ if (!my_parse_publickeydir((char *) val, (void *)&tmp->publickeys)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
else if (!strcmp(name, "passphrase")) {
CONFIG_IS_DOUBLE(tmp->passphrase);
if (!my_parse_authdata(SILC_AUTH_PASSWORD, (char *) val,
- (void **)&tmp->passphrase,
+ (void *)&tmp->passphrase,
&tmp->passphrase_len)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
else if (!strcmp(name, "publickey")) {
if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
- (void **)&tmp->publickeys, NULL)) {
- got_errno = SILC_CONFIG_EPRINTLINE;
- goto got_err;
- }
- }
- else if (!strcmp(name, "publickeydir")) {
- if (!my_parse_publickeydir((char *) val, (void **)&tmp->publickeys)) {
+ (void *)&tmp->publickeys, NULL)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
else if (!strcmp(name, "passphrase")) {
CONFIG_IS_DOUBLE(tmp->passphrase);
if (!my_parse_authdata(SILC_AUTH_PASSWORD, (char *) val,
- (void **)&tmp->passphrase,
+ (void *)&tmp->passphrase,
&tmp->passphrase_len)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
else if (!strcmp(name, "publickey")) {
CONFIG_IS_DOUBLE(tmp->publickeys);
if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
- (void **)&tmp->publickeys, NULL)) {
+ (void *)&tmp->publickeys, NULL)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
else if (!strcmp(name, "passphrase")) {
CONFIG_IS_DOUBLE(tmp->passphrase);
if (!my_parse_authdata(SILC_AUTH_PASSWORD, (char *) val,
- (void **)&tmp->passphrase,
+ (void *)&tmp->passphrase,
&tmp->passphrase_len)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
else if (!strcmp(name, "publickey")) {
CONFIG_IS_DOUBLE(tmp->publickeys);
if (!my_parse_authdata(SILC_AUTH_PUBLIC_KEY, (char *) val,
- (void **)&tmp->publickeys, NULL)) {
+ (void *)&tmp->publickeys, NULL)) {
got_errno = SILC_CONFIG_EPRINTLINE;
goto got_err;
}
{ "qos_bytes_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "qos_limit_sec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "qos_limit_usec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
+ { "channel_join_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
{ "debug_string", SILC_CONFIG_ARG_STR, fetch_generic, NULL },
{ 0, 0, 0, 0 }
};
{ "version_software", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
{ "version_software_vendor", SILC_CONFIG_ARG_STR, fetch_connparam, NULL },
{ "anonymous", SILC_CONFIG_ARG_TOGGLE, fetch_connparam, NULL },
- { "qos", SILC_CONFIG_ARG_TOGGLE, fetch_generic, NULL },
- { "qos_rate_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
- { "qos_bytes_limit", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
- { "qos_limit_sec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
- { "qos_limit_usec", SILC_CONFIG_ARG_INT, fetch_generic, NULL },
+ { "qos", SILC_CONFIG_ARG_TOGGLE, fetch_connparam, NULL },
+ { "qos_rate_limit", SILC_CONFIG_ARG_INT, fetch_connparam, NULL },
+ { "qos_bytes_limit", SILC_CONFIG_ARG_INT, fetch_connparam, NULL },
+ { "qos_limit_sec", SILC_CONFIG_ARG_INT, fetch_connparam, NULL },
+ { "qos_limit_usec", SILC_CONFIG_ARG_INT, fetch_connparam, NULL },
{ 0, 0, 0, 0 }
};
{ "nick", SILC_CONFIG_ARG_STRE, fetch_admin, NULL },
{ "passphrase", SILC_CONFIG_ARG_STR, fetch_admin, NULL },
{ "publickey", SILC_CONFIG_ARG_STR, fetch_admin, NULL },
- { "publickeydir", SILC_CONFIG_ARG_STR, fetch_admin, NULL },
{ "port", SILC_CONFIG_ARG_INT, fetch_admin, NULL },
{ "params", SILC_CONFIG_ARG_STR, fetch_admin, NULL },
{ 0, 0, 0, 0 }
"connection. You have marked it incorrectly as backup router."));
ret = FALSE;
}
+#if 0
if (config->routers && config->routers->initiator == FALSE &&
config->routers->backup_router == FALSE) {
SILC_SERVER_LOG_ERROR((
"connection and it must be marked as Initiator."));
ret = FALSE;
}
+#endif
if (config->routers && config->routers->backup_router == TRUE &&
!config->servers && !config->routers->next) {
SILC_SERVER_LOG_ERROR((
"same host.", r->host));
ret = FALSE;
}
+
+ if (r->initiator == FALSE && r->port != 0) {
+ SILC_SERVER_LOG_WARNING(("\nWarning: Initiator is FALSE and Port is "
+ "specified. Ignoring Port value."));
+ r->port = 0;
+ }
}
-
+
/* ServerConnection sanity checks */
-
+
for (s = config->servers; s; s = s->next) {
if (s->backup_router) {
b = TRUE;
/* general config defaults */
config_new->refcount = 1;
config_new->logging_timestamp = TRUE;
+ config_new->param.reconnect_keep_trying = TRUE;
/* obtain a config file object */
file = silc_config_open(filename);
SILC_LOG_DEBUG(("Setting configured log file names and options"));
- silc_log_timestamp = config->logging_timestamp;
- silc_log_quick = config->logging_quick;
- silc_log_flushdelay = (config->logging_flushdelay ?
- config->logging_flushdelay :
- SILC_SERVER_LOG_FLUSH_DELAY);
+ silc_log_timestamp(config->logging_timestamp);
+ silc_log_quick(config->logging_quick);
+ silc_log_flushdelay(config->logging_flushdelay ?
+ config->logging_flushdelay :
+ SILC_SERVER_LOG_FLUSH_DELAY);
if ((this = config->logging_fatals))
silc_log_set_file(SILC_LOG_FATAL, this->file, this->maxsize,