2 * Details of the "wire" protocol between Xen Store Daemon and client
3 * library or guest kernel.
5 * SPDX-License-Identifier: MIT
7 * Copyright (C) 2005 Rusty Russell IBM Corporation
13 enum xsd_sockmsg_type
{
31 XS_IS_DOMAIN_INTRODUCED
,
37 XS_INVALID
= 0xffff /* Guaranteed to remain an invalid type */
40 #define XS_WRITE_NONE "NONE"
41 #define XS_WRITE_CREATE "CREATE"
42 #define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
44 /* We hand errors as strings, for portability. */
47 const CHAR8
*errstring
;
51 #define XSD_ERROR(x) { x, #x }
52 /* LINTED: static unused */
53 static struct xsd_errors xsd_errors
[]
54 #if defined (__GNUC__)
55 __attribute__ ((unused
))
66 XSD_ERROR (ENOTEMPTY
),
77 UINT32 type
; /* XS_??? */
78 UINT32 req_id
; /* Request identifier, echoed in daemon's response. */
79 UINT32 tx_id
; /* Transaction id (0 if not related to a transaction). */
80 UINT32 len
; /* Length of data following this. */
82 /* Generally followed by nul-terminated string(s). */
91 * `incontents 150 xenstore_struct XenStore wire protocol.
93 * Inter-domain shared memory communications. */
94 #define XENSTORE_RING_SIZE 1024
95 typedef UINT32 XENSTORE_RING_IDX
;
96 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
97 struct xenstore_domain_interface
{
98 CHAR8 req
[XENSTORE_RING_SIZE
]; /* Requests to xenstore daemon. */
99 CHAR8 rsp
[XENSTORE_RING_SIZE
]; /* Replies and async watch events. */
100 XENSTORE_RING_IDX req_cons
, req_prod
;
101 XENSTORE_RING_IDX rsp_cons
, rsp_prod
;
102 UINT32 server_features
; /* Bitmap of features supported by the server */
106 /* Violating this is very bad. See docs/misc/xenstore.txt. */
107 #define XENSTORE_PAYLOAD_MAX 4096
109 /* Violating these just gets you an error back */
110 #define XENSTORE_ABS_PATH_MAX 3072
111 #define XENSTORE_REL_PATH_MAX 2048
113 /* The ability to reconnect a ring */
114 #define XENSTORE_SERVER_FEATURE_RECONNECTION 1
116 /* Valid values for the connection field */
117 #define XENSTORE_CONNECTED 0 /* the steady-state */
118 #define XENSTORE_RECONNECT 1 /* guest has initiated a reconnect */
120 #endif /* _XS_WIRE_H */
125 * c-file-style: "BSD"
128 * indent-tabs-mode: nil