Merged from silc_1_0_branch.
[silc.git] / apps / silcd / server.h
index e01f27b7175f16c22605f07635ef14a40d82b01b..1204b2449f59feb6bf3406b17db736bb5130ff97 100644 (file)
@@ -115,9 +115,21 @@ do {                                                                       \
   (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);
@@ -151,7 +163,7 @@ void silc_server_remove_from_channels(SilcServer 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,
@@ -237,6 +249,6 @@ SilcBuffer silc_server_get_client_channel_list(SilcServer server,
                                               bool get_private,
                                               bool get_secret,
                                               SilcBuffer *user_mode_list);
-void silc_server_stderr(char *message);
+void silc_server_stderr(SilcLogType type, char *message);
 
 #endif