blob: 58f720d97ebb1d8f3a2213dc57b33c46c70fcbc8 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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_VM_SOCKETS_H
20#define _UAPI_VM_SOCKETS_H
21#include <linux/socket.h>
Christopher Ferris05667cd2021-02-16 16:01:34 -080022#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define SO_VM_SOCKETS_BUFFER_SIZE 0
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1
25#define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2
26#define SO_VM_SOCKETS_PEER_HOST_VM_ID 3
27#define SO_VM_SOCKETS_TRUSTED 5
Christopher Ferrisa4792612022-01-10 13:51:15 -080028#define SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD 6
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define SO_VM_SOCKETS_NONBLOCK_TXRX 7
Christopher Ferrisa4792612022-01-10 13:51:15 -080030#define SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW 8
31#if __BITS_PER_LONG == 64 || defined(__x86_64__) && defined(__ILP32__)
32#define SO_VM_SOCKETS_CONNECT_TIMEOUT SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD
33#else
34#define SO_VM_SOCKETS_CONNECT_TIMEOUT (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD : SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW)
35#endif
Tao Baod7db5942015-01-28 10:07:51 -080036#define VMADDR_CID_ANY - 1U
37#define VMADDR_PORT_ANY - 1U
Ben Cheng655a7c02013-10-16 16:09:24 -070038#define VMADDR_CID_HYPERVISOR 0
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070039#define VMADDR_CID_LOCAL 1
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define VMADDR_CID_HOST 2
Christopher Ferris05667cd2021-02-16 16:01:34 -080041#define VMADDR_FLAG_TO_HOST 0x01
Tao Baod7db5942015-01-28 10:07:51 -080042#define VM_SOCKETS_INVALID_VERSION - 1U
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define VM_SOCKETS_VERSION_EPOCH(_v) (((_v) & 0xFF000000) >> 24)
44#define VM_SOCKETS_VERSION_MAJOR(_v) (((_v) & 0x00FF0000) >> 16)
45#define VM_SOCKETS_VERSION_MINOR(_v) (((_v) & 0x0000FFFF))
46struct sockaddr_vm {
Tao Baod7db5942015-01-28 10:07:51 -080047 __kernel_sa_family_t svm_family;
48 unsigned short svm_reserved1;
49 unsigned int svm_port;
50 unsigned int svm_cid;
Christopher Ferris05667cd2021-02-16 16:01:34 -080051 __u8 svm_flags;
52 unsigned char svm_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(unsigned short) - sizeof(unsigned int) - sizeof(unsigned int) - sizeof(__u8)];
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54#define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
55#endif