Remove channel keys and hamcs after LEAVE command.
[silc.git] / lib / silccore / silcauth.h
index 2e3d0fd419fb2cda8a7dd797077ec75cced91eaf..39b7c328631e42c27342e3362f745b35a2c31491 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 - 2003, 2006 Pekka Riikonen
+  Copyright (C) 2001 - 2007 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
@@ -57,10 +57,23 @@ typedef SilcUInt16 SilcAuthMethod;
 #define SILC_AUTH_PASSWORD    1                   /* Passphrase authentication */
 #define SILC_AUTH_PUBLIC_KEY  2                   /* Public key authentication */
 
-/* Authentication protocol status message (used by all authentication
-   protocols in the SILC). */
-#define SILC_AUTH_OK          0
-#define SILC_AUTH_FAILED      1
+/****d* silccore/SilcAuthAPI/SilcAuthResult
+ *
+ * NAME
+ *
+ *    typedef SilcUInt32 SilcAuthResult;
+ *
+ * DESCRIPTION
+ *
+ *    Authentication protocol status.  Used by all authentication protocols
+ *    in SILC.
+ *
+ * SOURCE
+ */
+typedef SilcUInt32 SilcAuthResult;
+
+#define SILC_AUTH_OK          0              /* Authentication successful */
+#define SILC_AUTH_FAILED      1                     /* Authentication failed */
 /***/
 
 /****s* silccore/SilcAuthAPI/SilcAuthPayload
@@ -376,15 +389,18 @@ silc_key_agreement_payload_parse(const unsigned char *payload,
  * SYNOPSIS
  *
  *    SilcBuffer silc_key_agreement_payload_encode(char *hostname,
- *                                                 SilcUInt32 port);
+ *                                                 SilcUInt16 protocol,
+ *                                                 SilcUInt16 port);
  *
  * DESCRIPTION
  *
- *    Encodes the Key Agreement protocol and returns the encoded buffer
+ *    Encodes the Key Agreement payload and returns the encoded buffer.
+ *    The `protocol' is 0 for TCP and 1 for UDP.
  *
  ***/
 SilcBuffer silc_key_agreement_payload_encode(const char *hostname,
-                                            SilcUInt32 port);
+                                            SilcUInt16 protocol,
+                                            SilcUInt16 port);
 
 /****f* silccore/SilcAuthAPI/silc_key_agreement_payload_free
  *
@@ -394,7 +410,7 @@ SilcBuffer silc_key_agreement_payload_encode(const char *hostname,
  *
  * DESCRIPTION
  *
- *    Frees the Key Agreement protocol and all data in it.
+ *    Frees the Key Agreement payload and all data in it.
  *
  ***/
 void silc_key_agreement_payload_free(SilcKeyAgreementPayload payload);
@@ -414,11 +430,26 @@ void silc_key_agreement_payload_free(SilcKeyAgreementPayload payload);
  ***/
 char *silc_key_agreement_get_hostname(SilcKeyAgreementPayload payload);
 
+/****f* silccore/SilcAuthAPI/silc_key_agreement_get_protocol
+ *
+ * SYNOPSIS
+ *
+ *    SilcUInt16
+ *    silc_key_agreement_get_protocol(SilcKeyAgreementPayload payload);
+ *
+ * DESCRIPTION
+ *
+ *    Returns the protocol in the payload.  The protocol is either TCP (0)
+ *    or UDP (1).
+ *
+ ***/
+SilcUInt16 silc_key_agreement_get_protocol(SilcKeyAgreementPayload payload);
+
 /****f* silccore/SilcAuthAPI/silc_key_agreement_get_port
  *
  * SYNOPSIS
  *
- *    SilcUInt32 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
+ *    SilcUInt16 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
  *
  * DESCRIPTION
  *
@@ -427,6 +458,6 @@ char *silc_key_agreement_get_hostname(SilcKeyAgreementPayload payload);
  *    the SILC Key Exchange protocol.
  *
  ***/
-SilcUInt32 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
+SilcUInt16 silc_key_agreement_get_port(SilcKeyAgreementPayload payload);
 
 #endif