updates.
[silc.git] / apps / silcd / packet_send.h
1 /*
2
3   packet_send.h
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6
7   Copyright (C) 1997 - 2001 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                              uint32 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                                   uint32 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                                      uint32 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                                      uint32 clients_count,
65                                      SilcPacketType type, 
66                                      SilcPacketFlags flags,
67                                      bool route,
68                                      unsigned char *data, 
69                                      uint32 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                                         uint32 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, 
83                                          SilcIdType sender_type,
84                                          void *sender_entry,
85                                          unsigned char *data,
86                                          uint32 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                                            uint32 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                                       uint32 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                              uint32 argc, ...);
111 void silc_server_send_notify_args(SilcServer server,
112                                   SilcSocketConnection sock,
113                                   bool broadcast,
114                                   SilcNotifyType type,
115                                   uint32 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 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                                    uint32 mode_mask,
142                                    void *id, SilcIdType id_type,
143                                    char *cipher, char *hmac,
144                                    char *passphrase);
145 void silc_server_send_notify_cumode(SilcServer server,
146                                     SilcSocketConnection sock,
147                                     bool broadcast,
148                                     SilcChannelEntry channel,
149                                     uint32 mode_mask,
150                                     void *id, SilcIdType id_type,
151                                     SilcClientID *target);
152 void silc_server_send_notify_signoff(SilcServer server,
153                                      SilcSocketConnection sock,
154                                      bool broadcast,
155                                      SilcClientID *client_id,
156                                      char *message);
157 void silc_server_send_notify_topic_set(SilcServer server,
158                                        SilcSocketConnection sock,
159                                        bool broadcast,
160                                        SilcChannelEntry channel,
161                                        void *id, SilcIdType id_type,
162                                        char *topic);
163 void silc_server_send_notify_kicked(SilcServer server,
164                                     SilcSocketConnection sock,
165                                     bool broadcast,
166                                     SilcChannelEntry channel,
167                                     SilcClientID *client_id,
168                                     char *comment);
169 void silc_server_send_notify_killed(SilcServer server,
170                                     SilcSocketConnection sock,
171                                     bool broadcast,
172                                     SilcClientID *client_id,
173                                     char *comment);
174 void silc_server_send_notify_umode(SilcServer server,
175                                    SilcSocketConnection sock,
176                                    bool broadcast,
177                                    SilcClientID *client_id,
178                                    uint32 mode_mask);
179 void silc_server_send_notify_ban(SilcServer server,
180                                  SilcSocketConnection sock,
181                                  bool broadcast,
182                                  SilcChannelEntry channel,
183                                  char *add, char *del);
184 void silc_server_send_notify_invite(SilcServer server,
185                                     SilcSocketConnection sock,
186                                     bool broadcast,
187                                     SilcChannelEntry channel,
188                                     SilcClientID *client_id,
189                                     char *add, char *del);
190 void silc_server_send_notify_dest(SilcServer server,
191                                   SilcSocketConnection sock,
192                                   bool broadcast,
193                                   void *dest_id,
194                                   SilcIdType dest_id_type,
195                                   SilcNotifyType type,
196                                   uint32 argc, ...);
197 void silc_server_send_notify_to_channel(SilcServer server,
198                                         SilcSocketConnection sender,
199                                         SilcChannelEntry channel,
200                                         bool route_notify,
201                                         SilcNotifyType type,
202                                         uint32 argc, ...);
203 void silc_server_send_notify_on_channels(SilcServer server,
204                                          SilcClientEntry sender,
205                                          SilcClientEntry client,
206                                          SilcNotifyType type,
207                                          uint32 argc, ...);
208 void silc_server_send_new_id(SilcServer server,
209                              SilcSocketConnection sock,
210                              bool broadcast,
211                              void *id, SilcIdType id_type, 
212                              uint32 id_len);
213 void silc_server_send_new_channel(SilcServer server,
214                                   SilcSocketConnection sock,
215                                   bool broadcast,
216                                   char *channel_name,
217                                   void *channel_id, 
218                                   uint32 channel_id_len,
219                                   uint32 mode);
220 void silc_server_send_channel_key(SilcServer server,
221                                   SilcSocketConnection sender,
222                                   SilcChannelEntry channel,
223                                   unsigned char route);
224 void silc_server_send_command(SilcServer server, 
225                               SilcSocketConnection sock,
226                               SilcCommand command, 
227                               uint16 ident,
228                               uint32 argc, ...);
229 void silc_server_send_command_reply(SilcServer server, 
230                                     SilcSocketConnection sock,
231                                     SilcCommand command, 
232                                     SilcCommandStatus status,
233                                     uint16 ident,
234                                     uint32 argc, ...);
235 void silc_server_send_dest_command_reply(SilcServer server, 
236                                          SilcSocketConnection sock,
237                                          void *dst_id,
238                                          SilcIdType dst_id_type,
239                                          SilcCommand command, 
240                                          SilcCommandStatus status,
241                                          uint16 ident,
242                                          uint32 argc, ...);
243 void silc_server_send_heartbeat(SilcServer server,
244                                 SilcSocketConnection sock);
245 void silc_server_relay_packet(SilcServer server,
246                               SilcSocketConnection dst_sock,
247                               SilcCipher cipher,
248                               SilcHmac hmac,
249                               uint32 sequence,
250                               SilcPacketContext *packet,
251                               bool force_send);
252 void silc_server_send_connection_auth_request(SilcServer server,
253                                               SilcSocketConnection sock,
254                                               uint16 conn_type,
255                                               SilcAuthMethod auth_meth);
256 void silc_server_packet_queue_purge(SilcServer server,
257                                     SilcSocketConnection sock);
258
259 #endif