Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xs_wire.h
Go to the documentation of this file.
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 
11 {
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. */
41 struct xsd_errors
42 {
43  int errnum;
44  const char *errstring;
45 };
46 #define XSD_ERROR(x) { x, #x }
47 static struct xsd_errors xsd_errors[] __attribute__((unused)) = {
55  XSD_ERROR(EIO),
62 };
63 
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 
75 {
78 };
79 
80 /* Inter-domain shared memory communications. */
81 #define XENSTORE_RING_SIZE 1024
83 #define MASK_XENSTORE_IDX(idx) ((idx) & (XENSTORE_RING_SIZE-1))
85  char req[XENSTORE_RING_SIZE]; /* Requests to xenstore daemon. */
86  char rsp[XENSTORE_RING_SIZE]; /* Replies and async watch events. */
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 */