Merge ../paraslash.fml/paraslash
[paraslash.git] / user_list.h
1 /*
2 * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
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 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
17 */
18
19 /** \file user_list.h exported functions from user_list.c */
20
21 #include "list.h"
22 #include "crypt.h"
23
24 /**
25 * permission flags that can be set individually for any server command
26 *
27 * - DB_READ: command reads from the database
28 * - DB_WRITE: command changes the contents of the database
29 * - VSS_READ: command reads information about the current audio stream
30 * - VSS_WRITE: command changes the current audio stream
31 */
32 enum {DB_READ = 1, DB_WRITE = 2, VSS_READ = 4, VSS_WRITE = 8};
33
34 /**
35 * data needed to authenticate the user
36 */
37 struct user {
38 /** the position of this user in the list of users */
39 struct list_head node;
40 /** the username */
41 char *name;
42 /** the public RSA key */
43 RSA *rsa;
44 /** the privileges that this user has */
45 unsigned int perms;
46 };
47
48 void init_user_list(char *user_list_file);
49 int lookup_user(struct user *user);