Function silc_packet_assemble
SYNOPSIS
bool silc_packet_assemble(SilcPacketContext *packet, SilcRng rng,
SilcCipher cipher, SilcHmac hmac,
SilcSocketConnection sock,
const unsigned char *data, SilcUInt32 data_len,
const SilcBuffer assembled_packet);
DESCRIPTION
Assembles new packet to be ready for encrypting and sending out.
The `packet' is filled by caller to include the packet header specific
values. This prepares the socket connection's `sock' outoing buffer
for sending data, and returns the assembled packet to the
`assembled_packet' pointer sent by the caller. The `assembled_packet'
is a reference to the socket connection's outgoing buffer. The
returned packet can be encrypted, and then sent to network by calling
silc_packet_send function. The `assembled_packet' may be freely
modified (like encrypted etc.) but it must not be freed, since it is
reference from `sock' outgoing buffer, and it is const.
|