6 #define PRIV_NONE 0x0000
7 #define PRIV_BUILD 0x0001 /* build/interact */
8 #define PRIV_TELEPORT 0x0002 /* teleport */
9 #define PRIV_SETTIME 0x0004 /* set the time */
10 #define PRIV_PRIVS 0x0008 /* grant/revoke privs */
11 #define PRIV_SERVER 0x0010 /* server management (shutdown/settings/etc) */
12 #define PRIV_SHOUT 0x0020 /* chat */
13 #define PRIV_BAN 0x0040 /* ban/unban */
15 /* increment this if a priv is added */
18 #define PRIV_DEFAULT (PRIV_BUILD|PRIV_SHOUT)
19 #define PRIV_ALL 0x7FFFFFFFFFFFFFFF
20 #define PRIV_INVALID 0x8000000000000000
22 #ifndef _HAVE_AUTHDATA_TYPE
23 #define _HAVE_AUTHDATA_TYPE
24 typedef struct authdata_s
{
30 /* defined in auth.c */
31 int auth_privs2str(uint64_t privs
, char* buff
, int size
);
32 uint64_t auth_str2privs(char* str
);
33 int auth_init(char* file
);
37 int auth_exists(char* name
);
38 void auth_set(char* name
, authdata_t data
);
39 void auth_add(char* name
);
40 int auth_getpwd(char* name
, char buff
[64]);
41 void auth_setpwd(char* name
, char* pwd
);
42 uint64_t auth_getprivs(char* name
);
43 void auth_setprivs(char* name
, uint64_t privs
);