Channel public key support added.
[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 - 2003 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                                      SilcHashTable clients,
64                                      SilcPacketType type,
65                                      SilcPacketFlags flags,
66                                      bool route,
67                                      unsigned char *data,
68                                      SilcUInt32 data_len,
69                                      bool force_send);
70 void silc_server_packet_send_to_channel(SilcServer server,
71                                         SilcSocketConnection sender,
72                                         SilcChannelEntry channel,
73                                         SilcPacketType type,
74                                         bool route,
75                                         unsigned char *data,
76                                         SilcUInt32 data_len,
77                                         bool force_send);
78 void silc_server_packet_relay_to_channel(SilcServer server,
79                                          SilcSocketConnection sender_sock,
80                                          SilcChannelEntry channel,
81                                          void *sender_id,
82                                          SilcIdType sender_type,
83                                          SilcClientEntry sender_entry,
84                                          unsigned char *data,
85                                          SilcUInt32 data_len,
86                                          bool force_send);
87 void silc_server_packet_send_local_channel(SilcServer server,
88                                            SilcChannelEntry channel,
89                                            SilcPacketType type,
90                                            SilcPacketFlags flags,
91                                            unsigned char *data,
92                                            SilcUInt32 data_len,
93                                            bool force_send);
94 void silc_server_send_private_message(SilcServer server,
95                                       SilcSocketConnection dst_sock,
96                                       SilcCipher cipher,
97                                       SilcHmac hmac,
98                                       SilcUInt32 sequence,
99                                       SilcPacketContext *packet);
100 void silc_server_send_motd(SilcServer server,
101                            SilcSocketConnection sock);
102 void silc_server_send_error(SilcServer server,
103                             SilcSocketConnection sock,
104                             const char *fmt, ...);
105 void silc_server_send_notify(SilcServer server,
106                              SilcSocketConnection sock,
107                              bool broadcast,
108                              SilcNotifyType type,
109                              SilcUInt32 argc, ...);
110 void silc_server_send_notify_args(SilcServer server,
111                                   SilcSocketConnection sock,
112                                   bool broadcast,
113                                   SilcNotifyType type,
114                                   SilcUInt32 argc,
115                                   SilcBuffer args);
116 void silc_server_send_notify_channel_change(SilcServer server,
117                                             SilcSocketConnection sock,
118                                             bool broadcast,
119                                             SilcChannelID *old_id,
120                                             SilcChannelID *new_id);
121 void silc_server_send_notify_nick_change(SilcServer server,
122                                          SilcSocketConnection sock,
123                                          bool broadcast,
124                                          SilcClientID *old_id,
125                                          SilcClientID *new_id,
126                                          const char *nickname);
127 void silc_server_send_notify_join(SilcServer server,
128                                   SilcSocketConnection sock,
129                                   bool broadcast,
130                                   SilcChannelEntry channel,
131                                   SilcClientID *client_id);
132 void silc_server_send_notify_leave(SilcServer server,
133                                    SilcSocketConnection sock,
134                                    bool broadcast,
135                                    SilcChannelEntry channel,
136                                    SilcClientID *client_id);
137 void silc_server_send_notify_cmode(SilcServer server,
138                                    SilcSocketConnection sock,
139                                    bool broadcast,
140                                    SilcChannelEntry channel,
141                                    SilcUInt32 mode_mask,
142                                    void *id, SilcIdType id_type,
143                                    const char *cipher, const char *hmac,
144                                    const char *passphrase,
145                                    SilcPublicKey founder_key,
146                                    SilcBuffer channel_pubkeys);
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                                  unsigned char *action,
189                                  SilcBuffer list);
190 void silc_server_send_notify_invite(SilcServer server,
191                                     SilcSocketConnection sock,
192                                     bool broadcast,
193                                     SilcChannelEntry channel,
194                                     SilcClientID *client_id,
195                                     unsigned char *action,
196                                     SilcBuffer list);
197 void silc_server_send_notify_watch(SilcServer server,
198                                    SilcSocketConnection sock,
199                                    SilcClientEntry watcher,
200                                    SilcClientEntry client,
201                                    const char *nickname,
202                                    SilcNotifyType type);
203 void silc_server_send_notify_dest(SilcServer server,
204                                   SilcSocketConnection sock,
205                                   bool broadcast,
206                                   void *dest_id,
207                                   SilcIdType dest_id_type,
208                                   SilcNotifyType type,
209                                   SilcUInt32 argc, ...);
210 void silc_server_send_notify_to_channel(SilcServer server,
211                                         SilcSocketConnection sender,
212                                         SilcChannelEntry channel,
213                                         bool route_notify,
214                                         SilcNotifyType type,
215                                         SilcUInt32 argc, ...);
216 void silc_server_send_notify_on_channels(SilcServer server,
217                                          SilcClientEntry sender,
218                                          SilcClientEntry client,
219                                          SilcNotifyType type,
220                                          SilcUInt32 argc, ...);
221 void silc_server_send_new_id(SilcServer server,
222                              SilcSocketConnection sock,
223                              bool broadcast,
224                              void *id, SilcIdType id_type,
225                              SilcUInt32 id_len);
226 void silc_server_send_new_channel(SilcServer server,
227                                   SilcSocketConnection sock,
228                                   bool broadcast,
229                                   char *channel_name,
230                                   void *channel_id,
231                                   SilcUInt32 channel_id_len,
232                                   SilcUInt32 mode);
233 void silc_server_send_channel_key(SilcServer server,
234                                   SilcSocketConnection sender,
235                                   SilcChannelEntry channel,
236                                   unsigned char route);
237 void silc_server_send_command(SilcServer server,
238                               SilcSocketConnection sock,
239                               SilcCommand command,
240                               SilcUInt16 ident,
241                               SilcUInt32 argc, ...);
242 void silc_server_send_command_reply(SilcServer server,
243                                     SilcSocketConnection sock,
244                                     SilcCommand command,
245                                     SilcStatus status,
246                                     SilcStatus error,
247                                     SilcUInt16 ident,
248                                     SilcUInt32 argc, ...);
249 void silc_server_send_dest_command_reply(SilcServer server,
250                                          SilcSocketConnection sock,
251                                          void *dst_id,
252                                          SilcIdType dst_id_type,
253                                          SilcCommand command,
254                                          SilcStatus status,
255                                          SilcStatus error,
256                                          SilcUInt16 ident,
257                                          SilcUInt32 argc, ...);
258 void silc_server_send_heartbeat(SilcServer server,
259                                 SilcSocketConnection sock);
260 void silc_server_relay_packet(SilcServer server,
261                               SilcSocketConnection dst_sock,
262                               SilcCipher cipher,
263                               SilcHmac hmac,
264                               SilcUInt32 sequence,
265                               SilcPacketContext *packet,
266                               bool force_send);
267 void silc_server_send_connection_auth_request(SilcServer server,
268                                               SilcSocketConnection sock,
269                                               SilcUInt16 conn_type,
270                                               SilcAuthMethod auth_meth);
271 void silc_server_packet_queue_purge(SilcServer server,
272                                     SilcSocketConnection sock);
273 void silc_server_send_opers(SilcServer server,
274                             SilcPacketType type,
275                             SilcPacketFlags flags,
276                             bool route, bool local,
277                             unsigned char *data,
278                             SilcUInt32 data_len,
279                             bool force_send);
280 void silc_server_send_opers_notify(SilcServer server,
281                                    bool route,
282                                    bool local,
283                                    SilcNotifyType type,
284                                    SilcUInt32 argc, ...);
285
286 #endif