A LOT updates. Cannot separate. :)
[silc.git] / apps / silcd / server.h
index 74ee74ae38921b123923b9da5681c528c726cc06..41379eab36342905ccee30bce80c8503f9dbf17a 100644 (file)
@@ -33,6 +33,18 @@ typedef struct SilcServerObjectStruct *SilcServer;
 #define SILC_SERVER 0
 #define SILC_ROUTER 1
 
+/* 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, type, 1, __fmt__, strlen(__fmt__)); \
+  silc_free(__fmt__);                                                      \
+} while(0);
+
 /* Prototypes */
 int silc_server_alloc(SilcServer *new_server);
 void silc_server_free(SilcServer server);
@@ -65,6 +77,7 @@ void silc_server_packet_forward(SilcServer server,
                                int force_send);
 void silc_server_packet_send_to_channel(SilcServer server,
                                        SilcChannelEntry channel,
+                                       SilcPacketType type,
                                        unsigned char *data,
                                        unsigned int data_len,
                                        int force_send);
@@ -112,20 +125,29 @@ void silc_server_channel_message(SilcServer server,
 void silc_server_channel_key(SilcServer server,
                             SilcSocketConnection sock,
                             SilcPacketContext *packet);
+void silc_server_send_motd(SilcServer server,
+                          SilcSocketConnection sock);
 void silc_server_send_error(SilcServer server,
                            SilcSocketConnection sock,
                            const char *fmt, ...);
 void silc_server_send_notify(SilcServer server,
                             SilcSocketConnection sock,
-                            const char *fmt, ...);
+                            SilcNotifyType type,
+                            unsigned int argc, ...);
 void silc_server_send_notify_dest(SilcServer server,
                                  SilcSocketConnection sock,
                                  void *dest_id,
                                  SilcIdType dest_id_type,
-                                 const char *fmt, ...);
+                                 SilcNotifyType type,
+                                 unsigned int argc, ...);
 void silc_server_send_notify_to_channel(SilcServer server,
                                        SilcChannelEntry channel,
-                                       const char *fmt, ...);
+                                       SilcNotifyType type,
+                                       unsigned int argc, ...);
+void silc_server_send_notify_on_channels(SilcServer server,
+                                        SilcClientEntry client,
+                                        SilcNotifyType type,
+                                        unsigned int argc, ...);
 void silc_server_send_new_id(SilcServer server,
                             SilcSocketConnection sock,
                             int broadcast,