root / acl.h @ 651721b2
History | View | Annotate | Download (2.1 kB)
1 | 76655d6d | aliguori | /*
|
---|---|---|---|
2 | 76655d6d | aliguori | * QEMU access control list management
|
3 | 76655d6d | aliguori | *
|
4 | 76655d6d | aliguori | * Copyright (C) 2009 Red Hat, Inc
|
5 | 76655d6d | aliguori | *
|
6 | 76655d6d | aliguori | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 76655d6d | aliguori | * of this software and associated documentation files (the "Software"), to deal
|
8 | 76655d6d | aliguori | * in the Software without restriction, including without limitation the rights
|
9 | 76655d6d | aliguori | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 76655d6d | aliguori | * copies of the Software, and to permit persons to whom the Software is
|
11 | 76655d6d | aliguori | * furnished to do so, subject to the following conditions:
|
12 | 76655d6d | aliguori | *
|
13 | 76655d6d | aliguori | * The above copyright notice and this permission notice shall be included in
|
14 | 76655d6d | aliguori | * all copies or substantial portions of the Software.
|
15 | 76655d6d | aliguori | *
|
16 | 76655d6d | aliguori | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 76655d6d | aliguori | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 76655d6d | aliguori | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 76655d6d | aliguori | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 76655d6d | aliguori | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 76655d6d | aliguori | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 76655d6d | aliguori | * THE SOFTWARE.
|
23 | 76655d6d | aliguori | */
|
24 | 76655d6d | aliguori | |
25 | 76655d6d | aliguori | #ifndef __QEMU_ACL_H__
|
26 | 76655d6d | aliguori | #define __QEMU_ACL_H__
|
27 | 76655d6d | aliguori | |
28 | 76655d6d | aliguori | #include "sys-queue.h" |
29 | 76655d6d | aliguori | |
30 | 76655d6d | aliguori | typedef struct qemu_acl_entry qemu_acl_entry; |
31 | 76655d6d | aliguori | typedef struct qemu_acl qemu_acl; |
32 | 76655d6d | aliguori | |
33 | 76655d6d | aliguori | struct qemu_acl_entry {
|
34 | 76655d6d | aliguori | char *match;
|
35 | 76655d6d | aliguori | int deny;
|
36 | 76655d6d | aliguori | |
37 | 76655d6d | aliguori | TAILQ_ENTRY(qemu_acl_entry) next; |
38 | 76655d6d | aliguori | }; |
39 | 76655d6d | aliguori | |
40 | 76655d6d | aliguori | struct qemu_acl {
|
41 | 76655d6d | aliguori | char *aclname;
|
42 | 76655d6d | aliguori | unsigned int nentries; |
43 | 76655d6d | aliguori | TAILQ_HEAD(,qemu_acl_entry) entries; |
44 | 76655d6d | aliguori | int defaultDeny;
|
45 | 76655d6d | aliguori | }; |
46 | 76655d6d | aliguori | |
47 | 76655d6d | aliguori | qemu_acl *qemu_acl_init(const char *aclname); |
48 | 76655d6d | aliguori | |
49 | 76655d6d | aliguori | qemu_acl *qemu_acl_find(const char *aclname); |
50 | 76655d6d | aliguori | |
51 | 76655d6d | aliguori | int qemu_acl_party_is_allowed(qemu_acl *acl,
|
52 | 76655d6d | aliguori | const char *party); |
53 | 76655d6d | aliguori | |
54 | 76655d6d | aliguori | void qemu_acl_reset(qemu_acl *acl);
|
55 | 76655d6d | aliguori | |
56 | 76655d6d | aliguori | int qemu_acl_append(qemu_acl *acl,
|
57 | 76655d6d | aliguori | int deny,
|
58 | 76655d6d | aliguori | const char *match); |
59 | 76655d6d | aliguori | int qemu_acl_insert(qemu_acl *acl,
|
60 | 76655d6d | aliguori | int deny,
|
61 | 76655d6d | aliguori | const char *match, |
62 | 76655d6d | aliguori | int index);
|
63 | 76655d6d | aliguori | int qemu_acl_remove(qemu_acl *acl,
|
64 | 76655d6d | aliguori | const char *match); |
65 | 76655d6d | aliguori | |
66 | 76655d6d | aliguori | #endif /* __QEMU_ACL_H__ */ |
67 | 76655d6d | aliguori | |
68 | 76655d6d | aliguori | /*
|
69 | 76655d6d | aliguori | * Local variables:
|
70 | 76655d6d | aliguori | * c-indent-level: 4
|
71 | 76655d6d | aliguori | * c-basic-offset: 4
|
72 | 76655d6d | aliguori | * tab-width: 8
|
73 | 76655d6d | aliguori | * End:
|
74 | 76655d6d | aliguori | */ |