Integer type name change.
[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                              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, 
83                                          SilcIdType sender_type,
84                                          void *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 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                                    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                                     SilcUInt32 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                                      const 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                                     SilcClientID *kicker,
169                                     char *comment);
170 void silc_server_send_notify_killed(SilcServer server,
171                                     SilcSocketConnection sock,
172                                     bool broadcast,
173                                     SilcClientID *client_id,
174                                     char *comment);
175 void silc_server_send_notify_umode(SilcServer server,
176                                    SilcSocketConnection sock,
177                                    bool broadcast,
178                                    SilcClientID *client_id,
179                                    SilcUInt32 mode_mask);
180 void silc_server_send_notify_ban(SilcServer server,
181                                  SilcSocketConnection sock,
182                                  bool broadcast,
183                                  SilcChannelEntry channel,
184                                  char *add, char *del);
185 void silc_server_send_notify_invite(SilcServer server,
186                                     SilcSocketConnection sock,
187                                     bool broadcast,
188                                     SilcChannelEntry channel,
189                                     SilcClientID *client_id,
190                                     char *add, char *del);
191 void silc_server_send_notify_dest(SilcServer server,
192                                   SilcSocketConnection sock,
193                                   bool broadcast,
194                                   void *dest_id,
195                                   SilcIdType dest_id_type,
196                                   SilcNotifyType type,
197                                   SilcUInt32 argc, ...);
198 void silc_server_send_notify_to_channel(SilcServer server,
199                                         SilcSocketConnection sender,
200                                         SilcChannelEntry channel,
201                                         bool route_notify,
202                                         SilcNotifyType type,
203                                         SilcUInt32 argc, ...);
204 void silc_server_send_notify_on_channels(SilcServer server,
205                                          SilcClientEntry sender,
206                                          SilcClientEntry client,
207                                          SilcNotifyType type,
208                                          SilcUInt32 argc, ...);
209 void silc_server_send_new_id(SilcServer server,
210                              SilcSocketConnection sock,
211                              bool broadcast,
212                              void *id, SilcIdType id_type, 
213                              SilcUInt32 id_len);
214 void silc_server_send_new_channel(SilcServer server,
215                                   SilcSocketConnection sock,
216                                   bool broadcast,
217                                   char *channel_name,
218                                   void *channel_id, 
219                                   SilcUInt32 channel_id_len,
220                                   SilcUInt32 mode);
221 void silc_server_send_channel_key(SilcServer server,
222                                   SilcSocketConnection sender,
223                                   SilcChannelEntry channel,
224                                   unsigned char route);
225 void silc_server_send_command(SilcServer server, 
226                               SilcSocketConnection sock,
227                               SilcCommand command, 
228                               SilcUInt16 ident,
229                               SilcUInt32 argc, ...);
230 void silc_server_send_command_reply(SilcServer server, 
231                                     SilcSocketConnection sock,
232                                     SilcCommand command, 
233                                     SilcCommandStatus status,
234                                     SilcUInt16 ident,
235                                     SilcUInt32 argc, ...);
236 void silc_server_send_dest_command_reply(SilcServer server, 
237                                          SilcSocketConnection sock,
238                                          void *dst_id,
239                                          SilcIdType dst_id_type,
240                                          SilcCommand command, 
241                                          SilcCommandStatus status,
242                                          SilcUInt16 ident,
243                                          SilcUInt32 argc, ...);
244 void silc_server_send_heartbeat(SilcServer server,
245                                 SilcSocketConnection sock);
246 void silc_server_relay_packet(SilcServer server,
247                               SilcSocketConnection dst_sock,
248                               SilcCipher cipher,
249                               SilcHmac hmac,
250                               SilcUInt32 sequence,
251                               SilcPacketContext *packet,
252                               bool force_send);
253 void silc_server_send_connection_auth_request(SilcServer server,
254                                               SilcSocketConnection sock,
255                                               SilcUInt16 conn_type,
256                                               SilcAuthMethod auth_meth);
257 void silc_server_packet_queue_purge(SilcServer server,
258                                     SilcSocketConnection sock);
259
260 #endif