Author: Pekka Riikonen <priikone@silcnet.org>
- 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
/* General definitions */
/* SILC port */
-#define SILC_PORT 706;
+#define SILC_PORT 706
/* Server and router. Used internally by the code. */
#define SILC_SERVER 0
#define SILC_SERVER_MAX_CONNECTIONS 1000 /* Max connections */
#define SILC_SERVER_MAX_CONNECTIONS_SINGLE 1000 /* Max connections per host */
#define SILC_SERVER_LOG_FLUSH_DELAY 300 /* Default log flush delay */
+#define SILC_SERVER_QOS_RATE_LIMIT 10 /* Default QoS rate limit */
+#define SILC_SERVER_QOS_BYTES_LIMIT 2048 /* Default QoS bytes limit */
+#define SILC_SERVER_QOS_LIMIT_SEC 0 /* Default QoS limit sec */
+#define SILC_SERVER_QOS_LIMIT_USEC 500000 /* Default QoS limit usec */
/* Macros */
(sock->protocol && sock->protocol->protocol && \
sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY)
-/* Output an error message wether to stderr or LOG_ERROR if we are in the
- background. */
-#define SILC_SERVER_LOG_ERROR(fmt) silc_server_stderr(silc_format fmt)
+/* Check whether backup resuming protocol is active */
+#define SILC_SERVER_IS_BACKUP(sock) \
+ (sock->protocol && sock->protocol->protocol && \
+ sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_BACKUP)
+
+/* Output a message to stderr or to the appropriate log facility wether
+ we are in the background or not. */
+#define SILC_SERVER_LOG_INFO(fmt) \
+ silc_server_stderr(SILC_LOG_INFO, silc_format fmt)
+#define SILC_SERVER_LOG_WARNING(fmt) \
+ silc_server_stderr(SILC_LOG_WARNING, silc_format fmt)
+#define SILC_SERVER_LOG_ERROR(fmt) \
+ silc_server_stderr(SILC_LOG_ERROR, silc_format fmt)
+#define SILC_SERVER_LOG_FATAL(fmt) \
+ silc_server_stderr(SILC_LOG_WARNING, silc_format fmt)
/* Prototypes */
int silc_server_alloc(SilcServer *new_server);
SilcClientEntry client,
bool notify,
const char *signoff_message,
- bool keygen);
+ bool keygen, bool killed);
bool silc_server_remove_from_one_channel(SilcServer server,
SilcSocketConnection sock,
SilcChannelEntry channel,
SilcBuffer **channel_users_modes,
SilcUInt32 *channel_users_modes_c,
SilcBuffer **channel_topics,
+ SilcBuffer **channel_invites,
+ SilcBuffer **channel_bans,
SilcChannelID ***channel_ids,
unsigned long creation_time);
void silc_server_announce_servers(SilcServer server, bool global,
void silc_server_announce_channels(SilcServer server,
unsigned long creation_time,
SilcSocketConnection remote);
+void silc_server_announce_watches(SilcServer server,
+ SilcSocketConnection remote);
bool silc_server_get_users_on_channel(SilcServer server,
SilcChannelEntry channel,
SilcBuffer *user_list,
bool get_private,
bool get_secret,
SilcBuffer *user_mode_list);
-SilcClientEntry silc_server_get_client_resolve(SilcServer server,
- SilcClientID *client_id,
- bool always_resolve,
- bool *resolved);
-void silc_server_stderr(char *message);
+void silc_server_stderr(SilcLogType type, char *message);
#endif