gh-92658: Add Hyper-V socket support (GH-92755)

This commit is contained in:
Jordan Borean 2022-05-25 06:37:06 +10:00 committed by GitHub
parent 5115a16831
commit fbd11f3edd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 256 additions and 1 deletions

View file

@ -76,6 +76,15 @@ struct SOCKADDR_BTH_REDEF {
# else
typedef int socklen_t;
# endif /* IPPROTO_IPV6 */
/* Remove ifdef once Py_WINVER >= 0x0604
* socket.h only defines AF_HYPERV if _WIN32_WINNT is at that level or higher
* so for now it's just manually defined.
*/
# ifndef AF_HYPERV
# define AF_HYPERV 34
# endif
# include <hvsocket.h>
#endif /* MS_WINDOWS */
#ifdef HAVE_SYS_UN_H
@ -288,6 +297,9 @@ typedef union sock_addr {
#ifdef HAVE_LINUX_TIPC_H
struct sockaddr_tipc tipc;
#endif
#ifdef AF_HYPERV
SOCKADDR_HV hv;
#endif
} sock_addr_t;
/* The object holding a socket. It holds some extra information,