netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
cache.c File Reference
#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 _U_)
int search_cachebyname (const char *name, uuidtype_t *type, unsigned char *uuid)
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 _U_)

Variables

static cacheduser_tnamecache [256]
static cacheduser_tuuidcache [256]

Typedef Documentation

◆ cacheduser_t

typedef struct cacheduser cacheduser_t

Function Documentation

◆ add_cachebyname()

int add_cachebyname ( const char * inname,
const uuidp_t inuuid,
const uuidtype_t type,
const unsigned long uid _U_ )

◆ add_cachebyuuid()

int add_cachebyuuid ( uuidp_t inuuid,
const char * inname,
uuidtype_t type,
const unsigned long uid _U_ )

◆ hashstring()

unsigned char hashstring ( unsigned char * str)
static

◆ hashuuid()

unsigned char hashuuid ( uuidp_t uuid)
static

◆ search_cachebyname()

int search_cachebyname ( const char * name,
uuidtype_t * type,
unsigned char * uuid )

Search cache by name and uuid type

Parameters
name(r) name to search
type(rw) type (user or group) of name, returns found type here which might mark it as a negative entry
uuid(w) found uuid is returned here
Returns
0 on success, entry found -1 no entry found

◆ search_cachebyuuid()

int search_cachebyuuid ( uuidp_t uuidp,
char ** name,
uuidtype_t * type )

◆ uuidcache_dump()

void uuidcache_dump ( void )

Variable Documentation

◆ namecache

cacheduser_t* namecache[256]
static

◆ uuidcache

cacheduser_t* uuidcache[256]
static