- unsigned int *argv_lens,
- unsigned int *argv_types,
- unsigned short ident);
-SilcBuffer silc_command_payload_encode_va(SilcCommand cmd,
- unsigned short ident,
- unsigned int argc, ...);
-SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd,
- unsigned short ident,
- unsigned int argc, va_list ap);
-SilcBuffer
-silc_command_reply_payload_encode_va(SilcCommand cmd,
- SilcCommandStatus status,
- unsigned short ident,
- unsigned int argc, ...);
-void silc_command_free_payload(SilcCommandPayload payload);
+ SilcUInt32 *argv_lens,
+ SilcUInt32 *argv_types,
+ SilcUInt16 ident);
+
+/****f* silccore/SilcCommandAPI/silc_command_payload_encode_payload
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer
+ * silc_command_payload_encode_payload(SilcCommandPayload payload);
+ *
+ * DESCRIPTION
+ *
+ * Same as silc_command_payload_encode but encodes the buffer from
+ * SilcCommandPayload structure instead of raw data.
+ *
+ ***/
+SilcBuffer silc_command_payload_encode_payload(SilcCommandPayload payload);
+
+/****f* silccore/SilcCommandAPI/silc_command_payload_encode_va
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer silc_command_payload_encode_va(SilcCommand cmd,
+ * SilcUInt16 ident,
+ * SilcUInt32 argc, ...);
+ *
+ * DESCRIPTION
+ *
+ * Encodes Command payload with variable argument list. The arguments
+ * must be: SilcUInt32, unsigned char *, unsigned int, ... One
+ * {SilcUInt32, unsigned char * and unsigned int} forms one argument,
+ * thus `argc' in case when sending one {SilcUInt32, unsigned char *
+ * and SilcUInt32} equals one (1) and when sending two of those it
+ * equals two (2), and so on. This has to be preserved or bad things
+ * will happen. The variable arguments is: {type, data, data_len}.
+ *
+ ***/
+SilcBuffer silc_command_payload_encode_va(SilcCommand cmd,
+ SilcUInt16 ident,
+ SilcUInt32 argc, ...);
+
+/****f* silccore/SilcCommandAPI/silc_command_payload_encode_vap
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd,
+ * SilcUInt16 ident,
+ * SilcUInt32 argc, va_list ap);
+ *
+ * DESCRIPTION
+ *
+ * This is equivalent to the silc_command_payload_encode_va except
+ * takes the va_list as argument.
+ *
+ ***/
+SilcBuffer silc_command_payload_encode_vap(SilcCommand cmd,
+ SilcUInt16 ident,
+ SilcUInt32 argc, va_list ap);
+
+/****f* silccore/SilcCommandAPI/silc_command_reply_payload_encode_va
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer
+ * silc_command_reply_payload_encode_va(SilcCommand cmd,
+ * SilcStatus status,
+ * SilcStatus error,
+ * SilcUInt16 ident,
+ * SilcUInt32 argc, ...);
+ *
+ * DESCRIPTION
+ *
+ * Same as silc_command_payload_encode_va except that this is used to
+ * encode strictly command reply packets. The `argc' must not count
+ * `status' and `error' as arguments. The `status' includes the
+ * command reply status. If single reply will be sent then it includes
+ * SILC_STATUS_OK if error did not occur. It includes an error value
+ * if error did occur. In this case `error' field is ignored. If
+ * there will be multiple successful command replies then the `status'
+ * includes a list value and `error' is ignored. If there will
+ * multiple error replies the `status' includes a list value, and
+ * the `error' includes an error value. Thus, the `error' value is
+ * specified only if there will be list of errors.
+ *
+ * NOTES
+ *
+ * Protocol defines that it is possible to send both list of successful
+ * and list of error replies at the same time, as long as the error
+ * replies are sent after the successful replies.
+ *
+ ***/
+SilcBuffer
+silc_command_reply_payload_encode_va(SilcCommand cmd,
+ SilcStatus status,
+ SilcStatus error,
+ SilcUInt16 ident,
+ SilcUInt32 argc, ...);
+
+/****f* silccore/SilcCommandAPI/silc_command_reply_payload_encode_vap
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer
+ * silc_command_reply_payload_encode_vap(SilcCommand cmd,
+ * SilcStatus status,
+ * SilcStatus error,
+ * SilcUInt16 ident, SilcUInt32 argc,
+ * va_list ap);
+ *
+ * DESCRIPTION
+ *
+ * This is equivalent to the silc_command_reply_payload_encode_va except
+ * takes the va_list as argument.
+ *
+ ***/
+SilcBuffer
+silc_command_reply_payload_encode_vap(SilcCommand cmd,
+ SilcStatus status,
+ SilcStatus error,
+ SilcUInt16 ident, SilcUInt32 argc,
+ va_list ap);
+
+/****f* silccore/SilcCommandAPI/silc_command_free
+ *
+ * SYNOPSIS
+ *
+ * void silc_command_payload_free(SilcCommandPayload payload);
+ *
+ * DESCRIPTION
+ *
+ * Frees the Command Payload and all data in it.
+ *
+ ***/
+void silc_command_payload_free(SilcCommandPayload payload);
+
+/****f* silccore/SilcCommandAPI/silc_command_get
+ *
+ * SYNOPSIS
+ *
+ * SilcCommand silc_command_get(SilcCommandPayload payload);
+ *
+ * DESCRIPTION
+ *
+ * Return the command from the payload.
+ *
+ ***/