blob: 3eac719a6b0c3179f83f09e610edd93262a049f6 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris49f525c2016-12-12 14:55:36 -08007#ifndef _UAPI_LINUX_VIRTIO_VSOCK_H
8#define _UAPI_LINUX_VIRTIO_VSOCK_H
9#include <linux/types.h>
10#include <linux/virtio_ids.h>
Christopher Ferris49f525c2016-12-12 14:55:36 -080011#include <linux/virtio_config.h>
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000012#define VIRTIO_VSOCK_F_SEQPACKET 1
Christopher Ferris49f525c2016-12-12 14:55:36 -080013struct virtio_vsock_config {
14 __le64 guest_cid;
15} __attribute__((packed));
Christopher Ferris49f525c2016-12-12 14:55:36 -080016enum virtio_vsock_event_id {
17 VIRTIO_VSOCK_EVENT_TRANSPORT_RESET = 0,
18};
19struct virtio_vsock_event {
Christopher Ferris49f525c2016-12-12 14:55:36 -080020 __le32 id;
21} __attribute__((packed));
22struct virtio_vsock_hdr {
23 __le64 src_cid;
Christopher Ferris49f525c2016-12-12 14:55:36 -080024 __le64 dst_cid;
25 __le32 src_port;
26 __le32 dst_port;
27 __le32 len;
Christopher Ferris49f525c2016-12-12 14:55:36 -080028 __le16 type;
29 __le16 op;
30 __le32 flags;
31 __le32 buf_alloc;
Christopher Ferris49f525c2016-12-12 14:55:36 -080032 __le32 fwd_cnt;
33} __attribute__((packed));
34enum virtio_vsock_type {
35 VIRTIO_VSOCK_TYPE_STREAM = 1,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000036 VIRTIO_VSOCK_TYPE_SEQPACKET = 2,
Christopher Ferris49f525c2016-12-12 14:55:36 -080037};
38enum virtio_vsock_op {
39 VIRTIO_VSOCK_OP_INVALID = 0,
40 VIRTIO_VSOCK_OP_REQUEST = 1,
Christopher Ferris49f525c2016-12-12 14:55:36 -080041 VIRTIO_VSOCK_OP_RESPONSE = 2,
42 VIRTIO_VSOCK_OP_RST = 3,
43 VIRTIO_VSOCK_OP_SHUTDOWN = 4,
44 VIRTIO_VSOCK_OP_RW = 5,
Christopher Ferris49f525c2016-12-12 14:55:36 -080045 VIRTIO_VSOCK_OP_CREDIT_UPDATE = 6,
46 VIRTIO_VSOCK_OP_CREDIT_REQUEST = 7,
47};
48enum virtio_vsock_shutdown {
Christopher Ferris49f525c2016-12-12 14:55:36 -080049 VIRTIO_VSOCK_SHUTDOWN_RCV = 1,
50 VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
51};
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000052enum virtio_vsock_rw {
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070053 VIRTIO_VSOCK_SEQ_EOM = 1,
54 VIRTIO_VSOCK_SEQ_EOR = 2,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000055};
Christopher Ferris49f525c2016-12-12 14:55:36 -080056#endif