updates.
[silc.git] / apps / silcd / packet_send.h
1 /*
2
3   packet_send.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2002 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20
21 #ifndef PACKET_SEND_H
22 #define PACKET_SEND_H
23
24 /* Prototypes */
25
26 int silc_server_packet_send_real(SilcServer server,
27                                  SilcSocketConnection sock,
28                                  bool force_send);
29 void silc_server_packet_send(SilcServer server,
30                              SilcSocketConnection sock, 
31                              SilcPacketType type, 
32                              SilcPacketFlags flags,
33                              unsigned char *data, 
34                              SilcUInt32 data_len,
35                              bool force_send);
36 void silc_server_packet_send_dest(SilcServer server,
37                                   SilcSocketConnection sock, 
38                                   SilcPacketType type, 
39                                   SilcPacketFlags flags,
40                                   void *dst_id,
41                                   SilcIdType dst_id_type,
42                                   unsigned char *data, 
43                                   SilcUInt32 data_len,
44                                   bool force_send);
45 void silc_server_packet_send_srcdest(SilcServer server,
46                                      SilcSocketConnection sock, 
47                                      SilcPacketType type, 
48                                      SilcPacketFlags flags,
49                                      void *src_id,
50                                      SilcIdType src_id_type,
51                                      void *dst_id,
52                                      SilcIdType dst_id_type,
53                                      unsigned char *data, 
54                                      SilcUInt32 data_len,
55                                      bool force_send);
56 void silc_server_packet_broadcast(SilcServer server,
57                                   SilcSocketConnection sock,
58                                   SilcPacketContext *packet);
59 void silc_server_packet_route(SilcServer server,
60                               SilcSocketConnection sock,
61                               SilcPacketContext *packet);
62 void silc_server_packet_send_clients(SilcServer server,
63                                      SilcClientEntry *clients,
64                                      SilcUInt32 clients_count,
65                                      SilcPacketType type, 
66                                      SilcPacketFlags flags,
67                                      bool route,
68                                      unsigned char *data, 
69                                      SilcUInt32 data_len,
70                                      bool force_send);
71 void silc_server_packet_send_to_channel(SilcServer server,
72                                         SilcSocketConnection sender,
73                                         SilcChannelEntry channel,
74                                         SilcPacketType type,
75                                         bool route,
76                                         unsigned char *data,
77                                         SilcUInt32 data_len,
78                                         bool force_send);
79 void silc_server_packet_relay_to_channel(SilcServer server,
80                                          SilcSocketConnection sender_sock,
81                                          SilcChannelEntry channel,
82                                          void *sender_id, 
83                                          SilcIdType sender_type,
84                                          SilcClientEntry sender_entry,
85                                          unsigned char *data,
86                                          SilcUInt32 data_len,
87                                          bool force_send);
88 void silc_server_packet_send_local_channel(SilcServer server,
89                                            SilcChannelEntry channel,
90                                            SilcPacketType type,
91                                            SilcPacketFlags flags,
92                                            unsigned char *data,
93                                            SilcUInt32 data_len,
94                                            bool force_send);
95 void silc_server_send_private_message(SilcServer server,
96                                       SilcSocketConnection dst_sock,
97                                       SilcCipher cipher,
98                                       SilcHmac hmac,
99                                       SilcUInt32 sequence,
100                                       SilcPacketContext *packet);
101 void silc_server_send_motd(SilcServer server,
102                            SilcSocketConnection sock);
103 void silc_server_send_error(SilcServer server,
104                             SilcSocketConnection sock,
105                             const char *fmt, ...);
106 void silc_server_send_notify(SilcServer server,
107                              SilcSocketConnection sock,
108                              bool broadcast,
109                              SilcNotifyType type,
110                              SilcUInt32 argc, ...);
111 void silc_server_send_notify_args(SilcServer server,
112                                   SilcSocketConnection sock,
113                                   bool broadcast,
114                                   SilcNotifyType type,
115                                   SilcUInt32 argc,
116                                   SilcBuffer args);
117 void silc_server_send_notify_channel_change(SilcServer server,
118                                             SilcSocketConnection sock,
119                                             bool broadcast,
120                                             SilcChannelID *old_id,
121                                             SilcChannelID *new_id);
122 void silc_server_send_notify_nick_change(SilcServer server,
123                                          SilcSocketConnection sock,
124                                          bool broadcast,
125                                          SilcClientID *old_id,
126                                          SilcClientID *new_id,
127                                          const char *nickname);
128 void silc_server_send_notify_join(SilcServer server,
129                                   SilcSocketConnection sock,
130                                   bool broadcast,
131                                   SilcChannelEntry channel,
132                                   SilcClientID *client_id);
133 void silc_server_send_notify_leave(SilcServer server,
134                                    SilcSocketConnection sock,
135                                    bool broadcast,
136                                    SilcChannelEntry channel,
137                                    SilcClientID *client_id);
138 void silc_server_send_notify_cmode(SilcServer server,
139                                    SilcSocketConnection sock,
140                                    bool broadcast,
141                                    SilcChannelEntry channel,
142                                    SilcUInt32 mode_mask,
143                                    void *id, SilcIdType id_type,
144                                    const char *cipher, const char *hmac,
145                                    const char *passphrase,
146                                    SilcPublicKey founder_key);
147 void silc_server_send_notify_cumode(SilcServer server,
148                                     SilcSocketConnection sock,
149                                     bool broadcast,
150                                     SilcChannelEntry channel,
151                                     SilcUInt32 mode_mask,
152                                     void *id, SilcIdType id_type,
153                                     SilcClientID *target,
154                                     SilcPublicKey founder_key);
155 void silc_server_send_notify_signoff(SilcServer server,
156                                      SilcSocketConnection sock,
157                                      bool broadcast,
158                                      SilcClientID *client_id,
159                                      const char *message);
160 void silc_server_send_notify_topic_set(SilcServer server,
161                                        SilcSocketConnection sock,
162                                        bool broadcast,
163                                        SilcChannelEntry channel,
164                                        void *id, SilcIdType id_type,
165                                        char *topic);
166 void silc_server_send_notify_kicked(SilcServer server,
167                                     SilcSocketConnection sock,
168                                     bool broadcast,
169                                     SilcChannelEntry channel,
170                                     SilcClientID *client_id,
171                                     SilcClientID *kicker,
172                                     char *comment);
173 void silc_server_send_notify_killed(SilcServer server,
174                                     SilcSocketConnection sock,
175                                     bool broadcast,
176                                     SilcClientID *client_id,
177                                     const char *comment,
178                                     void *killer, SilcIdType killer_type);
179 void silc_server_send_notify_umode(SilcServer server,
180                                    SilcSocketConnection sock,
181                                    bool broadcast,
182                                    SilcClientID *client_id,
183                                    SilcUInt32 mode_mask);
184 void silc_server_send_notify_ban(SilcServer server,
185                                  SilcSocketConnection sock,
186                                  bool broadcast,
187                                  SilcChannelEntry channel,
188                                  char *add, char *del);
189 void silc_server_send_notify_invite(SilcServer server,
190                                     SilcSocketConnection sock,
191                                     bool broadcast,
192                                     SilcChannelEntry channel,
193                                     SilcClientID *client_id,
194                                     char *add, char *del);
195 void silc_server_send_notify_watch(SilcServer server,
196                                    SilcSocketConnection sock,
197                                    SilcClientEntry watcher,
198                                    SilcClientEntry client,
199                                    const char *nickname,
200                                    SilcNotifyType type);
201 void silc_server_send_notify_dest(SilcServer server,
202                                   SilcSocketConnection sock,
203                                   bool broadcast,
204                                   void *dest_id,
205                                   SilcIdType dest_id_type,
206                                   SilcNotifyType type,
207                                   SilcUInt32 argc, ...);
208 void silc_server_send_notify_to_channel(SilcServer server,
209                                         SilcSocketConnection sender,
210                                         SilcChannelEntry channel,
211                                         bool route_notify,
212                                         SilcNotifyType type,
213                                         SilcUInt32 argc, ...);
214 void silc_server_send_notify_on_channels(SilcServer server,
215                                          SilcClientEntry sender,
216                                          SilcClientEntry client,
217                                          SilcNotifyType type,
218                                          SilcUInt32 argc, ...);
219 void silc_server_send_new_id(SilcServer server,
220                              SilcSocketConnection sock,
221                              bool broadcast,
222                              void *id, SilcIdType id_type, 
223                              SilcUInt32 id_len);
224 void silc_server_send_new_channel(SilcServer server,
225                                   SilcSocketConnection sock,
226                                   bool broadcast,
227                                   char *channel_name,
228                                   void *channel_id, 
229                                   SilcUInt32 channel_id_len,
230                                   SilcUInt32 mode);
231 void silc_server_send_channel_key(SilcServer server,
232                                   SilcSocketConnection sender,
233                                   SilcChannelEntry channel,
234                                   unsigned char route);
235 void silc_server_send_command(SilcServer server, 
236                               SilcSocketConnection sock,
237                               SilcCommand command, 
238                               SilcUInt16 ident,
239                               SilcUInt32 argc, ...);
240 void silc_server_send_command_reply(SilcServer server, 
241                                     SilcSocketConnection sock,
242                                     SilcCommand command, 
243                                     SilcStatus status,
244                                     SilcStatus error,
245                                     SilcUInt16 ident,
246                                     SilcUInt32 argc, ...);
247 void silc_server_send_dest_command_reply(SilcServer server, 
248                                          SilcSocketConnection sock,
249                                          void *dst_id,
250                                          SilcIdType dst_id_type,
251                                          SilcCommand command, 
252                                          SilcStatus status,
253                                          SilcStatus error,
254                                          SilcUInt16 ident,
255                                          SilcUInt32 argc, ...);
256 void silc_server_send_heartbeat(SilcServer server,
257                                 SilcSocketConnection sock);
258 void silc_server_relay_packet(SilcServer server,
259                               SilcSocketConnection dst_sock,
260                               SilcCipher cipher,
261                               SilcHmac hmac,
262                               SilcUInt32 sequence,
263                               SilcPacketContext *packet,
264                               bool force_send);
265 void silc_server_send_connection_auth_request(SilcServer server,
266                                               SilcSocketConnection sock,
267                                               SilcUInt16 conn_type,
268                                               SilcAuthMethod auth_meth);
269 void silc_server_packet_queue_purge(SilcServer server,
270                                     SilcSocketConnection sock);
271
272 #endif