drivers: add warning note to base dirs
[dpdk.git] / lib / librte_hash / rte_hash.h
index ff75445..1cddc07 100644 (file)
@@ -75,7 +75,7 @@ typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len,
 struct rte_hash_parameters {
        const char *name;               /**< Name of the hash. */
        uint32_t entries;               /**< Total hash table entries. */
-       uint32_t bucket_entries;        /**< Bucket entries. */
+       uint32_t reserved;              /**< Unused field. Should be set to 0 */
        uint32_t key_len;               /**< Length of hash key. */
        rte_hash_function hash_func;    /**< Primary Hash function used to calculate hash. */
        uint32_t hash_func_init_val;    /**< Init value used by hash_func. */
@@ -393,6 +393,28 @@ rte_hash_lookup_bulk_data(const struct rte_hash *h, const void **keys,
 int
 rte_hash_lookup_bulk(const struct rte_hash *h, const void **keys,
                      uint32_t num_keys, int32_t *positions);
+
+/**
+ * Iterate through the hash table, returning key-value pairs.
+ *
+ * @param h
+ *   Hash table to iterate
+ * @param key
+ *   Output containing the key where current iterator
+ *   was pointing at
+ * @param data
+ *   Output containing the data associated with key.
+ *   Returns NULL if data was not stored.
+ * @param next
+ *   Pointer to iterator. Should be 0 to start iterating the hash table.
+ *   Iterator is incremented after each call of this function.
+ * @return
+ *   Position where key was stored, if successful.
+ *   - -EINVAL if the parameters are invalid.
+ *   - -ENOENT if end of the hash table.
+ */
+int32_t
+rte_hash_iterate(const struct rte_hash *h, const void **key, void **data, uint32_t *next);
 #ifdef __cplusplus
 }
 #endif