Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * Details of the "wire" protocol between Xen Store Daemon and client
 4 * library or guest kernel.
 5 * Copyright (C) 2005 Rusty Russell IBM Corporation
 6 */
 7
 8#ifndef _XS_WIRE_H
 9#define _XS_WIRE_H
10
11enum xsd_sockmsg_type
12{
13    XS_DEBUG,
14    XS_DIRECTORY,
15    XS_READ,
16    XS_GET_PERMS,
17    XS_WATCH,
18    XS_UNWATCH,
19    XS_TRANSACTION_START,
20    XS_TRANSACTION_END,
21    XS_INTRODUCE,
22    XS_RELEASE,
23    XS_GET_DOMAIN_PATH,
24    XS_WRITE,
25    XS_MKDIR,
26    XS_RM,
27    XS_SET_PERMS,
28    XS_WATCH_EVENT,
29    XS_ERROR,
30    XS_IS_DOMAIN_INTRODUCED,
31    XS_RESUME,
32    XS_SET_TARGET,
33    XS_RESTRICT,
34    XS_RESET_WATCHES,
35};
36
37#define XS_WRITE_NONE "NONE"
38#define XS_WRITE_CREATE "CREATE"
39#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
40
41/* We hand errors as strings, for portability. */
42struct xsd_errors
43{
44    int errnum;
45    const char *errstring;
46};
47#define XSD_ERROR(x) { x, #x }
48static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
49    XSD_ERROR(EINVAL),
50    XSD_ERROR(EACCES),
51    XSD_ERROR(EEXIST),
52    XSD_ERROR(EISDIR),
53    XSD_ERROR(ENOENT),
54    XSD_ERROR(ENOMEM),
55    XSD_ERROR(ENOSPC),
56    XSD_ERROR(EIO),
57    XSD_ERROR(ENOTEMPTY),
58    XSD_ERROR(ENOSYS),
59    XSD_ERROR(EROFS),
60    XSD_ERROR(EBUSY),
61    XSD_ERROR(EAGAIN),
62    XSD_ERROR(EISCONN)
63};
64
65struct xsd_sockmsg
66{
67    uint32_t type;  /* XS_??? */
68    uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
69    uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
70    uint32_t len;   /* Length of data following this. */
71
72    /* Generally followed by nul-terminated string(s). */
73};
74
75enum xs_watch_type
76{
77    XS_WATCH_PATH = 0,
78    XS_WATCH_TOKEN
79};
80
81/* Inter-domain shared memory communications. */
82#define XENSTORE_RING_SIZE 1024
83typedef uint32_t XENSTORE_RING_IDX;
84#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
85struct xenstore_domain_interface {
86    char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
87    char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
88    XENSTORE_RING_IDX req_cons, req_prod;
89    XENSTORE_RING_IDX rsp_cons, rsp_prod;
90};
91
92/* Violating this is very bad.  See docs/misc/xenstore.txt. */
93#define XENSTORE_PAYLOAD_MAX 4096
94
95#endif /* _XS_WIRE_H */
v4.6
 
 1/*
 2 * Details of the "wire" protocol between Xen Store Daemon and client
 3 * library or guest kernel.
 4 * Copyright (C) 2005 Rusty Russell IBM Corporation
 5 */
 6
 7#ifndef _XS_WIRE_H
 8#define _XS_WIRE_H
 9
10enum xsd_sockmsg_type
11{
12    XS_DEBUG,
13    XS_DIRECTORY,
14    XS_READ,
15    XS_GET_PERMS,
16    XS_WATCH,
17    XS_UNWATCH,
18    XS_TRANSACTION_START,
19    XS_TRANSACTION_END,
20    XS_INTRODUCE,
21    XS_RELEASE,
22    XS_GET_DOMAIN_PATH,
23    XS_WRITE,
24    XS_MKDIR,
25    XS_RM,
26    XS_SET_PERMS,
27    XS_WATCH_EVENT,
28    XS_ERROR,
29    XS_IS_DOMAIN_INTRODUCED,
30    XS_RESUME,
31    XS_SET_TARGET,
32    XS_RESTRICT,
33    XS_RESET_WATCHES,
34};
35
36#define XS_WRITE_NONE "NONE"
37#define XS_WRITE_CREATE "CREATE"
38#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
39
40/* We hand errors as strings, for portability. */
41struct xsd_errors
42{
43    int errnum;
44    const char *errstring;
45};
46#define XSD_ERROR(x) { x, #x }
47static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
48    XSD_ERROR(EINVAL),
49    XSD_ERROR(EACCES),
50    XSD_ERROR(EEXIST),
51    XSD_ERROR(EISDIR),
52    XSD_ERROR(ENOENT),
53    XSD_ERROR(ENOMEM),
54    XSD_ERROR(ENOSPC),
55    XSD_ERROR(EIO),
56    XSD_ERROR(ENOTEMPTY),
57    XSD_ERROR(ENOSYS),
58    XSD_ERROR(EROFS),
59    XSD_ERROR(EBUSY),
60    XSD_ERROR(EAGAIN),
61    XSD_ERROR(EISCONN)
62};
63
64struct xsd_sockmsg
65{
66    uint32_t type;  /* XS_??? */
67    uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
68    uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
69    uint32_t len;   /* Length of data following this. */
70
71    /* Generally followed by nul-terminated string(s). */
72};
73
74enum xs_watch_type
75{
76    XS_WATCH_PATH = 0,
77    XS_WATCH_TOKEN
78};
79
80/* Inter-domain shared memory communications. */
81#define XENSTORE_RING_SIZE 1024
82typedef uint32_t XENSTORE_RING_IDX;
83#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
84struct xenstore_domain_interface {
85    char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
86    char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
87    XENSTORE_RING_IDX req_cons, req_prod;
88    XENSTORE_RING_IDX rsp_cons, rsp_prod;
89};
90
91/* Violating this is very bad.  See docs/misc/xenstore.txt. */
92#define XENSTORE_PAYLOAD_MAX 4096
93
94#endif /* _XS_WIRE_H */