1 /* $NetBSD: xs_wire.h,v 1.8 2008/05/04 19:56:29 cegger Exp $ */
3 * Details of the "wire" protocol between Xen Store Daemon and client
4 * library or guest kernel.
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 * Copyright (C) 2005 Rusty Russell IBM Corporation
49 XS_IS_DOMAIN_INTRODUCED
,
54 #define XS_WRITE_NONE "NONE"
55 #define XS_WRITE_CREATE "CREATE"
56 #define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
58 /* We hand errors as strings, for portability. */
62 const char *errstring
;
64 #define XSD_ERROR(x) { x, #x }
65 /* LINTED: static unused */
66 static struct xsd_errors xsd_errors
[]
68 __attribute__((unused
))
89 uint32_t type
; /* XS_??? */
90 uint32_t req_id
;/* Request identifier, echoed in daemon's response. */
91 uint32_t tx_id
; /* Transaction id (0 if not related to a transaction). */
92 uint32_t len
; /* Length of data following this. */
94 /* Generally followed by nul-terminated string(s). */
103 /* Inter-domain shared memory communications. */
104 #define XENSTORE_RING_SIZE 1024
105 typedef uint32_t XENSTORE_RING_IDX
;
106 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
107 struct xenstore_domain_interface
{
108 char req
[XENSTORE_RING_SIZE
]; /* Requests to xenstore daemon. */
109 char rsp
[XENSTORE_RING_SIZE
]; /* Replies and async watch events. */
110 volatile XENSTORE_RING_IDX req_cons
, req_prod
;
111 volatile XENSTORE_RING_IDX rsp_cons
, rsp_prod
;
114 /* Violating this is very bad. See docs/misc/xenstore.txt. */
115 #define XENSTORE_PAYLOAD_MAX 4096
117 /* Violating these just gets you an error back */
118 #define XENSTORE_ABS_PATH_MAX 3072
119 #define XENSTORE_REL_PATH_MAX 2048
121 #endif /* _XS_WIRE_H */
129 * indent-tabs-mode: nil