+#define SILC_BACKUP_ROUTER 2
+
+/* Default parameter values */
+
+/* Connection retry timeout. We implement exponential backoff algorithm
+ in connection retry. The interval of timeout grows when retry count
+ grows. */
+#define SILC_SERVER_RETRY_COUNT 7 /* Max retry count */
+#define SILC_SERVER_RETRY_MULTIPLIER 2 /* Interval growth */
+#define SILC_SERVER_RETRY_RANDOMIZER 2 /* timeout += rnd % 2 */
+#define SILC_SERVER_RETRY_INTERVAL_MIN 10 /* Min retry timeout */
+#define SILC_SERVER_RETRY_INTERVAL_MAX 600 /* Max generated timeout */
+
+#define SILC_SERVER_KEEPALIVE 300 /* Heartbeat interval */
+#define SILC_SERVER_CHANNEL_REKEY 3600 /* Channel rekey interval */
+#define SILC_SERVER_REKEY 3600 /* Session rekey interval */
+#define SILC_SERVER_SKE_TIMEOUT 60 /* SKE timeout */
+#define SILC_SERVER_CONNAUTH_TIMEOUT 60 /* CONN_AUTH timeout */
+#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 */
+
+/* This macro is used to send notify messages with formatted string. The
+ string is formatted with arguments and the formatted string is sent as
+ argument. */
+#define SILC_SERVER_SEND_NOTIFY(server, sock, type, fmt) \
+do { \
+ char *__fmt__ = silc_format fmt; \
+ silc_server_send_notify(server, sock, FALSE, \
+ type, 1, __fmt__, strlen(__fmt__)); \
+ silc_free(__fmt__); \
+} while(0)
+
+/* Send notify to operators */
+#define SILC_SERVER_SEND_OPERS(server, route, local, type, fmt) \
+do { \
+ char *__fmt__ = silc_format fmt; \
+ silc_server_send_opers_notify(server, route, local, \
+ type, 1, __fmt__, strlen(__fmt__)); \
+ silc_free(__fmt__); \
+} while(0)
+
+/* Check whether rekey protocol is active */
+#define SILC_SERVER_IS_REKEY(sock) \
+ (sock->protocol && sock->protocol->protocol && \
+ sock->protocol->protocol->type == SILC_PROTOCOL_SERVER_REKEY)
+
+/* 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)