#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <atalk/afp.h>#include <atalk/logger.h>#include <atalk/uuid.h>#include "cache.h"Data Structures | |
| struct | cacheduser |
Typedefs | |
| typedef struct cacheduser | cacheduser_t |
Functions | |
| void | uuidcache_dump (void) |
| static unsigned char | hashstring (unsigned char *str) |
| static unsigned char | hashuuid (uuidp_t uuid) |
| int | add_cachebyname (const char *inname, const uuidp_t inuuid, const uuidtype_t type, const unsigned long uid) |
| int | search_cachebyname (const char *name, uuidtype_t *type, unsigned char *uuid) |
| Search cache by name and uuid type. | |
| int | search_cachebyuuid (uuidp_t uuidp, char **name, uuidtype_t *type) |
| int | add_cachebyuuid (uuidp_t inuuid, const char *inname, uuidtype_t type, const unsigned long uid) |
Variables | |
| static cacheduser_t * | namecache [256] |
| static cacheduser_t * | uuidcache [256] |
| typedef struct cacheduser cacheduser_t |
| int add_cachebyname | ( | const char * | inname, |
| const uuidp_t | inuuid, | ||
| const uuidtype_t | type, | ||
| const unsigned long | uid ) |
| int add_cachebyuuid | ( | uuidp_t | inuuid, |
| const char * | inname, | ||
| uuidtype_t | type, | ||
| const unsigned long | uid ) |
|
static |
hash string it into unsigned char using FNV-1a algorithm
|
static |
hash atalk_uuid_t into unsigned char
| int search_cachebyname | ( | const char * | name, |
| uuidtype_t * | type, | ||
| unsigned char * | uuid ) |
Search cache by name and uuid type.
| [in] | name | name to search |
| [in,out] | type | type (user or group) of name, returns found type here which might mark it as a negative entry |
| [out] | uuid | found uuid is returned here |
| int search_cachebyuuid | ( | uuidp_t | uuidp, |
| char ** | name, | ||
| uuidtype_t * | type ) |
Caller must free allocated name
| void uuidcache_dump | ( | void | ) |
|
static |
indexed by hash of name
|
static |
indexed by hash of uuid