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