1 #ifndef _PALACIOS_KEYED_STREAM_USER_H_
2 #define _PALACIOS_KEYED_STREAM_USER_H_
5 * Palacios Keyed Stream User Interface
6 * (c) Clint Sbisa, 2011
10 // Issue a V3_VM_KSTREAM_USER_CONNECT on the VM to acquire an fd for the device
12 // get size of pending request
13 // Note that this is not the wrong ioctl - the connect ioctl applies to the VM device
14 // the following ioctls apply to the FD returned by the connect
15 #define V3_KSTREAM_REQUEST_SIZE_IOCTL (11244+1)
16 // get the pending request
17 #define V3_KSTREAM_REQUEST_PULL_IOCTL (11244+2)
18 // push a response to the previously pulled request
19 #define V3_KSTREAM_RESPONSE_PUSH_IOCTL (11244+3)
28 struct palacios_user_keyed_stream_url {
30 char url[0]; // len describes it
35 // This structure is used for both requests (kernel->user)
36 // and responses (user->kernel)
38 // for a readkey request, the buf contains the tag
39 // for a readkey response, the buf contains the data
40 // for a writekey request, the buf contains the data + key
41 // for a writekey request, the buf contains nothing
42 struct palacios_user_keyed_stream_op {
44 uint64_t len; // total structure length (all)
46 int type; // request or response type
47 #define PALACIOS_KSTREAM_OPEN 1 // not used
48 #define PALACIOS_KSTREAM_CLOSE 2 // not used
49 #define PALACIOS_KSTREAM_OPEN_KEY 3
50 #define PALACIOS_KSTREAM_CLOSE_KEY 4
51 #define PALACIOS_KSTREAM_WRITE_KEY 5
52 #define PALACIOS_KSTREAM_READ_KEY 6
54 sint64_t xfer; // total bytes read or written (request/response)
57 void *user_key; // user tag for an open key (response)
59 uint64_t buf_len; // buffer len
60 uint64_t data_off; // offset of data within the buffer
61 // 0..buffer_len-1 is tag
63 char buf[0]; // expanded as needed (key or value)
65 // The buffer contains the key or the value