Linux Audio

Check our new training course

Loading...
v3.1
 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};
31
32#define XS_WRITE_NONE "NONE"
33#define XS_WRITE_CREATE "CREATE"
34#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
35
36/* We hand errors as strings, for portability. */
37struct xsd_errors
38{
39    int errnum;
40    const char *errstring;
41};
42#define XSD_ERROR(x) { x, #x }
43static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
44    XSD_ERROR(EINVAL),
45    XSD_ERROR(EACCES),
46    XSD_ERROR(EEXIST),
47    XSD_ERROR(EISDIR),
48    XSD_ERROR(ENOENT),
49    XSD_ERROR(ENOMEM),
50    XSD_ERROR(ENOSPC),
51    XSD_ERROR(EIO),
52    XSD_ERROR(ENOTEMPTY),
53    XSD_ERROR(ENOSYS),
54    XSD_ERROR(EROFS),
55    XSD_ERROR(EBUSY),
56    XSD_ERROR(EAGAIN),
57    XSD_ERROR(EISCONN)
58};
59
60struct xsd_sockmsg
61{
62    uint32_t type;  /* XS_??? */
63    uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
64    uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
65    uint32_t len;   /* Length of data following this. */
66
67    /* Generally followed by nul-terminated string(s). */
68};
69
70enum xs_watch_type
71{
72    XS_WATCH_PATH = 0,
73    XS_WATCH_TOKEN
74};
75
76/* Inter-domain shared memory communications. */
77#define XENSTORE_RING_SIZE 1024
78typedef uint32_t XENSTORE_RING_IDX;
79#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
80struct xenstore_domain_interface {
81    char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
82    char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
83    XENSTORE_RING_IDX req_cons, req_prod;
84    XENSTORE_RING_IDX rsp_cons, rsp_prod;
85};
 
 
 
86
87#endif /* _XS_WIRE_H */
v3.5.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};
34
35#define XS_WRITE_NONE "NONE"
36#define XS_WRITE_CREATE "CREATE"
37#define XS_WRITE_CREATE_EXCL "CREATE|EXCL"
38
39/* We hand errors as strings, for portability. */
40struct xsd_errors
41{
42    int errnum;
43    const char *errstring;
44};
45#define XSD_ERROR(x) { x, #x }
46static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
47    XSD_ERROR(EINVAL),
48    XSD_ERROR(EACCES),
49    XSD_ERROR(EEXIST),
50    XSD_ERROR(EISDIR),
51    XSD_ERROR(ENOENT),
52    XSD_ERROR(ENOMEM),
53    XSD_ERROR(ENOSPC),
54    XSD_ERROR(EIO),
55    XSD_ERROR(ENOTEMPTY),
56    XSD_ERROR(ENOSYS),
57    XSD_ERROR(EROFS),
58    XSD_ERROR(EBUSY),
59    XSD_ERROR(EAGAIN),
60    XSD_ERROR(EISCONN)
61};
62
63struct xsd_sockmsg
64{
65    uint32_t type;  /* XS_??? */
66    uint32_t req_id;/* Request identifier, echoed in daemon's response.  */
67    uint32_t tx_id; /* Transaction id (0 if not related to a transaction). */
68    uint32_t len;   /* Length of data following this. */
69
70    /* Generally followed by nul-terminated string(s). */
71};
72
73enum xs_watch_type
74{
75    XS_WATCH_PATH = 0,
76    XS_WATCH_TOKEN
77};
78
79/* Inter-domain shared memory communications. */
80#define XENSTORE_RING_SIZE 1024
81typedef uint32_t XENSTORE_RING_IDX;
82#define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
83struct xenstore_domain_interface {
84    char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
85    char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
86    XENSTORE_RING_IDX req_cons, req_prod;
87    XENSTORE_RING_IDX rsp_cons, rsp_prod;
88};
89
90/* Violating this is very bad.  See docs/misc/xenstore.txt. */
91#define XENSTORE_PAYLOAD_MAX 4096
92
93#endif /* _XS_WIRE_H */