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_broadcast(SilcServer server,
46                                   SilcSocketConnection sock,
47                                   SilcPacketContext *packet);
48 void silc_server_packet_route(SilcServer server,
49                               SilcSocketConnection sock,
50                               SilcPacketContext *packet);
51 void silc_server_packet_send_to_channel(SilcServer server,
52                                         SilcSocketConnection sender,
53                                         SilcChannelEntry channel,
54                                         SilcPacketType type,
55                                         unsigned char route,
56                                         unsigned char *data,
57                                         unsigned int data_len,
58                                         int force_send);
59 void silc_server_packet_relay_to_channel(SilcServer server,
60                                          SilcSocketConnection sender_sock,
61                                          SilcChannelEntry channel,
62                                          void *sender, 
63                                          SilcIdType sender_type,
64                                          unsigned char *data,
65                                          unsigned int data_len,
66                                          int force_send);
67 void silc_server_packet_send_local_channel(SilcServer server,
68                                            SilcChannelEntry channel,
69                                            SilcPacketType type,
70                                            SilcPacketFlags flags,
71                                            unsigned char *data,
72                                            unsigned int data_len,
73                                            int force_send);
74 void silc_server_send_private_message(SilcServer server,
75                                       SilcSocketConnection dst_sock,
76                                       SilcCipher cipher,
77                                       SilcHmac hmac,
78                                       SilcPacketContext *packet);
79 void silc_server_send_motd(SilcServer server,
80                            SilcSocketConnection sock);
81 void silc_server_send_error(SilcServer server,
82                             SilcSocketConnection sock,
83                             const char *fmt, ...);
84 void silc_server_send_notify(SilcServer server,
85                              SilcSocketConnection sock,
86                              int broadcast,
87                              SilcNotifyType type,
88                              unsigned int argc, ...);
89 void silc_server_send_notify_channel_change(SilcServer server,
90                                             SilcSocketConnection sock,
91                                             int broadcast,
92                                             SilcChannelID *old_id,
93                                             SilcChannelID *new_id,
94                                             unsigned int id_len);
95 void silc_server_send_notify_nick_change(SilcServer server,
96                                          SilcSocketConnection sock,
97                                          int broadcast,
98                                          SilcClientID *old_id,
99                                          SilcClientID *new_id,
100                                          unsigned int id_len);
101 void silc_server_send_notify_join(SilcServer server,
102                                   SilcSocketConnection sock,
103                                   int broadcast,
104                                   SilcChannelEntry channel,
105                                   SilcClientID *client_id,
106                                   unsigned int client_id_len);
107 void silc_server_send_notify_leave(SilcServer server,
108                                    SilcSocketConnection sock,
109                                    int broadcast,
110                                    SilcChannelEntry channel,
111                                    SilcClientID *client_id,
112                                    unsigned int client_id_len);
113 void silc_server_send_notify_cmode(SilcServer server,
114                                    SilcSocketConnection sock,
115                                    int broadcast,
116                                    SilcChannelEntry channel,
117                                    unsigned int mode_mask,
118                                    SilcClientID *client_id,
119                                    unsigned int client_id_len);
120 void silc_server_send_notify_cumode(SilcServer server,
121                                     SilcSocketConnection sock,
122                                     int broadcast,
123                                     SilcChannelEntry channel,
124                                     unsigned int mode_mask,
125                                     SilcClientID *client_id,
126                                     unsigned int client_id_len,
127                                     SilcClientID *target,
128                                     unsigned int target_len);
129 void silc_server_send_notify_signoff(SilcServer server,
130                                      SilcSocketConnection sock,
131                                      int broadcast,
132                                      SilcClientID *client_id,
133                                      unsigned int client_id_len,
134                                      char *message);
135 void silc_server_send_notify_server_signoff(SilcServer server,
136                                             SilcSocketConnection sock,
137                                             int broadcast,
138                                             SilcServerID *server_id,
139                                             unsigned int server_id_len);
140 void silc_server_send_notify_topic_set(SilcServer server,
141                                        SilcSocketConnection sock,
142                                        int broadcast,
143                                        SilcChannelEntry channel,
144                                        SilcClientID *client_id,
145                                        unsigned int client_id_len,
146                                        char *topic);
147 void silc_server_send_notify_kicked(SilcServer server,
148                                     SilcSocketConnection sock,
149                                     int broadcast,
150                                     SilcChannelEntry channel,
151                                     SilcClientID *client_id,
152                                     unsigned int client_id_len,
153                                     char *comment);
154 void silc_server_send_notify_dest(SilcServer server,
155                                   SilcSocketConnection sock,
156                                   int broadcast,
157                                   void *dest_id,
158                                   SilcIdType dest_id_type,
159                                   SilcNotifyType type,
160                                   unsigned int argc, ...);
161 void silc_server_send_notify_to_channel(SilcServer server,
162                                         SilcSocketConnection sender,
163                                         SilcChannelEntry channel,
164                                         unsigned char route_notify,
165                                         SilcNotifyType type,
166                                         unsigned int argc, ...);
167 void silc_server_send_notify_on_channels(SilcServer server,
168                                          SilcClientEntry client,
169                                          SilcNotifyType type,
170                                          unsigned int argc, ...);
171 void silc_server_send_new_id(SilcServer server,
172                              SilcSocketConnection sock,
173                              int broadcast,
174                              void *id, SilcIdType id_type, 
175                              unsigned int id_len);
176 void silc_server_send_new_channel(SilcServer server,
177                                   SilcSocketConnection sock,
178                                   int broadcast,
179                                   char *channel_name,
180                                   void *channel_id, 
181                                   unsigned int channel_id_len);
182 void silc_server_send_channel_key(SilcServer server,
183                                   SilcSocketConnection sender,
184                                   SilcChannelEntry channel,
185                                   unsigned char route);
186 void silc_server_send_command(SilcServer server, 
187                               SilcSocketConnection sock,
188                               SilcCommand command, 
189                               unsigned int argc, ...);
190 void silc_server_send_heartbeat(SilcServer server,
191                                 SilcSocketConnection sock);
192 void silc_server_send_key_agreement(SilcServer server,
193                                     SilcSocketConnection dst_sock,
194                                     SilcCipher cipher,
195                                     SilcHmac hmac,
196                                     SilcPacketContext *packet);
197 void silc_server_send_private_message_key(SilcServer server,
198                                           SilcSocketConnection dst_sock,
199                                           SilcCipher cipher,
200                                           SilcHmac hmac,
201                                           SilcPacketContext *packet);
202
203 #endif