]> arthur.barton.de Git - netatalk.git/blob - include/atalk/uuid.h
LDAP config string values must be strdup'ed
[netatalk.git] / include / atalk / uuid.h
1 /*
2    Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8  
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13  */
14
15 #ifndef AFP_UUID_H
16 #define AFP_UUID_H
17
18 #define UUID_BINSIZE 16
19 #define UUID_STRINGSIZE 36
20 #define UUID_PRINTABLE_STRING_LENGTH 37
21
22 typedef const unsigned char *uuidp_t;
23 typedef unsigned char atalk_uuid_t[UUID_BINSIZE];
24
25 typedef enum {UUID_USER   = 1,
26               UUID_GROUP  = 2,
27               UUID_ENOENT = 4} /* used as bit flag */
28     uuidtype_t;
29 #define UUIDTYPESTR_MASK 3
30 extern char *uuidtype[];
31
32 /* afp_options.c needs these. defined in libatalk/ldap.c */
33 extern char *ldap_host;
34 extern int  ldap_auth_method;
35 extern char *ldap_auth_dn;
36 extern char *ldap_auth_pw;
37 extern char *ldap_userbase;
38 extern char *ldap_groupbase;
39 extern char *ldap_uuid_attr;
40 extern char *ldap_name_attr;
41 extern char *ldap_group_attr;
42 extern char *ldap_uid_attr;
43
44 /******************************************************** 
45  * Interface
46  ********************************************************/
47
48 extern int getuuidfromname( const char *name, uuidtype_t type, unsigned char *uuid);
49 extern int getnamefromuuid( const unsigned char *uuid, char **name, uuidtype_t *type);
50 extern void localuuid_from_id(unsigned char *buf, uuidtype_t type, unsigned int id);
51 extern const char *uuid_bin2string(const unsigned char *uuid);
52 extern void uuid_string2bin( const char *uuidstring, unsigned char *uuid);
53 extern void uuidcache_dump(void);
54
55 #endif /* AFP_UUID_H */