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