#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT 441
#define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP 442
-size_t
-GNUNET_NAMESTORE_records_serialize (char ** dest,
- unsigned int rd_count,
- const struct GNUNET_NAMESTORE_RecordData *rd);
+#define GNUNET_MESSAGE_TYPE_NAMESTORE_DISCONNECT 443
-int
-GNUNET_NAMESTORE_records_deserialize ( struct GNUNET_NAMESTORE_RecordData **dest, char *src, size_t len);
-
-void
-GNUNET_NAMESTORE_records_free (unsigned int rd_count, struct GNUNET_NAMESTORE_RecordData *rd);
+/**
+ * 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
/**
};
+/**
+ * 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
*/
uint16_t rd_len;
+ uint16_t rd_count;
+
int32_t contains_sig;
/* Requested record type */
/* Length of serialized rd data */
uint16_t rd_len;
+ /* Number of records contained */
+ uint16_t rd_count;
+
/* Length of pubkey */
uint16_t key_len;
/* Record data length */
uint16_t rd_len;
+ /* Record count */
+ uint16_t rd_count;
+
/* private key length */
uint16_t pkey_len;
};
/* 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;
};
/* Contenct starts here */
- /* name length */
+ /* Name length */
uint16_t name_len;
- struct GNUNET_CRYPTO_RsaSignature signature;
+ /* Length of serialized rd data */
+ uint16_t rd_len;
+
+ /* Number of records contained */
+ uint16_t rd_count;
+
+ /* Length of pubkey */
+ uint16_t key_len;
};
GNUNET_NETWORK_STRUCT_END
/* Contenct starts here */
/**
- * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
+ * result:
+ * 0 : successful
+ * 1 : no records for entry
+ * 2 : Could not find record to remove
+ * 3 : Failed to create new signature
+ * 4 : Failed to put new set of records in database
*/
uint16_t op_result;
};