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                              SilcNotifyType type,
87                              unsigned int argc, ...);
88 void silc_server_send_notify_dest(SilcServer server,
89                                   SilcSocketConnection sock,
90                                   void *dest_id,
91                                   SilcIdType dest_id_type,
92                                   SilcNotifyType type,
93                                   unsigned int argc, ...);
94 void silc_server_send_notify_to_channel(SilcServer server,
95                                         SilcSocketConnection sender,
96                                         SilcChannelEntry channel,
97                                         unsigned char route_notify,
98                                         SilcNotifyType type,
99                                         unsigned int argc, ...);
100 void silc_server_send_notify_on_channels(SilcServer server,
101                                          SilcClientEntry client,
102                                          SilcNotifyType type,
103                                          unsigned int argc, ...);
104 void silc_server_send_new_id(SilcServer server,
105                              SilcSocketConnection sock,
106                              int broadcast,
107                              void *id, SilcIdType id_type, 
108                              unsigned int id_len);
109 void silc_server_send_replace_id(SilcServer server,
110                                  SilcSocketConnection sock,
111                                  int broadcast,
112                                  void *old_id, SilcIdType old_id_type,
113                                  unsigned int old_id_len,
114                                  void *new_id, SilcIdType new_id_type,
115                                  unsigned int new_id_len);
116 void silc_server_send_remove_channel_user(SilcServer server,
117                                           SilcSocketConnection sock,
118                                           int broadcast,
119                                           void *client_id, void *channel_id);
120 void silc_server_send_new_channel(SilcServer server,
121                                   SilcSocketConnection sock,
122                                   int broadcast,
123                                   char *channel_name,
124                                   void *channel_id, 
125                                   unsigned int channel_id_len);
126 void silc_server_send_new_channel_user(SilcServer server,
127                                        SilcSocketConnection sock,
128                                        int broadcast,
129                                        void *channel_id, 
130                                        unsigned int channel_id_len,
131                                        void *client_id,
132                                        unsigned int client_id_len);
133 void silc_server_send_channel_key(SilcServer server,
134                                   SilcSocketConnection sender,
135                                   SilcChannelEntry channel,
136                                   unsigned char route);
137 void silc_server_send_command(SilcServer server, 
138                               SilcSocketConnection sock,
139                               SilcCommand command, 
140                               unsigned int argc, ...);
141 void silc_server_send_remove_id(SilcServer server,
142                                 SilcSocketConnection sock,
143                                 int broadcast,
144                                 void *id, unsigned int id_len,
145                                 SilcIdType id_type);
146 void silc_server_send_set_mode(SilcServer server,
147                                SilcSocketConnection sock,
148                                int broadcast,
149                                int mode_type, unsigned int mode_mask,
150                                unsigned int argc, ...);
151 void silc_server_send_heartbeat(SilcServer server,
152                                 SilcSocketConnection sock);
153
154 #endif