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 - 2000 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                                         SilcChannelEntry channel,
53                                         SilcPacketType type,
54                                         unsigned char route,
55                                         unsigned char *data,
56                                         unsigned int data_len,
57                                         int force_send);
58 void silc_server_packet_relay_to_channel(SilcServer server,
59                                          SilcSocketConnection sender_sock,
60                                          SilcChannelEntry channel,
61                                          void *sender, 
62                                          SilcIdType sender_type,
63                                          unsigned char *data,
64                                          unsigned int data_len,
65                                          int force_send);
66 void silc_server_packet_send_local_channel(SilcServer server,
67                                            SilcChannelEntry channel,
68                                            SilcPacketType type,
69                                            SilcPacketFlags flags,
70                                            unsigned char *data,
71                                            unsigned int data_len,
72                                            int force_send);
73 void silc_server_send_private_message(SilcServer server,
74                                       SilcSocketConnection dst_sock,
75                                       SilcCipher cipher,
76                                       SilcHmac hmac,
77                                       SilcPacketContext *packet);
78 void silc_server_send_motd(SilcServer server,
79                            SilcSocketConnection sock);
80 void silc_server_send_error(SilcServer server,
81                             SilcSocketConnection sock,
82                             const char *fmt, ...);
83 void silc_server_send_notify(SilcServer server,
84                              SilcSocketConnection sock,
85                              SilcNotifyType type,
86                              unsigned int argc, ...);
87 void silc_server_send_notify_dest(SilcServer server,
88                                   SilcSocketConnection sock,
89                                   void *dest_id,
90                                   SilcIdType dest_id_type,
91                                   SilcNotifyType type,
92                                   unsigned int argc, ...);
93 void silc_server_send_notify_to_channel(SilcServer server,
94                                         SilcChannelEntry channel,
95                                         unsigned char route_notify,
96                                         SilcNotifyType type,
97                                         unsigned int argc, ...);
98 void silc_server_send_notify_on_channels(SilcServer server,
99                                          SilcClientEntry client,
100                                          SilcNotifyType type,
101                                          unsigned int argc, ...);
102 void silc_server_send_new_id(SilcServer server,
103                              SilcSocketConnection sock,
104                              int broadcast,
105                              void *id, SilcIdType id_type, 
106                              unsigned int id_len);
107 void silc_server_send_replace_id(SilcServer server,
108                                  SilcSocketConnection sock,
109                                  int broadcast,
110                                  void *old_id, SilcIdType old_id_type,
111                                  unsigned int old_id_len,
112                                  void *new_id, SilcIdType new_id_type,
113                                  unsigned int new_id_len);
114 void silc_server_send_remove_channel_user(SilcServer server,
115                                           SilcSocketConnection sock,
116                                           int broadcast,
117                                           void *client_id, void *channel_id);
118 void silc_server_send_new_channel(SilcServer server,
119                                   SilcSocketConnection sock,
120                                   int broadcast,
121                                   char *channel_name,
122                                   void *channel_id, 
123                                   unsigned int channel_id_len);
124 void silc_server_send_new_channel_user(SilcServer server,
125                                        SilcSocketConnection sock,
126                                        int broadcast,
127                                        void *channel_id, 
128                                        unsigned int channel_id_len,
129                                        void *client_id,
130                                        unsigned int client_id_len);
131 void silc_server_send_channel_key(SilcServer server,
132                                   SilcChannelEntry channel,
133                                   unsigned char route);
134 void silc_server_send_command(SilcServer server, 
135                               SilcSocketConnection sock,
136                               SilcCommand command, 
137                               unsigned int argc, ...);
138 void silc_server_send_remove_id(SilcServer server,
139                                 SilcSocketConnection sock,
140                                 int broadcast,
141                                 void *id, unsigned int id_len,
142                                 SilcIdType id_type);
143
144 #endif