diff options
author | thegeorg <thegeorg@yandex-team.com> | 2023-07-26 01:18:20 +0300 |
---|---|---|
committer | root <root@qavm-2ed34686.qemu> | 2023-07-26 01:18:20 +0300 |
commit | efba792089e8ed1cdee516e6fe39afa8ccd07570 (patch) | |
tree | fa8ff67117859064f23b758a7b333f8b2e3a0859 /contrib/libs/linux-headers/linux/vm_sockets.h | |
parent | 5c939e73d60a6ba835239eaad1edf65ec70c5f17 (diff) | |
download | ydb-efba792089e8ed1cdee516e6fe39afa8ccd07570.tar.gz |
Update contrib/libs/linux-headers to 6.4.5
Diffstat (limited to 'contrib/libs/linux-headers/linux/vm_sockets.h')
-rw-r--r-- | contrib/libs/linux-headers/linux/vm_sockets.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/contrib/libs/linux-headers/linux/vm_sockets.h b/contrib/libs/linux-headers/linux/vm_sockets.h index 196b6de8ba..3692d4391e 100644 --- a/contrib/libs/linux-headers/linux/vm_sockets.h +++ b/contrib/libs/linux-headers/linux/vm_sockets.h @@ -18,6 +18,7 @@ #define _VM_SOCKETS_H #include <linux/socket.h> +#include <linux/types.h> /* Option name for STREAM socket buffer size. Use as the option name in * setsockopt(3) or getsockopt(3) to set or get an unsigned long long that @@ -63,7 +64,7 @@ * timeout for a STREAM socket. */ -#define SO_VM_SOCKETS_CONNECT_TIMEOUT 6 +#define SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD 6 /* Option name for using non-blocking send/receive. Use as the option name * for setsockopt(3) or getsockopt(3) to set or get the non-blocking @@ -80,6 +81,15 @@ #define SO_VM_SOCKETS_NONBLOCK_TXRX 7 +#define SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW 8 + +#if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__)) +#define SO_VM_SOCKETS_CONNECT_TIMEOUT SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD +#else +#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) +#endif + /* The vSocket equivalent of INADDR_ANY. This works for the svm_cid field of * sockaddr_vm and indicates the context ID of the current endpoint. */ @@ -114,6 +124,26 @@ #define VMADDR_CID_HOST 2 +/* The current default use case for the vsock channel is the following: + * local vsock communication between guest and host and nested VMs setup. + * In addition to this, implicitly, the vsock packets are forwarded to the host + * if no host->guest vsock transport is set. + * + * Set this flag value in the sockaddr_vm corresponding field if the vsock + * packets need to be always forwarded to the host. Using this behavior, + * vsock communication between sibling VMs can be setup. + * + * This way can explicitly distinguish between vsock channels created for + * different use cases, such as nested VMs (or local communication between + * guest and host) and sibling VMs. + * + * The flag can be set in the connect logic in the user space application flow. + * In the listen logic (from kernel space) the flag is set on the remote peer + * address. This happens for an incoming connection when it is routed from the + * host and comes from the guest (local CID and remote CID > VMADDR_CID_HOST). + */ +#define VMADDR_FLAG_TO_HOST 0x01 + /* Invalid vSockets version. */ #define VM_SOCKETS_INVALID_VERSION -1U @@ -148,10 +178,13 @@ struct sockaddr_vm { unsigned short svm_reserved1; unsigned int svm_port; unsigned int svm_cid; + __u8 svm_flags; unsigned char svm_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - sizeof(unsigned short) - - sizeof(unsigned int) - sizeof(unsigned int)]; + sizeof(unsigned int) - + sizeof(unsigned int) - + sizeof(__u8)]; }; #define IOCTL_VM_SOCKETS_GET_LOCAL_CID _IO(7, 0xb9) |