Added silc_server_send_opers[_notify] to send packets to operators.
[silc.git] / apps / silcd / packet_send.h
1 /*
2
3   packet_send.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 1997 - 2002 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                                  bool force_send);
29 void silc_server_packet_send(SilcServer server,
30                              SilcSocketConnection sock, 
31                              SilcPacketType type, 
32                              SilcPacketFlags flags,
33                              unsigned char *data, 
34                              SilcUInt32 data_len,
35                              bool 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                                   SilcUInt32 data_len,
44                                   bool 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                                      SilcUInt32 data_len,
55                                      bool 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_clients(SilcServer server,
63                                      SilcHashTable clients,
64                                      SilcPacketType type,
65                                      SilcPacketFlags flags,
66                                      bool route,
67                                      unsigned char *data, 
68                                      SilcUInt32 data_len,
69                                      bool force_send);
70 void silc_server_packet_send_to_channel(SilcServer server,
71                                         SilcSocketConnection sender,
72                                         SilcChannelEntry channel,
73                                         SilcPacketType type,
74                                         bool route,
75                                         unsigned char *data,
76                                         SilcUInt32 data_len,
77                                         bool force_send);
78 void silc_server_packet_relay_to_channel(SilcServer server,
79                                          SilcSocketConnection sender_sock,
80                                          SilcChannelEntry channel,
81                                          void *sender_id, 
82                                          SilcIdType sender_type,
83                                          SilcClientEntry sender_entry,
84                                          unsigned char *data,
85                                          SilcUInt32 data_len,
86                                          bool force_send);
87 void silc_server_packet_send_local_channel(SilcServer server,
88                                            SilcChannelEntry channel,
89                                            SilcPacketType type,
90                                            SilcPacketFlags flags,
91                                            unsigned char *data,
92                                            SilcUInt32 data_len,
93                                            bool force_send);
94 void silc_server_send_private_message(SilcServer server,
95                                       SilcSocketConnection dst_sock,
96                                       SilcCipher cipher,
97                                       SilcHmac hmac,
98                                       SilcUInt32 sequence,
99                                       SilcPacketContext *packet);
100 void silc_server_send_motd(SilcServer server,
101                            SilcSocketConnection sock);
102 void silc_server_send_error(SilcServer server,
103                             SilcSocketConnection sock,
104                             const char *fmt, ...);
105 void silc_server_send_notify(SilcServer server,
106                              SilcSocketConnection sock,
107                              bool broadcast,
108                              SilcNotifyType type,
109                              SilcUInt32 argc, ...);
110 void silc_server_send_notify_args(SilcServer server,
111                                   SilcSocketConnection sock,
112                                   bool broadcast,
113                                   SilcNotifyType type,
114                                   SilcUInt32 argc,
115                                   SilcBuffer args);
116 void silc_server_send_notify_channel_change(SilcServer server,
117                                             SilcSocketConnection sock,
118                                             bool broadcast,
119                                             SilcChannelID *old_id,
120                                             SilcChannelID *new_id);
121 void silc_server_send_notify_nick_change(SilcServer server,
122                                          SilcSocketConnection sock,
123                                          bool broadcast,
124                                          SilcClientID *old_id,
125                                          SilcClientID *new_id,
126                                          const char *nickname);
127 void silc_server_send_notify_join(SilcServer server,
128                                   SilcSocketConnection sock,
129                                   bool broadcast,
130                                   SilcChannelEntry channel,
131                                   SilcClientID *client_id);
132 void silc_server_send_notify_leave(SilcServer server,
133                                    SilcSocketConnection sock,
134                                    bool broadcast,
135                                    SilcChannelEntry channel,
136                                    SilcClientID *client_id);
137 void silc_server_send_notify_cmode(SilcServer server,
138                                    SilcSocketConnection sock,
139                                    bool broadcast,
140                                    SilcChannelEntry channel,
141                                    SilcUInt32 mode_mask,
142                                    void *id, SilcIdType id_type,
143                                    const char *cipher, const char *hmac,
144                                    const char *passphrase,
145                                    SilcPublicKey founder_key);
146 void silc_server_send_notify_cumode(SilcServer server,
147                                     SilcSocketConnection sock,
148                                     bool broadcast,
149                                     SilcChannelEntry channel,
150                                     SilcUInt32 mode_mask,
151                                     void *id, SilcIdType id_type,
152                                     SilcClientID *target,
153                                     SilcPublicKey founder_key);
154 void silc_server_send_notify_signoff(SilcServer server,
155                                      SilcSocketConnection sock,
156                                      bool broadcast,
157                                      SilcClientID *client_id,
158                                      const char *message);
159 void silc_server_send_notify_topic_set(SilcServer server,
160                                        SilcSocketConnection sock,
161                                        bool broadcast,
162                                        SilcChannelEntry channel,
163                                        void *id, SilcIdType id_type,
164                                        char *topic);
165 void silc_server_send_notify_kicked(SilcServer server,
166                                     SilcSocketConnection sock,
167                                     bool broadcast,
168                                     SilcChannelEntry channel,
169                                     SilcClientID *client_id,
170                                     SilcClientID *kicker,
171                                     char *comment);
172 void silc_server_send_notify_killed(SilcServer server,
173                                     SilcSocketConnection sock,
174                                     bool broadcast,
175                                     SilcClientID *client_id,
176                                     const char *comment,
177                                     void *killer, SilcIdType killer_type);
178 void silc_server_send_notify_umode(SilcServer server,
179                                    SilcSocketConnection sock,
180                                    bool broadcast,
181                                    SilcClientID *client_id,
182                                    SilcUInt32 mode_mask);
183 void silc_server_send_notify_ban(SilcServer server,
184                                  SilcSocketConnection sock,
185                                  bool broadcast,
186                                  SilcChannelEntry channel,
187                                  char *add, char *del);
188 void silc_server_send_notify_invite(SilcServer server,
189                                     SilcSocketConnection sock,
190                                     bool broadcast,
191                                     SilcChannelEntry channel,
192                                     SilcClientID *client_id,
193                                     char *add, char *del);
194 void silc_server_send_notify_watch(SilcServer server,
195                                    SilcSocketConnection sock,
196                                    SilcClientEntry watcher,
197                                    SilcClientEntry client,
198                                    const char *nickname,
199                                    SilcNotifyType type);
200 void silc_server_send_notify_dest(SilcServer server,
201                                   SilcSocketConnection sock,
202                                   bool broadcast,
203                                   void *dest_id,
204                                   SilcIdType dest_id_type,
205                                   SilcNotifyType type,
206                                   SilcUInt32 argc, ...);
207 void silc_server_send_notify_to_channel(SilcServer server,
208                                         SilcSocketConnection sender,
209                                         SilcChannelEntry channel,
210                                         bool route_notify,
211                                         SilcNotifyType type,
212                                         SilcUInt32 argc, ...);
213 void silc_server_send_notify_on_channels(SilcServer server,
214                                          SilcClientEntry sender,
215                                          SilcClientEntry client,
216                                          SilcNotifyType type,
217                                          SilcUInt32 argc, ...);
218 void silc_server_send_new_id(SilcServer server,
219                              SilcSocketConnection sock,
220                              bool broadcast,
221                              void *id, SilcIdType id_type, 
222                              SilcUInt32 id_len);
223 void silc_server_send_new_channel(SilcServer server,
224                                   SilcSocketConnection sock,
225                                   bool broadcast,
226                                   char *channel_name,
227                                   void *channel_id, 
228                                   SilcUInt32 channel_id_len,
229                                   SilcUInt32 mode);
230 void silc_server_send_channel_key(SilcServer server,
231                                   SilcSocketConnection sender,
232                                   SilcChannelEntry channel,
233                                   unsigned char route);
234 void silc_server_send_command(SilcServer server, 
235                               SilcSocketConnection sock,
236                               SilcCommand command, 
237                               SilcUInt16 ident,
238                               SilcUInt32 argc, ...);
239 void silc_server_send_command_reply(SilcServer server, 
240                                     SilcSocketConnection sock,
241                                     SilcCommand command, 
242                                     SilcStatus status,
243                                     SilcStatus error,
244                                     SilcUInt16 ident,
245                                     SilcUInt32 argc, ...);
246 void silc_server_send_dest_command_reply(SilcServer server, 
247                                          SilcSocketConnection sock,
248                                          void *dst_id,
249                                          SilcIdType dst_id_type,
250                                          SilcCommand command, 
251                                          SilcStatus status,
252                                          SilcStatus error,
253                                          SilcUInt16 ident,
254                                          SilcUInt32 argc, ...);
255 void silc_server_send_heartbeat(SilcServer server,
256                                 SilcSocketConnection sock);
257 void silc_server_relay_packet(SilcServer server,
258                               SilcSocketConnection dst_sock,
259                               SilcCipher cipher,
260                               SilcHmac hmac,
261                               SilcUInt32 sequence,
262                               SilcPacketContext *packet,
263                               bool force_send);
264 void silc_server_send_connection_auth_request(SilcServer server,
265                                               SilcSocketConnection sock,
266                                               SilcUInt16 conn_type,
267                                               SilcAuthMethod auth_meth);
268 void silc_server_packet_queue_purge(SilcServer server,
269                                     SilcSocketConnection sock);
270 void silc_server_send_opers(SilcServer server,
271                             SilcPacketType type,
272                             SilcPacketFlags flags,
273                             bool route, bool local,
274                             unsigned char *data, 
275                             SilcUInt32 data_len,
276                             bool force_send);
277 void silc_server_send_opers_notify(SilcServer server,
278                                    bool route,
279                                    bool local,
280                                    SilcNotifyType type,
281                                    SilcUInt32 argc, ...);
282
283 #endif