user-directory.h revision 2670cd577aa57eb9f915a4f4220ae48c9b4fc5fb
#ifndef USER_DIRECTORY_H
#define USER_DIRECTORY_H
struct user {
/* sorted by time */
/* first 32 bits of MD5(username). collisions are quite unlikely, but
even if they happen it doesn't matter - the users are just
redirected to same server */
unsigned int username_hash;
unsigned int timestamp;
};
/* Create a new directory. Users are dropped if their time gets older
than timeout_secs. */
/* Look up username from directory. Returns NULL if not found. */
unsigned int username_hash);
/* Add a user to directory and return it. */
struct user *
/* Refresh user's timestamp */
/* Remove all users that have pointers to given host */
unsigned int user_directory_get_username_hash(const char *username);
/* Returns TRUE if user still potentially has connections. */
struct user_directory_iter *
#endif