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