• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ***   Copied and modified from bionic/libc/kernel/uapi/linux/vm_sockets.h
11  ***
12  ****************************************************************************
13  ****************************************************************************/
14 #pragma once
15 
16 #ifdef __BIONIC__
17 #include <linux/vm_sockets.h>
18 #else
19 
20 #ifndef _UAPI_VM_SOCKETS_H
21 #define _UAPI_VM_SOCKETS_H
22 #define SO_VM_SOCKETS_BUFFER_SIZE 0
23 #define SO_VM_SOCKETS_BUFFER_MIN_SIZE 1
24 #define SO_VM_SOCKETS_BUFFER_MAX_SIZE 2
25 #define SO_VM_SOCKETS_PEER_HOST_VM_ID 3
26 #define SO_VM_SOCKETS_TRUSTED 5
27 #define SO_VM_SOCKETS_CONNECT_TIMEOUT 6
28 #define SO_VM_SOCKETS_NONBLOCK_TXRX 7
29 #define VMADDR_CID_ANY (-1U)
30 #define VMADDR_PORT_ANY (-1U)
31 #define VMADDR_CID_HYPERVISOR 0
32 #define VMADDR_CID_LOCAL 1
33 #define VMADDR_CID_HOST 2
34 #define VM_SOCKETS_INVALID_VERSION (-1U)
35 #define VM_SOCKETS_VERSION_EPOCH(_v) (((_v)&0xFF000000) >> 24)
36 #define VM_SOCKETS_VERSION_MAJOR(_v) (((_v)&0x00FF0000) >> 16)
37 #define VM_SOCKETS_VERSION_MINOR(_v) (((_v)&0x0000FFFF))
38 struct sockaddr_vm {
39     sa_family_t svm_family;
40     // NOLINTNEXTLINE(google-runtime-int)
41     unsigned short svm_reserved1;
42     unsigned int svm_port;
43     unsigned int svm_cid;
44     // NOLINTNEXTLINE(google-runtime-int)
45     unsigned char svm_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(unsigned short) -
46                            sizeof(unsigned int) - sizeof(unsigned int)];
47 };
48 #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9)
49 #ifndef AF_VSOCK
50 #define AF_VSOCK 40
51 #endif
52 #endif
53 
54 #endif
55