1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include <sys/socket.h> 5 6 #if HAVE_LINUX_VM_SOCKETS_H 7 #include <linux/vm_sockets.h> 8 #else 9 #define VMADDR_CID_ANY -1U 10 struct sockaddr_vm { 11 unsigned short svm_family; 12 unsigned short svm_reserved1; 13 unsigned int svm_port; 14 unsigned int svm_cid; 15 unsigned char svm_zero[sizeof(struct sockaddr) - 16 sizeof(unsigned short) - 17 sizeof(unsigned short) - 18 sizeof(unsigned int) - 19 sizeof(unsigned int)]; 20 }; 21 #endif /* !HAVE_LINUX_VM_SOCKETS_H */ 22 23 #ifndef AF_VSOCK 24 #define AF_VSOCK 40 25 #endif 26 27 #ifndef SO_REUSEPORT 28 #define SO_REUSEPORT 15 29 #endif 30 31 #ifndef SO_PEERGROUPS 32 #define SO_PEERGROUPS 59 33 #endif 34 35 #ifndef SO_BINDTOIFINDEX 36 #define SO_BINDTOIFINDEX 62 37 #endif 38 39 #ifndef SOL_NETLINK 40 #define SOL_NETLINK 270 41 #endif 42 43 #ifndef SOL_ALG 44 #define SOL_ALG 279 45 #endif 46 47 /* Not exposed yet. Defined in include/linux/socket.h. */ 48 #ifndef SOL_SCTP 49 #define SOL_SCTP 132 50 #endif 51 52 /* Not exposed yet. Defined in include/linux/socket.h */ 53 #ifndef SCM_SECURITY 54 #define SCM_SECURITY 0x03 55 #endif 56 57 /* netinet/in.h */ 58 #ifndef IP_FREEBIND 59 #define IP_FREEBIND 15 60 #endif 61 62 #ifndef IP_TRANSPARENT 63 #define IP_TRANSPARENT 19 64 #endif 65 66 #ifndef IPV6_FREEBIND 67 #define IPV6_FREEBIND 78 68 #endif 69 70 #ifndef IP_RECVFRAGSIZE 71 #define IP_RECVFRAGSIZE 25 72 #endif 73 74 #ifndef IPV6_RECVFRAGSIZE 75 #define IPV6_RECVFRAGSIZE 77 76 #endif 77 78 /* linux/sockios.h */ 79 #ifndef SIOCGSKNS 80 #define SIOCGSKNS 0x894C 81 #endif 82