#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);
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);
int silc_server_remove_from_one_channel(SilcServer server,
SilcSocketConnection sock,
SilcChannelEntry channel,
- SilcClientEntry client);
+ SilcClientEntry client,
+ int notify);
int silc_server_client_on_channel(SilcClientEntry client,
SilcChannelEntry channel);
void silc_server_disconnect_remote(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,
unsigned int old_id_len,
void *new_id, SilcIdType new_id_type,
unsigned int new_id_len);
+void silc_server_send_remove_channel_user(SilcServer server,
+ SilcSocketConnection sock,
+ int broadcast,
+ void *client_id, void *channel_id);
void silc_server_replace_id(SilcServer server,
SilcSocketConnection sock,
SilcPacketContext *packet);
SilcPacketContext *packet);
void silc_server_new_id(SilcServer server, SilcSocketConnection sock,
SilcPacketContext *packet);
+void silc_server_remove_channel_user(SilcServer server,
+ SilcSocketConnection sock,
+ SilcPacketContext *packet);
#endif