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