source: trunk/packages/xen-3.1/xen-3.1/xen/include/public/acm_ops.h @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 4.5 KB
Line 
1/*
2 * acm_ops.h: Xen access control module hypervisor commands
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 *
22 * Reiner Sailer <sailer@watson.ibm.com>
23 * Copyright (c) 2005,2006 International Business Machines Corporation.
24 */
25
26#ifndef __XEN_PUBLIC_ACM_OPS_H__
27#define __XEN_PUBLIC_ACM_OPS_H__
28
29#include "xen.h"
30#include "acm.h"
31
32/*
33 * Make sure you increment the interface version whenever you modify this file!
34 * This makes sure that old versions of acm tools will stop working in a
35 * well-defined way (rather than crashing the machine, for instance).
36 */
37#define ACM_INTERFACE_VERSION   0xAAAA0009
38
39/************************************************************************/
40
41/*
42 * Prototype for this hypercall is:
43 *  int acm_op(int cmd, void *args)
44 * @cmd  == ACMOP_??? (access control module operation).
45 * @args == Operation-specific extra arguments (NULL if none).
46 */
47
48
49#define ACMOP_setpolicy         1
50struct acm_setpolicy {
51    /* IN */
52    uint32_t interface_version;
53    XEN_GUEST_HANDLE_64(void) pushcache;
54    uint32_t pushcache_size;
55};
56
57
58#define ACMOP_getpolicy         2
59struct acm_getpolicy {
60    /* IN */
61    uint32_t interface_version;
62    XEN_GUEST_HANDLE_64(void) pullcache;
63    uint32_t pullcache_size;
64};
65
66
67#define ACMOP_dumpstats         3
68struct acm_dumpstats {
69    /* IN */
70    uint32_t interface_version;
71    XEN_GUEST_HANDLE_64(void) pullcache;
72    uint32_t pullcache_size;
73};
74
75
76#define ACMOP_getssid           4
77#define ACM_GETBY_ssidref  1
78#define ACM_GETBY_domainid 2
79struct acm_getssid {
80    /* IN */
81    uint32_t interface_version;
82    uint32_t get_ssid_by; /* ACM_GETBY_* */
83    union {
84        domaintype_t domainid;
85        ssidref_t    ssidref;
86    } id;
87    XEN_GUEST_HANDLE_64(void) ssidbuf;
88    uint32_t ssidbuf_size;
89};
90
91#define ACMOP_getdecision      5
92struct acm_getdecision {
93    /* IN */
94    uint32_t interface_version;
95    uint32_t get_decision_by1; /* ACM_GETBY_* */
96    uint32_t get_decision_by2; /* ACM_GETBY_* */
97    union {
98        domaintype_t domainid;
99        ssidref_t    ssidref;
100    } id1;
101    union {
102        domaintype_t domainid;
103        ssidref_t    ssidref;
104    } id2;
105    uint32_t hook;
106    /* OUT */
107    uint32_t acm_decision;
108};
109
110
111#define ACMOP_chgpolicy        6
112struct acm_change_policy {
113    /* IN */
114    uint32_t interface_version;
115    XEN_GUEST_HANDLE_64(void) policy_pushcache;
116    uint32_t policy_pushcache_size;
117    XEN_GUEST_HANDLE_64(void) del_array;
118    uint32_t delarray_size;
119    XEN_GUEST_HANDLE_64(void) chg_array;
120    uint32_t chgarray_size;
121    /* OUT */
122    /* array with error code */
123    XEN_GUEST_HANDLE_64(void) err_array;
124    uint32_t errarray_size;
125};
126
127#define ACMOP_relabeldoms       7
128struct acm_relabel_doms {
129    /* IN */
130    uint32_t interface_version;
131    XEN_GUEST_HANDLE_64(void) relabel_map;
132    uint32_t relabel_map_size;
133    /* OUT */
134    XEN_GUEST_HANDLE_64(void) err_array;
135    uint32_t errarray_size;
136};
137
138/* future interface to Xen */
139struct xen_acmctl {
140    uint32_t cmd;
141    uint32_t interface_version;
142    union {
143        struct acm_setpolicy     setpolicy;
144        struct acm_getpolicy     getpolicy;
145        struct acm_dumpstats     dumpstats;
146        struct acm_getssid       getssid;
147        struct acm_getdecision   getdecision;
148        struct acm_change_policy change_policy;
149        struct acm_relabel_doms  relabel_doms;
150    } u;
151};
152
153typedef struct xen_acmctl xen_acmctl_t;
154DEFINE_XEN_GUEST_HANDLE(xen_acmctl_t);
155
156#endif /* __XEN_PUBLIC_ACM_OPS_H__ */
157
158/*
159 * Local variables:
160 * mode: C
161 * c-set-style: "BSD"
162 * c-basic-offset: 4
163 * tab-width: 4
164 * indent-tabs-mode: nil
165 * End:
166 */
Note: See TracBrowser for help on using the repository browser.