Changeset 9f4067b6 in mainline for uspace/lib/nic/include/nic_addr_db.h
- Timestamp:
- 2012-10-09T21:16:13Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6659037, 7d248e3
- Parents:
- d1ef4a1 (diff), 97b199b1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/nic/include/nic_addr_db.h
rd1ef4a1 r9f4067b6 43 43 #endif 44 44 45 #include <adt/hash_set.h> 46 47 /** 48 * Initial size of DB's hash set 49 */ 50 #define NIC_ADDR_DB_INIT_SIZE 8 51 /** 52 * Maximal length of addresses in the DB (in bytes). 53 */ 54 #define NIC_ADDR_MAX_LENGTH 16 45 #include <adt/hash_table.h> 55 46 56 47 /** … … 58 49 */ 59 50 typedef struct nic_addr_db { 60 hash_ set_t set;51 hash_table_t set; 61 52 size_t addr_len; 62 53 } nic_addr_db_t; 63 54 64 /**65 * Helper structure for keeping the address in the hash set.66 */67 typedef struct nic_addr_entry {68 link_t item;69 size_t addr_len;70 uint8_t addr[NIC_ADDR_MAX_LENGTH];71 } nic_addr_entry_t;72 55 73 56 extern int nic_addr_db_init(nic_addr_db_t *db, size_t addr_len); 74 57 extern void nic_addr_db_clear(nic_addr_db_t *db); 75 58 extern void nic_addr_db_destroy(nic_addr_db_t *db); 76 extern size_t nic_addr_db_count(const nic_addr_db_t *db);77 59 extern int nic_addr_db_insert(nic_addr_db_t *db, const uint8_t *addr); 78 60 extern int nic_addr_db_remove(nic_addr_db_t *db, const uint8_t *addr); 79 extern void nic_addr_db_remove_selected(nic_addr_db_t *db,80 int (*func)(const uint8_t *, void *), void *arg);81 61 extern int nic_addr_db_contains(const nic_addr_db_t *db, const uint8_t *addr); 82 62 extern void nic_addr_db_foreach(const nic_addr_db_t *db,
Note:
See TracChangeset
for help on using the changeset viewer.