Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_LINUX_VIRTIO_VSOCK_H |
| 20 | #define _UAPI_LINUX_VIRTIO_VSOCK_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/virtio_ids.h> |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 23 | #include <linux/virtio_config.h> |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 24 | #define VIRTIO_VSOCK_F_SEQPACKET 1 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 25 | struct virtio_vsock_config { |
| 26 | __le64 guest_cid; |
| 27 | } __attribute__((packed)); |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 28 | enum virtio_vsock_event_id { |
| 29 | VIRTIO_VSOCK_EVENT_TRANSPORT_RESET = 0, |
| 30 | }; |
| 31 | struct virtio_vsock_event { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 32 | __le32 id; |
| 33 | } __attribute__((packed)); |
| 34 | struct virtio_vsock_hdr { |
| 35 | __le64 src_cid; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 36 | __le64 dst_cid; |
| 37 | __le32 src_port; |
| 38 | __le32 dst_port; |
| 39 | __le32 len; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 40 | __le16 type; |
| 41 | __le16 op; |
| 42 | __le32 flags; |
| 43 | __le32 buf_alloc; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 44 | __le32 fwd_cnt; |
| 45 | } __attribute__((packed)); |
| 46 | enum virtio_vsock_type { |
| 47 | VIRTIO_VSOCK_TYPE_STREAM = 1, |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 48 | VIRTIO_VSOCK_TYPE_SEQPACKET = 2, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 49 | }; |
| 50 | enum virtio_vsock_op { |
| 51 | VIRTIO_VSOCK_OP_INVALID = 0, |
| 52 | VIRTIO_VSOCK_OP_REQUEST = 1, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 53 | VIRTIO_VSOCK_OP_RESPONSE = 2, |
| 54 | VIRTIO_VSOCK_OP_RST = 3, |
| 55 | VIRTIO_VSOCK_OP_SHUTDOWN = 4, |
| 56 | VIRTIO_VSOCK_OP_RW = 5, |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 57 | VIRTIO_VSOCK_OP_CREDIT_UPDATE = 6, |
| 58 | VIRTIO_VSOCK_OP_CREDIT_REQUEST = 7, |
| 59 | }; |
| 60 | enum virtio_vsock_shutdown { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 61 | VIRTIO_VSOCK_SHUTDOWN_RCV = 1, |
| 62 | VIRTIO_VSOCK_SHUTDOWN_SEND = 2, |
| 63 | }; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 64 | enum virtio_vsock_rw { |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 65 | VIRTIO_VSOCK_SEQ_EOM = 1, |
| 66 | VIRTIO_VSOCK_SEQ_EOR = 2, |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 67 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 68 | #endif |