-/* SILC Packet types. */
-#define SILC_PACKET_NONE 0 /* NULL, never sent */
-#define SILC_PACKET_DISCONNECT 1 /* Disconnection */
-#define SILC_PACKET_SUCCESS 2 /* Success */
-#define SILC_PACKET_FAILURE 3 /* Failure */
-#define SILC_PACKET_REJECT 4 /* Rejected */
-#define SILC_PACKET_NOTIFY 5 /* Notify message */
-#define SILC_PACKET_ERROR 6 /* Error message */
-#define SILC_PACKET_CHANNEL_MESSAGE 7 /* Message for channel */
-#define SILC_PACKET_CHANNEL_KEY 8 /* Key of the channel */
-#define SILC_PACKET_PRIVATE_MESSAGE 9 /* Private message */
-#define SILC_PACKET_PRIVATE_MESSAGE_KEY 10 /* Private message key*/
-#define SILC_PACKET_COMMAND 11 /* Command */
-#define SILC_PACKET_COMMAND_REPLY 12 /* Reply to a command */
-#define SILC_PACKET_KEY_EXCHANGE 13 /* Start of KE */
-#define SILC_PACKET_KEY_EXCHANGE_1 14 /* KE1 */
-#define SILC_PACKET_KEY_EXCHANGE_2 15 /* KE2 */
-#define SILC_PACKET_CONNECTION_AUTH_REQUEST 16 /* Request of auth meth */
-#define SILC_PACKET_CONNECTION_AUTH 17 /* Connectinon auth */
-#define SILC_PACKET_NEW_ID 18 /* Sending new ID */
-#define SILC_PACKET_NEW_ID_LIST 19 /* Sending list of them */
-#define SILC_PACKET_NEW_CLIENT 20 /* Registering client */
-#define SILC_PACKET_NEW_SERVER 21 /* Registering server */
-#define SILC_PACKET_NEW_CHANNEL 22 /* Registering channel */
-#define SILC_PACKET_NEW_CHANNEL_USER 23 /* "" user on channel */
-#define SILC_PACKET_NEW_CHANNEL_LIST 24 /* List of new channels */
-#define SILC_PACKET_NEW_CHANNEL_USER_LIST 25 /* List of users on "" */
-#define SILC_PACKET_REPLACE_ID 26 /* To replace old ID */
-#define SILC_PACKET_REMOVE_ID 27 /* To remove ID */
-#define SILC_PACKET_REMOVE_CHANNEL_USER 28 /* Remove user from channel */
-#define SILC_PACKET_REKEY 29
-#define SILC_PACKET_REKEY_DONE 30
-/* #define SILC_PACKET_MAX 255 */
-
-/* Macros */
-
-/* Returns true length of the packet and padded length of the packet */
-#define SILC_PACKET_LENGTH(__packet, __ret_truelen, __ret_padlen) \
-do { \
- SILC_GET16_MSB((__ret_truelen), (__packet)->data); \
- (__ret_padlen) = (((__ret_truelen) - 2) + \
- SILC_PACKET_MAX_PADLEN) & ~(SILC_PACKET_MAX_PADLEN - 1); \
-} while(0)
-
-/* Returns pad length of the packet */
-#define SILC_PACKET_PADLEN(__packetlen) \
- SILC_PACKET_MAX_PADLEN - ((__packetlen) - 2) % SILC_PACKET_MAX_PADLEN;
+/****f* silccore/SilcPacketAPI/silc_packet_wait_uninit
+ *
+ * SYNOPSIS
+ *
+ * void silc_packet_wait_uninit(void *waiter, SilcPacketStream stream);
+ *
+ * DESCRIPTION
+ *
+ * Uninitializes the waiting context. This may be called also from
+ * another thread while other thread is waiting for packets. This will
+ * inform the waiting thread to stop waiting.
+ *
+ ***/
+void silc_packet_wait_uninit(void *waiter, SilcPacketStream stream);