|
libnl 3.12.0
|
Data Structures | |
| struct | nl_rhash_table |
Macros | |
| #define | NL_HT_LOAD_NUM 3 |
| #define | NL_HT_LOAD_DEN 4 |
| #define | NL_INIT_RHASH_ENTRIES 8 |
Typedefs | |
| typedef struct nl_rhash_table | nl_rhash_table_t |
Functions | |
| nl_hash_table_t * | nl_hash_table_alloc (int size) |
| Allocate hashtable. | |
| void | nl_hash_table_free (nl_hash_table_t *ht) |
| Free hashtable including all nodes. | |
| struct nl_object * | nl_hash_table_lookup (nl_hash_table_t *ht, struct nl_object *obj) |
| Lookup identical object in hashtable. | |
| int | nl_hash_table_add (nl_hash_table_t *ht, struct nl_object *obj) |
| Add object to hashtable. | |
| int | nl_hash_table_del (nl_hash_table_t *ht, struct nl_object *obj) |
| Remove object from hashtable. | |
| uint32_t | nl_hash (void *k, size_t length, uint32_t initval) |
| nl_rhash_table_t * | nl_rhash_table_alloc () |
| Allocate resizeable hashtable. | |
| void | nl_rhash_table_free (nl_rhash_table_t *ht) |
| Free resizeable hashtable including all nodes. | |
| struct nl_object * | nl_rhash_table_lookup (nl_rhash_table_t *ht, struct nl_object *obj) |
| Lookup identical object in resizeable hashtable. | |
| int | nl_rhash_table_add (nl_rhash_table_t *ht, struct nl_object *obj) |
| Add object to resizeable hashtable. | |
| int | nl_rhash_table_del (nl_rhash_table_t *ht, struct nl_object *obj) |
| Remove object from resizeable hashtable. | |
| #define NL_HT_LOAD_NUM 3 |
Definition at line 225 of file hashtable.c.
| #define NL_HT_LOAD_DEN 4 |
Definition at line 226 of file hashtable.c.
| #define NL_INIT_RHASH_ENTRIES 8 |
Definition at line 272 of file hashtable.c.
| nl_hash_table_t * nl_hash_table_alloc | ( | int | size | ) |
Allocate hashtable.
| size | Size of hashtable in number of elements |
Definition at line 41 of file hashtable.c.
| void nl_hash_table_free | ( | nl_hash_table_t * | ht | ) |
Free hashtable including all nodes.
| ht | Hashtable |
Definition at line 78 of file hashtable.c.
| struct nl_object * nl_hash_table_lookup | ( | nl_hash_table_t * | ht, |
| struct nl_object * | obj ) |
Lookup identical object in hashtable.
| ht | Hashtable |
| obj | Object to lookup |
Generates hashkey for obj and traverses the corresponding chain calling nl_object_identical() on each trying to find a match.
Definition at line 94 of file hashtable.c.
References nl_object_identical(), and nl_object_keygen().
Referenced by nl_rhash_table_lookup().
| int nl_hash_table_add | ( | nl_hash_table_t * | ht, |
| struct nl_object * | obj ) |
Add object to hashtable.
| ht | Hashtable |
| obj | Object to add |
Adds obj to the hashtable. Object type must support hashing, otherwise all objects will be added to the chain 0.
| -NLE_EXIST | Identical object already present in hashtable |
Definition at line 125 of file hashtable.c.
References nl_object_get(), nl_object_identical(), and nl_object_keygen().
Referenced by nl_rhash_table_add().
| int nl_hash_table_del | ( | nl_hash_table_t * | ht, |
| struct nl_object * | obj ) |
Remove object from hashtable.
| ht | Hashtable |
| obj | Object to remove |
Remove obj from hashtable if it exists.
| -NLE_OBJ_NOTFOUND | Object not present in hashtable. |
Definition at line 170 of file hashtable.c.
References nl_object_identical(), nl_object_keygen(), and nl_object_put().
Referenced by nl_rhash_table_del().
| uint32_t nl_hash | ( | void * | k, |
| size_t | length, | ||
| uint32_t | initval ) |
Definition at line 203 of file hashtable.c.
| nl_rhash_table_t * nl_rhash_table_alloc | ( | void | ) |
Allocate resizeable hashtable.
Definition at line 279 of file hashtable.c.
Referenced by nl_cache_alloc().
| void nl_rhash_table_free | ( | nl_rhash_table_t * | ht | ) |
Free resizeable hashtable including all nodes.
| ht | Resizeable Hashtable |
Definition at line 306 of file hashtable.c.
| struct nl_object * nl_rhash_table_lookup | ( | nl_rhash_table_t * | ht, |
| struct nl_object * | obj ) |
Lookup identical object in resizeable hashtable.
| ht | Resizeable Hashtable |
| obj | Object to lookup |
Generates hashkey for obj and traverses the corresponding chain calling nl_object_identical() on each trying to find a match.
Definition at line 322 of file hashtable.c.
References nl_hash_table_lookup().
| int nl_rhash_table_add | ( | nl_rhash_table_t * | ht, |
| struct nl_object * | obj ) |
Add object to resizeable hashtable.
| ht | Resizeable Hashtable |
| obj | Object to add |
Adds obj to the resizeable hashtable. Object type must support hashing, otherwise all objects will be added to the chain 0.
| -NLE_EXIST | Identical object already present in hashtable |
Definition at line 341 of file hashtable.c.
References nl_hash_table_add().
| int nl_rhash_table_del | ( | nl_rhash_table_t * | ht, |
| struct nl_object * | obj ) |
Remove object from resizeable hashtable.
| ht | Resizeable Hashtable |
| obj | Object to remove |
Remove obj from resizeable hashtable if it exists.
| -NLE_OBJ_NOTFOUND | Object not present in hashtable. |
Definition at line 379 of file hashtable.c.
References nl_hash_table_del().
Referenced by nl_cache_remove().