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_to_channel(SilcServer server,
63                                         SilcSocketConnection sender,
64                                         SilcChannelEntry channel,
65                                         SilcPacketType type,
66                                         bool route,
67                                         unsigned char *data,
68                                         uint32 data_len,
69                                         bool force_send);
70 void silc_server_packet_relay_to_channel(SilcServer server,
71                                          SilcSocketConnection sender_sock,
72                                          SilcChannelEntry channel,
73                                          void *sender, 
74                                          SilcIdType sender_type,
75                                          void *sender_entry,
76                                          unsigned char *data,
77                                          uint32 data_len,
78                                          bool force_send);
79 void silc_server_packet_send_local_channel(SilcServer server,
80                                            SilcChannelEntry channel,
81                                            SilcPacketType type,
82                                            SilcPacketFlags flags,
83                                            unsigned char *data,
84                                            uint32 data_len,
85                                            bool force_send);
86 void silc_server_send_private_message(SilcServer server,
87                                       SilcSocketConnection dst_sock,
88                                       SilcCipher cipher,
89                                       SilcHmac hmac,
90                                       uint32 sequence,
91                                       SilcPacketContext *packet);
92 void silc_server_send_motd(SilcServer server,
93                            SilcSocketConnection sock);
94 void silc_server_send_error(SilcServer server,
95                             SilcSocketConnection sock,
96                             const char *fmt, ...);
97 void silc_server_send_notify(SilcServer server,
98                              SilcSocketConnection sock,
99                              bool broadcast,
100                              SilcNotifyType type,
101                              uint32 argc, ...);
102 void silc_server_send_notify_args(SilcServer server,
103                                   SilcSocketConnection sock,
104                                   bool broadcast,
105                                   SilcNotifyType type,
106                                   uint32 argc,
107                                   SilcBuffer args);
108 void silc_server_send_notify_channel_change(SilcServer server,
109                                             SilcSocketConnection sock,
110                                             bool broadcast,
111                                             SilcChannelID *old_id,
112                                             SilcChannelID *new_id);
113 void silc_server_send_notify_nick_change(SilcServer server,
114                                          SilcSocketConnection sock,
115                                          bool broadcast,
116                                          SilcClientID *old_id,
117                                          SilcClientID *new_id);
118 void silc_server_send_notify_join(SilcServer server,
119                                   SilcSocketConnection sock,
120                                   bool broadcast,
121                                   SilcChannelEntry channel,
122                                   SilcClientID *client_id);
123 void silc_server_send_notify_leave(SilcServer server,
124                                    SilcSocketConnection sock,
125                                    bool broadcast,
126                                    SilcChannelEntry channel,
127                                    SilcClientID *client_id);
128 void silc_server_send_notify_cmode(SilcServer server,
129                                    SilcSocketConnection sock,
130                                    bool broadcast,
131                                    SilcChannelEntry channel,
132                                    uint32 mode_mask,
133                                    void *id, SilcIdType id_type,
134                                    char *cipher, char *hmac);
135 void silc_server_send_notify_cumode(SilcServer server,
136                                     SilcSocketConnection sock,
137                                     bool broadcast,
138                                     SilcChannelEntry channel,
139                                     uint32 mode_mask,
140                                     void *id, SilcIdType id_type,
141                                     SilcClientID *target);
142 void silc_server_send_notify_signoff(SilcServer server,
143                                      SilcSocketConnection sock,
144                                      bool broadcast,
145                                      SilcClientID *client_id,
146                                      char *message);
147 void silc_server_send_notify_topic_set(SilcServer server,
148                                        SilcSocketConnection sock,
149                                        bool broadcast,
150                                        SilcChannelEntry channel,
151                                        SilcClientID *client_id,
152                                        char *topic);
153 void silc_server_send_notify_kicked(SilcServer server,
154                                     SilcSocketConnection sock,
155                                     bool broadcast,
156                                     SilcChannelEntry channel,
157                                     SilcClientID *client_id,
158                                     char *comment);
159 void silc_server_send_notify_killed(SilcServer server,
160                                     SilcSocketConnection sock,
161                                     bool broadcast,
162                                     SilcClientID *client_id,
163                                     char *comment);
164 void silc_server_send_notify_umode(SilcServer server,
165                                    SilcSocketConnection sock,
166                                    bool broadcast,
167                                    SilcClientID *client_id,
168                                    uint32 mode_mask);
169 void silc_server_send_notify_ban(SilcServer server,
170                                  SilcSocketConnection sock,
171                                  bool broadcast,
172                                  SilcChannelEntry channel,
173                                  char *add, char *del);
174 void silc_server_send_notify_invite(SilcServer server,
175                                     SilcSocketConnection sock,
176                                     bool broadcast,
177                                     SilcChannelEntry channel,
178                                     SilcClientID *client_id,
179                                     char *add, char *del);
180 void silc_server_send_notify_dest(SilcServer server,
181                                   SilcSocketConnection sock,
182                                   bool broadcast,
183                                   void *dest_id,
184                                   SilcIdType dest_id_type,
185                                   SilcNotifyType type,
186                                   uint32 argc, ...);
187 void silc_server_send_notify_to_channel(SilcServer server,
188                                         SilcSocketConnection sender,
189                                         SilcChannelEntry channel,
190                                         unsigned char route_notify,
191                                         SilcNotifyType type,
192                                         uint32 argc, ...);
193 void silc_server_send_notify_on_channels(SilcServer server,
194                                          SilcClientEntry sender,
195                                          SilcClientEntry client,
196                                          SilcNotifyType type,
197                                          uint32 argc, ...);
198 void silc_server_send_new_id(SilcServer server,
199                              SilcSocketConnection sock,
200                              bool broadcast,
201                              void *id, SilcIdType id_type, 
202                              uint32 id_len);
203 void silc_server_send_new_channel(SilcServer server,
204                                   SilcSocketConnection sock,
205                                   bool broadcast,
206                                   char *channel_name,
207                                   void *channel_id, 
208                                   uint32 channel_id_len,
209                                   uint32 mode);
210 void silc_server_send_channel_key(SilcServer server,
211                                   SilcSocketConnection sender,
212                                   SilcChannelEntry channel,
213                                   unsigned char route);
214 void silc_server_send_command(SilcServer server, 
215                               SilcSocketConnection sock,
216                               SilcCommand command, 
217                               uint16 ident,
218                               uint32 argc, ...);
219 void silc_server_send_heartbeat(SilcServer server,
220                                 SilcSocketConnection sock);
221 void silc_server_relay_packet(SilcServer server,
222                               SilcSocketConnection dst_sock,
223                               SilcCipher cipher,
224                               SilcHmac hmac,
225                               uint32 sequence,
226                               SilcPacketContext *packet,
227                               bool force_send);
228 void silc_server_send_connection_auth_request(SilcServer server,
229                                               SilcSocketConnection sock,
230                                               uint16 conn_type,
231                                               SilcAuthMethod auth_meth);
232 void silc_server_packet_queue_purge(SilcServer server,
233                                     SilcSocketConnection sock);
234
235 #endif