-renaming gnunet-gns to gnunet-namestore
[oweals/gnunet.git] / src / namestore / namestore.h
index be061e05eabd68ff0c799d77c41324191efdae26..f8aa71f0eda17dbbc2ed6ecd160347b083022532 100644 (file)
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT 441
 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP 442
 
+#define GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT 443
+
+/**
+ * Sign name and records
+ *
+ * @param key the private key
+ * @param name the name
+ * @param rd record data
+ * @param rd_count number of records
+ *
+ * @return the signature
+ */
+struct GNUNET_CRYPTO_RsaSignature *
+GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const char *name, struct GNUNET_NAMESTORE_RecordData *rd, unsigned int rd_count);
+
+/**
+ * Compares if two records are equal
+ *
+ * @param a record
+ * @param b record
+ *
+ * @return GNUNET_YES or GNUNET_NO
+ */
+int
+GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a,
+                              const struct GNUNET_NAMESTORE_RecordData *b);
 
 GNUNET_NETWORK_STRUCT_BEGIN
 /**
@@ -87,6 +113,25 @@ struct StartMessage
 
 };
 
+/**
+ * Connect to namestore service.  FIXME: UNNECESSARY.
+ */
+struct DisconnectMessage
+{
+
+  /**
+   * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT
+   */
+  struct GNUNET_MessageHeader header;
+
+  /**
+   * Drop namestore?
+   * GNUNET_YES or _NO in NBO
+   */
+  uint32_t drop;
+};
+
+
 /**
  * Generic namestore message with op id
  */
@@ -247,9 +292,9 @@ struct RecordCreateResponseMessage
   /* Contenct starts here */
 
   /**
-   *  name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
+   *  name length: GNUNET_NO already existsw, GNUNET_YES on success, GNUNET_SYSERR error
    */
-  uint16_t op_result;
+  int16_t op_result;
 
 
 };