SilcPacketType type,
SilcPacketFlags flags,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
void *dst_id = NULL;
void *dst_id,
SilcIdType dst_id_type,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
SilcPacketContext packetdata;
SilcCipher cipher = NULL;
SilcHmac hmac = NULL;
unsigned char *dst_id_data = NULL;
- unsigned int dst_id_len = 0;
+ uint32 dst_id_len = 0;
SILC_LOG_DEBUG(("Sending packet, type %d", type));
void *dst_id,
SilcIdType dst_id_type,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
SilcPacketContext packetdata;
SilcCipher cipher = NULL;
SilcHmac hmac = NULL;
unsigned char *dst_id_data = NULL;
- unsigned int dst_id_len = 0;
+ uint32 dst_id_len = 0;
unsigned char *src_id_data = NULL;
- unsigned int src_id_len = 0;
+ uint32 src_id_len = 0;
SILC_LOG_DEBUG(("Sending packet, type %d", type));
SilcCipher cipher,
SilcHmac hmac,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int channel_message,
int force_send)
{
SilcPacketType type,
unsigned char route,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
SilcSocketConnection sock = NULL;
SilcServerEntry *routed = NULL;
SilcChannelClientEntry chl;
SilcIDListData idata;
- unsigned int routed_count = 0;
+ uint32 routed_count = 0;
/* This doesn't send channel message packets */
if (type == SILC_PACKET_CHANNEL_MESSAGE)
void *sender,
SilcIdType sender_type,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
int found = FALSE;
SilcClientEntry client = NULL;
SilcServerEntry *routed = NULL;
SilcChannelClientEntry chl;
- unsigned int routed_count = 0;
+ uint32 routed_count = 0;
SilcIDListData idata;
SILC_LOG_DEBUG(("Relaying packet to channel"));
} else {
/* Private key mode is set, we don't have the channel key, so
just re-encrypt the entire packet and send it to the router. */
- silc_server_packet_send_dest(server, sock,
- SILC_PACKET_CHANNEL_MESSAGE, 0,
- channel->id, SILC_ID_CHANNEL,
- data, data_len, force_send);
+ silc_server_packet_send_srcdest(server, sock,
+ SILC_PACKET_CHANNEL_MESSAGE, 0,
+ sender, sender_type,
+ channel->id, SILC_ID_CHANNEL,
+ data, data_len, force_send);
}
continue;
}
SilcPacketType type,
SilcPacketFlags flags,
unsigned char *data,
- unsigned int data_len,
+ uint32 data_len,
int force_send)
{
SilcChannelClientEntry chl;
SilcSocketConnection sock)
{
char *motd;
- int motd_len;
+ uint32 motd_len;
if (server->config && server->config->motd &&
server->config->motd->motd_file) {
SilcSocketConnection sock,
int broadcast,
SilcNotifyType type,
- unsigned int argc, ...)
+ uint32 argc, ...)
{
va_list ap;
SilcBuffer packet;
silc_buffer_free(packet);
}
+/* Sends notify message and gets the arguments from the `args' Argument
+ Payloads. */
+
+void silc_server_send_notify_args(SilcServer server,
+ SilcSocketConnection sock,
+ int broadcast,
+ SilcNotifyType type,
+ uint32 argc,
+ SilcBuffer args)
+{
+ SilcBuffer packet;
+
+ packet = silc_notify_payload_encode_args(type, argc, args);
+ silc_server_packet_send(server, sock, SILC_PACKET_NOTIFY, 0,
+ packet->data, packet->len, FALSE);
+ silc_buffer_free(packet);
+}
+
/* Send CHANNEL_CHANGE notify type. This tells the receiver to replace the
`old_id' with the `new_id'. */
int broadcast,
SilcChannelID *old_id,
SilcChannelID *new_id,
- unsigned int id_len)
+ uint32 id_len)
{
SilcBuffer idp1, idp2;
int broadcast,
SilcClientID *old_id,
SilcClientID *new_id,
- unsigned int id_len)
+ uint32 id_len)
{
SilcBuffer idp1, idp2;
int broadcast,
SilcChannelEntry channel,
SilcClientID *client_id,
- unsigned int client_id_len)
+ uint32 client_id_len)
{
SilcBuffer idp1, idp2;
int broadcast,
SilcChannelEntry channel,
SilcClientID *client_id,
- unsigned int client_id_len)
+ uint32 client_id_len)
{
SilcBuffer idp;
SilcSocketConnection sock,
int broadcast,
SilcChannelEntry channel,
- unsigned int mode_mask,
- SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 mode_mask,
+ void *id, SilcIdType id_type,
+ uint32 id_len,
char *cipher, char *hmac)
{
SilcBuffer idp;
unsigned char mode[4];
- idp = silc_id_payload_encode((void *)client_id, SILC_ID_CLIENT);
+ idp = silc_id_payload_encode((void *)id, id_type);
SILC_PUT32_MSB(mode_mask, mode);
silc_server_send_notify_dest(server, sock, broadcast, (void *)channel->id,
SilcSocketConnection sock,
int broadcast,
SilcChannelEntry channel,
- unsigned int mode_mask,
+ uint32 mode_mask,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
SilcClientID *target,
- unsigned int target_len)
+ uint32 target_len)
{
SilcBuffer idp1, idp2;
unsigned char mode[4];
SilcSocketConnection sock,
int broadcast,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
char *message)
{
SilcBuffer idp;
silc_buffer_free(idp);
}
-/* Sends SERVER_SIGNOFF notify type. This tells that `server_id' server
- has quit SILC network. */
-
-void silc_server_send_notify_server_signoff(SilcServer server,
- SilcSocketConnection sock,
- int broadcast,
- SilcServerID *server_id,
- unsigned int server_id_len)
-{
- SilcBuffer idp;
-
- idp = silc_id_payload_encode((void *)server_id, SILC_ID_SERVER);
- silc_server_send_notify(server, sock, broadcast,
- SILC_NOTIFY_TYPE_SERVER_SIGNOFF,
- 1, idp->data, idp->len);
- silc_buffer_free(idp);
-}
-
/* Sends TOPIC_SET notify type. This tells that `client_id' changed
the `channel's topic to `topic'. The Notify packet is always destined
to the channel. This function is used to send the topic set notifies
int broadcast,
SilcChannelEntry channel,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
char *topic)
{
SilcBuffer idp;
int broadcast,
SilcChannelEntry channel,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
char *comment)
{
SilcBuffer idp;
SilcSocketConnection sock,
int broadcast,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
char *comment)
{
SilcBuffer idp;
SilcSocketConnection sock,
int broadcast,
SilcClientID *client_id,
- unsigned int client_id_len,
- unsigned int mode_mask)
+ uint32 client_id_len,
+ uint32 mode_mask)
{
SilcBuffer idp;
unsigned char mode[4];
int broadcast,
SilcChannelEntry channel,
SilcClientID *client_id,
- unsigned int client_id_len,
+ uint32 client_id_len,
char *add, char *del)
{
SilcBuffer idp, idp2;
void *dest_id,
SilcIdType dest_id_type,
SilcNotifyType type,
- unsigned int argc, ...)
+ uint32 argc, ...)
{
va_list ap;
SilcBuffer packet;
SilcChannelEntry channel,
unsigned char route_notify,
SilcNotifyType type,
- unsigned int argc, ...)
+ uint32 argc, ...)
{
va_list ap;
SilcBuffer packet;
SilcClientEntry sender,
SilcClientEntry client,
SilcNotifyType type,
- unsigned int argc, ...)
+ uint32 argc, ...)
{
int k;
SilcSocketConnection sock = NULL;
SilcPacketContext packetdata;
SilcClientEntry c;
SilcClientEntry *sent_clients = NULL;
- unsigned int sent_clients_count = 0;
+ uint32 sent_clients_count = 0;
SilcServerEntry *routed = NULL;
- unsigned int routed_count = 0;
+ uint32 routed_count = 0;
SilcChannelEntry channel;
SilcChannelClientEntry chl, chl2;
SilcIDListData idata;
SilcBuffer packet;
unsigned char *data;
- unsigned int data_len;
+ uint32 data_len;
int force_send = FALSE;
va_list ap;
SilcSocketConnection sock,
int broadcast,
void *id, SilcIdType id_type,
- unsigned int id_len)
+ uint32 id_len)
{
SilcBuffer idp;
int broadcast,
char *channel_name,
void *channel_id,
- unsigned int channel_id_len,
- unsigned int mode)
+ uint32 channel_id_len,
+ uint32 mode)
{
SilcBuffer packet;
unsigned char *cid;
- unsigned int name_len = strlen(channel_name);
+ uint32 name_len = strlen(channel_name);
SILC_LOG_DEBUG(("Start"));
{
SilcBuffer packet;
unsigned char *chid;
- unsigned int tmp_len;
+ uint32 tmp_len;
SILC_LOG_DEBUG(("Start"));
void silc_server_send_command(SilcServer server,
SilcSocketConnection sock,
SilcCommand command,
- unsigned int argc, ...)
+ uint32 argc, ...)
{
SilcBuffer packet;
va_list ap;
void silc_server_send_connection_auth_request(SilcServer server,
SilcSocketConnection sock,
- unsigned short conn_type,
+ uint16 conn_type,
SilcAuthMethod auth_meth)
{
SilcBuffer packet;