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_channel_change(SilcServer server,
101                                             SilcSocketConnection sock,
102                                             int broadcast,
103                                             SilcChannelID *old_id,
104                                             SilcChannelID *new_id,
105                                             unsigned int id_len);
106 void silc_server_send_notify_nick_change(SilcServer server,
107                                          SilcSocketConnection sock,
108                                          int broadcast,
109                                          SilcClientID *old_id,
110                                          SilcClientID *new_id,
111                                          unsigned int id_len);
112 void silc_server_send_notify_join(SilcServer server,
113                                   SilcSocketConnection sock,
114                                   int broadcast,
115                                   SilcChannelEntry channel,
116                                   SilcClientID *client_id,
117                                   unsigned int client_id_len);
118 void silc_server_send_notify_leave(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_cmode(SilcServer server,
125                                    SilcSocketConnection sock,
126                                    int broadcast,
127                                    SilcChannelEntry channel,
128                                    unsigned int mode_mask,
129                                    SilcClientID *client_id,
130                                    unsigned int client_id_len,
131                                    char *cipher, char *hmac);
132 void silc_server_send_notify_cumode(SilcServer server,
133                                     SilcSocketConnection sock,
134                                     int broadcast,
135                                     SilcChannelEntry channel,
136                                     unsigned int mode_mask,
137                                     SilcClientID *client_id,
138                                     unsigned int client_id_len,
139                                     SilcClientID *target,
140                                     unsigned int target_len);
141 void silc_server_send_notify_signoff(SilcServer server,
142                                      SilcSocketConnection sock,
143                                      int broadcast,
144                                      SilcClientID *client_id,
145                                      unsigned int client_id_len,
146                                      char *message);
147 void silc_server_send_notify_server_signoff(SilcServer server,
148                                             SilcSocketConnection sock,
149                                             int broadcast,
150                                             SilcServerID *server_id,
151                                             unsigned int server_id_len);
152 void silc_server_send_notify_topic_set(SilcServer server,
153                                        SilcSocketConnection sock,
154                                        int broadcast,
155                                        SilcChannelEntry channel,
156                                        SilcClientID *client_id,
157                                        unsigned int client_id_len,
158                                        char *topic);
159 void silc_server_send_notify_kicked(SilcServer server,
160                                     SilcSocketConnection sock,
161                                     int broadcast,
162                                     SilcChannelEntry channel,
163                                     SilcClientID *client_id,
164                                     unsigned int client_id_len,
165                                     char *comment);
166 void silc_server_send_notify_killed(SilcServer server,
167                                     SilcSocketConnection sock,
168                                     int broadcast,
169                                     SilcClientID *client_id,
170                                     unsigned int client_id_len,
171                                     char *comment);
172 void silc_server_send_notify_umode(SilcServer server,
173                                    SilcSocketConnection sock,
174                                    int broadcast,
175                                    SilcClientID *client_id,
176                                    unsigned int client_id_len,
177                                    unsigned int mode_mask);
178 void silc_server_send_notify_ban(SilcServer server,
179                                  SilcSocketConnection sock,
180                                  int broadcast,
181                                  SilcChannelEntry channel,
182                                  char *add, char *del);
183 void silc_server_send_notify_invite(SilcServer server,
184                                     SilcSocketConnection sock,
185                                     int broadcast,
186                                     SilcChannelEntry channel,
187                                     SilcClientID *client_id,
188                                     unsigned int client_id_len,
189                                     char *add, char *del);
190 void silc_server_send_notify_dest(SilcServer server,
191                                   SilcSocketConnection sock,
192                                   int broadcast,
193                                   void *dest_id,
194                                   SilcIdType dest_id_type,
195                                   SilcNotifyType type,
196                                   unsigned int argc, ...);
197 void silc_server_send_notify_to_channel(SilcServer server,
198                                         SilcSocketConnection sender,
199                                         SilcChannelEntry channel,
200                                         unsigned char route_notify,
201                                         SilcNotifyType type,
202                                         unsigned int argc, ...);
203 void silc_server_send_notify_on_channels(SilcServer server,
204                                          SilcClientEntry sender,
205                                          SilcClientEntry client,
206                                          SilcNotifyType type,
207                                          unsigned int argc, ...);
208 void silc_server_send_new_id(SilcServer server,
209                              SilcSocketConnection sock,
210                              int broadcast,
211                              void *id, SilcIdType id_type, 
212                              unsigned int id_len);
213 void silc_server_send_new_channel(SilcServer server,
214                                   SilcSocketConnection sock,
215                                   int broadcast,
216                                   char *channel_name,
217                                   void *channel_id, 
218                                   unsigned int channel_id_len,
219                                   unsigned int mode);
220 void silc_server_send_channel_key(SilcServer server,
221                                   SilcSocketConnection sender,
222                                   SilcChannelEntry channel,
223                                   unsigned char route);
224 void silc_server_send_command(SilcServer server, 
225                               SilcSocketConnection sock,
226                               SilcCommand command, 
227                               unsigned int 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                               SilcPacketContext *packet,
235                               int force_send);
236 void silc_server_send_connection_auth_request(SilcServer server,
237                                               SilcSocketConnection sock,
238                                               unsigned short conn_type,
239                                               SilcAuthMethod auth_meth);
240
241 #endif