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 void silc_server_send_notify_cumode(SilcServer server,
132                                     SilcSocketConnection sock,
133                                     int broadcast,
134                                     SilcChannelEntry channel,
135                                     unsigned int mode_mask,
136                                     SilcClientID *client_id,
137                                     unsigned int client_id_len,
138                                     SilcClientID *target,
139                                     unsigned int target_len);
140 void silc_server_send_notify_signoff(SilcServer server,
141                                      SilcSocketConnection sock,
142                                      int broadcast,
143                                      SilcClientID *client_id,
144                                      unsigned int client_id_len,
145                                      char *message);
146 void silc_server_send_notify_server_signoff(SilcServer server,
147                                             SilcSocketConnection sock,
148                                             int broadcast,
149                                             SilcServerID *server_id,
150                                             unsigned int server_id_len);
151 void silc_server_send_notify_topic_set(SilcServer server,
152                                        SilcSocketConnection sock,
153                                        int broadcast,
154                                        SilcChannelEntry channel,
155                                        SilcClientID *client_id,
156                                        unsigned int client_id_len,
157                                        char *topic);
158 void silc_server_send_notify_kicked(SilcServer server,
159                                     SilcSocketConnection sock,
160                                     int broadcast,
161                                     SilcChannelEntry channel,
162                                     SilcClientID *client_id,
163                                     unsigned int client_id_len,
164                                     char *comment);
165 void silc_server_send_notify_killed(SilcServer server,
166                                     SilcSocketConnection sock,
167                                     int broadcast,
168                                     SilcClientID *client_id,
169                                     unsigned int client_id_len,
170                                     char *comment);
171 void silc_server_send_notify_umode(SilcServer server,
172                                    SilcSocketConnection sock,
173                                    int broadcast,
174                                    SilcClientID *client_id,
175                                    unsigned int client_id_len,
176                                    unsigned int mode_mask);
177 void silc_server_send_notify_ban(SilcServer server,
178                                  SilcSocketConnection sock,
179                                  int broadcast,
180                                  SilcChannelEntry channel,
181                                  char *add, char *del);
182 void silc_server_send_notify_dest(SilcServer server,
183                                   SilcSocketConnection sock,
184                                   int broadcast,
185                                   void *dest_id,
186                                   SilcIdType dest_id_type,
187                                   SilcNotifyType type,
188                                   unsigned int argc, ...);
189 void silc_server_send_notify_to_channel(SilcServer server,
190                                         SilcSocketConnection sender,
191                                         SilcChannelEntry channel,
192                                         unsigned char route_notify,
193                                         SilcNotifyType type,
194                                         unsigned int argc, ...);
195 void silc_server_send_notify_on_channels(SilcServer server,
196                                          SilcClientEntry sender,
197                                          SilcClientEntry client,
198                                          SilcNotifyType type,
199                                          unsigned int argc, ...);
200 void silc_server_send_new_id(SilcServer server,
201                              SilcSocketConnection sock,
202                              int broadcast,
203                              void *id, SilcIdType id_type, 
204                              unsigned int id_len);
205 void silc_server_send_new_channel(SilcServer server,
206                                   SilcSocketConnection sock,
207                                   int broadcast,
208                                   char *channel_name,
209                                   void *channel_id, 
210                                   unsigned int channel_id_len,
211                                   unsigned int mode);
212 void silc_server_send_channel_key(SilcServer server,
213                                   SilcSocketConnection sender,
214                                   SilcChannelEntry channel,
215                                   unsigned char route);
216 void silc_server_send_command(SilcServer server, 
217                               SilcSocketConnection sock,
218                               SilcCommand command, 
219                               unsigned int argc, ...);
220 void silc_server_send_heartbeat(SilcServer server,
221                                 SilcSocketConnection sock);
222 void silc_server_relay_packet(SilcServer server,
223                               SilcSocketConnection dst_sock,
224                               SilcCipher cipher,
225                               SilcHmac hmac,
226                               SilcPacketContext *packet,
227                               int force_send);
228
229 #endif