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 void silc_server_send_notify_cumode(SilcServer server,
145                                     SilcSocketConnection sock,
146                                     bool broadcast,
147                                     SilcChannelEntry channel,
148                                     uint32 mode_mask,
149                                     void *id, SilcIdType id_type,
150                                     SilcClientID *target);
151 void silc_server_send_notify_signoff(SilcServer server,
152                                      SilcSocketConnection sock,
153                                      bool broadcast,
154                                      SilcClientID *client_id,
155                                      char *message);
156 void silc_server_send_notify_topic_set(SilcServer server,
157                                        SilcSocketConnection sock,
158                                        bool broadcast,
159                                        SilcChannelEntry channel,
160                                        SilcClientID *client_id,
161                                        char *topic);
162 void silc_server_send_notify_kicked(SilcServer server,
163                                     SilcSocketConnection sock,
164                                     bool broadcast,
165                                     SilcChannelEntry channel,
166                                     SilcClientID *client_id,
167                                     char *comment);
168 void silc_server_send_notify_killed(SilcServer server,
169                                     SilcSocketConnection sock,
170                                     bool broadcast,
171                                     SilcClientID *client_id,
172                                     char *comment);
173 void silc_server_send_notify_umode(SilcServer server,
174                                    SilcSocketConnection sock,
175                                    bool broadcast,
176                                    SilcClientID *client_id,
177                                    uint32 mode_mask);
178 void silc_server_send_notify_ban(SilcServer server,
179                                  SilcSocketConnection sock,
180                                  bool broadcast,
181                                  SilcChannelEntry channel,
182                                  char *add, char *del);
183 void silc_server_send_notify_invite(SilcServer server,
184                                     SilcSocketConnection sock,
185                                     bool broadcast,
186                                     SilcChannelEntry channel,
187                                     SilcClientID *client_id,
188                                     char *add, char *del);
189 void silc_server_send_notify_dest(SilcServer server,
190                                   SilcSocketConnection sock,
191                                   bool broadcast,
192                                   void *dest_id,
193                                   SilcIdType dest_id_type,
194                                   SilcNotifyType type,
195                                   uint32 argc, ...);
196 void silc_server_send_notify_to_channel(SilcServer server,
197                                         SilcSocketConnection sender,
198                                         SilcChannelEntry channel,
199                                         unsigned char route_notify,
200                                         SilcNotifyType type,
201                                         uint32 argc, ...);
202 void silc_server_send_notify_on_channels(SilcServer server,
203                                          SilcClientEntry sender,
204                                          SilcClientEntry client,
205                                          SilcNotifyType type,
206                                          uint32 argc, ...);
207 void silc_server_send_new_id(SilcServer server,
208                              SilcSocketConnection sock,
209                              bool broadcast,
210                              void *id, SilcIdType id_type, 
211                              uint32 id_len);
212 void silc_server_send_new_channel(SilcServer server,
213                                   SilcSocketConnection sock,
214                                   bool broadcast,
215                                   char *channel_name,
216                                   void *channel_id, 
217                                   uint32 channel_id_len,
218                                   uint32 mode);
219 void silc_server_send_channel_key(SilcServer server,
220                                   SilcSocketConnection sender,
221                                   SilcChannelEntry channel,
222                                   unsigned char route);
223 void silc_server_send_command(SilcServer server, 
224                               SilcSocketConnection sock,
225                               SilcCommand command, 
226                               uint16 ident,
227                               uint32 argc, ...);
228 void silc_server_send_heartbeat(SilcServer server,
229                                 SilcSocketConnection sock);
230 void silc_server_relay_packet(SilcServer server,
231                               SilcSocketConnection dst_sock,
232                               SilcCipher cipher,
233                               SilcHmac hmac,
234                               uint32 sequence,
235                               SilcPacketContext *packet,
236                               bool force_send);
237 void silc_server_send_connection_auth_request(SilcServer server,
238                                               SilcSocketConnection sock,
239                                               uint16 conn_type,
240                                               SilcAuthMethod auth_meth);
241 void silc_server_packet_queue_purge(SilcServer server,
242                                     SilcSocketConnection sock);
243
244 #endif