Handle memory allocation failures when unformatting data
[silc.git] / lib / silccore / silcattrs.h
index b51ca8243b28447fe742a44b7b42db1cd5db36c5..0a804f2fc0c70a258e7bdb08588f97b73d280b00 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 - 2005 Pekka Riikonen
+  Copyright (C) 2002 - 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
@@ -83,6 +83,7 @@ typedef SilcUInt8 SilcAttribute;
 #define SILC_ATTRIBUTE_USER_DIGITAL_SIGNATURE 14  /* SilcAttributeObjPk */
 #define SILC_ATTRIBUTE_SERVER_DIGITAL_SIGNATURE 15 /* SilcAttributeObjPk */
 #define SILC_ATTRIBUTE_USER_ICON             16  /* SilcMime */
+#define SILC_ATTRIBUTE_PHONE_NUMBER          17  /* SilcAttributeObjPN */
 /***/
 
 /* Maximum length of attribute request packet */
@@ -182,6 +183,25 @@ typedef enum {
 } SilcAttributeDevice;
 /***/
 
+/****d* silccore/SilcAttributesAPI/SilcAttributePNFormat
+ *
+ * NAME
+ *
+ *    typedef enum { ... } SilcAttributePNFormat;
+ *
+ * DESCRIPTION
+ *
+ *    The defined phone number formats.
+ *
+ * SOURCE
+ */
+typedef enum {
+  SILC_ATTRIBUTE_NUMBER_ITU_E164        = 0,     /* ITU E.164 */
+  SILC_ATTRIBUTE_NUMBER_ITU_E123        = 1,     /* ITU E.123 */
+  SILC_ATTRIBUTE_NUMBER_ENUM            = 2,     /* ENUM, RFC 3761 */
+} SilcAttributePNFormat;
+/***/
+
 /****f* silccore/SilcAttributesAPI/silc_attribute_payload_alloc
  *
  * SYNOPSIS
@@ -454,9 +474,7 @@ typedef struct SilcAttributeObjDeviceStruct {
  *    caller must free the data inside the structure.  The 'type' is one
  *    of following: "silc-rsa", "silc-dss, "ssh-rsa", "ssh-dss",
  *    "pgp-sign-rsa", "pgp-sign-dss", "x509v3-sign-rsa", "x509v3-sign-dss".
- *    See the draft-riikonen-precense-attrs draft for more detailed
- *    information.  The 'type' is NULL when this structure includes a
- *    digital signature.
+ *    The 'type' is NULL when this structure includes a digital signature.
  *
  *    In SILC, at least the "silc-rsa" must be supported.  In this case
  *    the key is normal SILC Public key.  To verify a signature with the
@@ -477,6 +495,25 @@ typedef struct SilcAttributeObjPkStruct {
 } SilcAttributeObjPk;
 /***/
 
+/****s* silccore/SilcAttributesAPI/SilcAttributeObjPN
+ *
+ * NAME
+ *
+ *    typedef struct { ... } SilcAttributeObjPN;
+ *
+ * DESCRIPTION
+ *
+ *    SILC_ATTRIBUTE_PHONE_NUMBER type object.  The caller must free the
+ *    phone number string inside the structure.
+ *
+ * SOURCE
+ */
+typedef struct SilcAttributeObjPNStruct {
+  SilcAttributePNFormat format;        /* Phone number format */
+  char *number;                        /* Phone number */
+} SilcAttributeObjPN;
+/***/
+
 /****f* silccore/SilcAttributesAPI/silc_attribute_get_object
  *
  * SYNOPSIS