messages for inter-controller overlay connect
[oweals/gnunet.git] / src / include / gnunet_namestore_plugin.h
index 5eb01684b2586928e54712f820923a406c243439..1168e0d13baeeafe78eca56550b99f9be72976fc 100644 (file)
@@ -56,7 +56,7 @@ typedef void (*GNUNET_NAMESTORE_RecordIterator) (void *cls,
                                                 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
                                                 struct GNUNET_TIME_Absolute expire,
                                                 const char *name,
-                                                unsigned int rd_count,
+                                                unsigned int rd_len,
                                                 const struct GNUNET_NAMESTORE_RecordData *rd,
                                                 const struct GNUNET_CRYPTO_RsaSignature *signature);
 
@@ -85,13 +85,13 @@ struct GNUNET_NAMESTORE_PluginFunctions
    * @param rd array of records with data to store
    * @param signature signature of the record block, NULL if signature is unavailable (i.e. 
    *        because the user queried for a particular record type only)
-   * @return GNUNET_OK on success
+   * @return GNUNET_OK on success, else GNUNET_SYSERR
    */
   int (*put_records) (void *cls, 
                      const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
                      struct GNUNET_TIME_Absolute expire,
                      const char *name,
-                     unsigned int rd_count,
+                     unsigned int rd_len,
                      const struct GNUNET_NAMESTORE_RecordData *rd,
                      const struct GNUNET_CRYPTO_RsaSignature *signature);
 
@@ -101,11 +101,11 @@ struct GNUNET_NAMESTORE_PluginFunctions
    *
    * @param cls closure (internal context for the plugin)
    * @param zone hash of the public key of the zone
-   * @param name name that is being mapped (at most 255 characters long)
+   * @param name name to remove (at most 255 characters long)
    * @return GNUNET_OK on success
    */
   int (*remove_records) (void *cls, 
-                        const GNUNET_HashCode *zone,
+                        const struct GNUNET_CRYPTO_ShortHashCode *zone,
                         const char *name);
 
 
@@ -115,19 +115,38 @@ struct GNUNET_NAMESTORE_PluginFunctions
    *
    * @param cls closure (internal context for the plugin)
    * @param zone hash of public key of the zone, NULL to iterate over all zones
-   * @param name_hash hash of name, NULL to iterate over all records of the zone
+   * @param name name as '\0' terminated string, NULL to iterate over all records of the zone
    * @param offset offset in the list of all matching records
    * @param iter function to call with the result
    * @param iter_cls closure for iter
    * @return GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error
+   *       'iter' will have been called unless the return value is 'GNUNET_SYSERR'
    */
   int (*iterate_records) (void *cls, 
-                         const GNUNET_HashCode *zone,
-                         const GNUNET_HashCode *name_hash,
+                         const struct GNUNET_CRYPTO_ShortHashCode *zone,
+                         const char *name,
                          uint64_t offset,
                          GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls);
 
 
+  /**
+   * Look for an existing PKEY delegation record for a given public key.
+   * Returns at most one result to the iterator.
+   *
+   * @param cls closure (internal context for the plugin)
+   * @param zone hash of public key of the zone to look up in, never NULL
+   * @param value_zone hash of the public key of the target zone (value), never NULL
+   * @param iter function to call with the result
+   * @param iter_cls closure for iter
+   * @return GNUNET_OK on success, GNUNET_NO if there were no results, GNUNET_SYSERR on error
+   *       'iter' will have been called unless the return value is 'GNUNET_SYSERR'
+   */
+  int (*zone_to_name) (void *cls, 
+                      const struct GNUNET_CRYPTO_ShortHashCode *zone,
+                      const struct GNUNET_CRYPTO_ShortHashCode *value_zone,
+                      GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls);
+
+
   /**
    * Delete an entire zone (all records).  Not used in normal operation.
    *
@@ -135,7 +154,7 @@ struct GNUNET_NAMESTORE_PluginFunctions
    * @param zone zone to delete
    */
   void (*delete_zone) (void *cls,
-                      const GNUNET_HashCode *zone);
+                      const struct GNUNET_CRYPTO_ShortHashCode *zone);
 
 
 };