X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fatalk%2Fuuid.h;h=4c9b3c95f8ff0225b503da0ae7bf3aeaa6d8e3ac;hb=3a84db87064922ad10ac10cc1d6833380e575995;hp=2c2d502f378e4c25df677445d76d0e8aff85e344;hpb=7d6f12a42d3a94a91f16788e753fea51d03fe2ba;p=netatalk.git diff --git a/include/atalk/uuid.h b/include/atalk/uuid.h index 2c2d502f..4c9b3c95 100644 --- a/include/atalk/uuid.h +++ b/include/atalk/uuid.h @@ -1,5 +1,4 @@ /* - $Id: uuid.h,v 1.1 2009-02-02 11:55:01 franklahm Exp $ Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify @@ -17,57 +16,26 @@ #define AFP_UUID_H #define UUID_BINSIZE 16 -#define UUID_STRINGSIZE 36 -typedef char *uuidp_t; -typedef char atalk_uuid_t[UUID_BINSIZE]; +typedef const unsigned char *uuidp_t; +typedef unsigned char atalk_uuid_t[UUID_BINSIZE]; -typedef enum {UUID_USER = 1, UUID_GROUP} uuidtype_t; +typedef enum {UUID_USER = 1, + UUID_GROUP = 2, + UUID_ENOENT = 4} /* used as bit flag */ + uuidtype_t; +#define UUIDTYPESTR_MASK 3 extern char *uuidtype[]; -/* afp_options.c needs these. defined in libatalk/ldap.c */ -extern char *ldap_host; -extern int ldap_auth_method; -extern char *ldap_auth_dn; -extern char *ldap_auth_pw; -extern char *ldap_userbase; -extern char *ldap_groupbase; -extern char *ldap_uuid_attr; -extern char *ldap_name_attr; -extern char *ldap_group_attr; -extern char *ldap_uid_attr; - /******************************************************** * Interface ********************************************************/ -/* - * name: give me his name - * type: and type (UUID_USER or UUID_GROUP) - * uuid: and I'll try to return you his uuid - * returns 0 on success !=0 on errror - */ -extern int getuuidfromname( const char *name, uuidtype_t type, uuidp_t uuid); - -/* - * uuidp: give me a pointer to a uuid - * name: and I'll allocate a buf with his name and store a pointer to buf - * type: returns USER or GROUP - * return 0 on success !=0 on errror - */ -extern int getnamefromuuid( uuidp_t uuidp, char **name, uuidtype_t *type); - -/* - * convert 16 byte binary uuid to neat ascii represantation including dashes - * string is allocated and pointer returned. caller must freee. - */ -extern int uuid_bin2string( uuidp_t uuidp, char **uuidstring); - - -/* - * convert ascii string that can include dashes to binary uuid. - * caller must provide a buffer. - */ -extern void uuid_string2bin( const char *uuidstring, uuidp_t uuid); +extern int getuuidfromname( const char *name, uuidtype_t type, unsigned char *uuid); +extern int getnamefromuuid( const unsigned char *uuid, char **name, uuidtype_t *type); +extern void localuuid_from_id(unsigned char *buf, uuidtype_t type, unsigned int id); +extern const char *uuid_bin2string(const unsigned char *uuid); +extern void uuid_string2bin( const char *uuidstring, unsigned char *uuid); +extern void uuidcache_dump(void); #endif /* AFP_UUID_H */