haiku/headers/private/net/nhash.h
Philippe Houdoin 35682cc6b3 Moving the net kit private includes files to /current tree.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@897 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-27 07:59:57 +00:00

41 lines
784 B
C

/* nhash.h
*/
#ifndef OBOS_NHASH_H
#define OBOS_NHASH_H
#include "pools.h"
typedef struct net_hash_entry net_hash_entry;
typedef struct net_hash net_hash;
typedef struct net_hash_index net_hash_index;
struct net_hash_entry {
net_hash_entry *next;
int hash;
const void *key;
ssize_t klen;
const void *val;
};
struct net_hash_index {
net_hash *nh;
net_hash_entry *this;
net_hash_entry *next;
int index;
};
struct net_hash {
net_hash_entry **array;
net_hash_index iterator;
int count;
int max;
struct pool_ctl *pool;
};
net_hash *nhash_make(void);
void *nhash_get(net_hash *, const void *key, ssize_t klen);
void nhash_set(net_hash *, const void *, ssize_t , const void *);
#endif /* OBOS_NHASH_H */