Watcher list support added.
[silc.git] / lib / silccore / silcprivate.h
index 0f274f2439962970689e4f0efeec85deaf94fc4c..bede78e2f3dd23d388175672223fa48be2c8fae7 100644 (file)
@@ -1,24 +1,24 @@
-/****h* silccore/silcprivate.h
- *
- * NAME
- *
- * silcprivate.h
- *
- * COPYRIGHT
- *
- * Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- *
- * Copyright (C) 1997 - 2001 Pekka Riikonen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+/*
+  silcprivate.h
+  Author: Pekka Riikonen <priikone@silcnet.org>
+  Copyright (C) 1997 - 2001 Pekka Riikonen
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+*/
+
+/****h* silccore/SILC Private Message Interface
  *
  * DESCRIPTION
  *
@@ -55,7 +55,9 @@ typedef struct SilcPrivateMessagePayloadStruct *SilcPrivateMessagePayload;
  * SYNOPSIS
  *
  *    SilcPrivateMessagePayload 
- *    silc_private_message_payload_parse(SilcBuffer buffer, SilcCipher cipher);
+ *    silc_private_message_payload_parse(unsigned char *payload,
+ *                                       SilcUInt32 payload_len,
+ *                                       SilcCipher cipher);
  *
  * DESCRIPTION
  *
@@ -64,28 +66,33 @@ typedef struct SilcPrivateMessagePayloadStruct *SilcPrivateMessagePayload;
  *
  ***/
 SilcPrivateMessagePayload 
-silc_private_message_payload_parse(SilcBuffer buffer, SilcCipher cipher);
+silc_private_message_payload_parse(unsigned char *payload,
+                                  SilcUInt32 payload_len,
+                                  SilcCipher cipher);
 
 /****f* silccore/SilcPrivateAPI/silc_private_message_payload_encode
  *
  * SYNOPSIS
  *
- *    SilcBuffer silc_private_message_payload_encode(uint16 flags,
- *                                                   uint16 data_len,
- *                                                   unsigned char *data,
- *                                                   SilcCipher cipher);
+ *    SilcBuffer silc_private_message_payload_encode(SilcUInt16 flags,
+ *                                                   SilcUInt16 data_len,
+ *                                                   const unsigned char *data,
+ *                                                   SilcCipher cipher,
+ *                                                   SilcRng rng);
  *
  * DESCRIPTION
  *
  *    Encodes private message payload into a buffer and returns it.  If
  *    the cipher is provided the packet is also encrypted here.  It is provided
- *    if the private message private keys are used.
+ *    if the private message private keys are used.  If the `rng' is NULL
+ *    then global RNG is used, if non-NULL then `rng' is used.
  *
  ***/
-SilcBuffer silc_private_message_payload_encode(uint16 flags,
-                                              uint16 data_len,
-                                              unsigned char *data,
-                                              SilcCipher cipher);
+SilcBuffer silc_private_message_payload_encode(SilcUInt16 flags,
+                                              SilcUInt16 data_len,
+                                              const unsigned char *data,
+                                              SilcCipher cipher,
+                                              SilcRng rng);
 
 /****f* silccore/SilcPrivateAPI/silc_private_message_payload_free
  *
@@ -105,7 +112,7 @@ void silc_private_message_payload_free(SilcPrivateMessagePayload payload);
  *
  * SYNOPSIS
  *
- *    uint16 
+ *    SilcUInt16 
  *    silc_private_message_get_flags(SilcPrivateMessagePayload payload);
  *
  * DESCRIPTION
@@ -115,7 +122,7 @@ void silc_private_message_payload_free(SilcPrivateMessagePayload payload);
  *    channel message flags.
  *
  ***/
-uint16 
+SilcUInt16 
 silc_private_message_get_flags(SilcPrivateMessagePayload payload);
 
 /****f* silccore/SilcPrivateAPI/silc_private_message_get_message
@@ -123,8 +130,8 @@ silc_private_message_get_flags(SilcPrivateMessagePayload payload);
  * SYNOPSIS
  *
  *    unsigned char *
- *    silc_private_message_get_nickname(SilcPrivateMessagePayload payload,
- *                                      uint32 *nickname_len);
+ *    silc_private_message_get_message(SilcPrivateMessagePayload payload,
+ *                                     SilcUInt32 *message_len);
  *
  * DESCRIPTION
  *
@@ -133,6 +140,6 @@ silc_private_message_get_flags(SilcPrivateMessagePayload payload);
  ***/
 unsigned char *
 silc_private_message_get_message(SilcPrivateMessagePayload payload,
-                                uint32 *message_len);
+                                SilcUInt32 *message_len);
 
 #endif