1 #ifndef __SILC_SERVER_H
2 #define __SILC_SERVER_H
4 #include "chat-protocols.h"
7 /* returns SILC_SERVER_REC if it's SILC server, NULL if it isn't */
8 #define SILC_SERVER(server) \
9 PROTO_CHECK_CAST(SERVER(server), SILC_SERVER_REC, chat_type, "SILC")
10 #define SILC_SERVER_CONNECT(conn) \
11 PROTO_CHECK_CAST(SERVER_CONNECT(conn), SILC_SERVER_CONNECT_REC, \
13 #define IS_SILC_SERVER(server) \
14 (SILC_SERVER(server) ? TRUE : FALSE)
15 #define IS_SILC_SERVER_CONNECT(conn) \
16 (SILC_SERVER_CONNECT(conn) ? TRUE : FALSE)
18 /* all strings should be either NULL or dynamically allocated */
19 /* address and nick are mandatory, rest are optional */
21 #include "server-connect-rec.h"
22 } SILC_SERVER_CONNECT_REC;
25 SilcClientEntry client_entry;
26 SilcClientConnection conn;
32 #define STRUCT_SERVER_CONNECT_REC SILC_SERVER_CONNECT_REC
34 #include "server-rec.h"
35 /* Command sending queue */
36 int cmdcount; /* number of commands in `cmdqueue'. Can be more than
37 there actually is, to make flood control remember
38 how many messages can be sent before starting the
40 int cmd_last_split; /* Last command wasn't sent entirely to server.
41 First item in `cmdqueue' should be re-sent. */
43 GTimeVal last_cmd; /* last time command was sent to server */
45 GSList *idles; /* Idle queue - send these commands to server
46 if there's nothing else to do */
48 SilcDList ftp_sessions;
49 FtpSession current_session;
52 SilcClientConnection conn;
55 SILC_SERVER_REC *silc_server_connect(SILC_SERVER_CONNECT_REC *conn);
57 /* Return a string of all channels in server in server->channels_join()
59 char *silc_server_get_channels(SILC_SERVER_REC *server);
60 void silc_command_exec(SILC_SERVER_REC *server,
61 const char *command, const char *args);
62 void silc_server_init(void);
63 void silc_server_deinit(void);
64 void silc_server_free_ftp(SILC_SERVER_REC *server,
65 SilcClientEntry client_entry);