-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathhvsocket.h
executable file
·122 lines (98 loc) · 2.87 KB
/
hvsocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*++
Copyright (c) Microsoft Corporation
Module Name:
HvSocket.h
Abstract:
This file contains the core definitions for the Hyper-V
socket address family that can be used by both user-mode and
kernel mode modules.
Reference AF_HYPERV in ws2def.h
--*/
#ifdef _MSC_VER
#pragma once
#endif //_MSC_VER
#include <initguid.h>
#include <ws2def.h>
//
// Hyper-v Socket options.
//
//
// Following options are available for Socket option level
// HV_PROTOCOL_RAW:
//
//
// HVSOCKET_CONNECT_TIMEOUT:
// Input:
// Type: ULONG.
// Description:
// The timeout in milliseconds.
//
#define HVSOCKET_CONNECT_TIMEOUT 0x01
//
// The maximum connect timeout is 5 minutes.
//
#define HVSOCKET_CONNECT_TIMEOUT_MAX 300000
//
// HVSOCKET_CONTAINER_PASSTHRU:
// Input:
// Type: ULONG.
// Description:
// Set container passthru flag, non-zero value indicates pass thru.
//
#define HVSOCKET_CONTAINER_PASSTHRU 0x02
//
// Well-known GUIDs.
//
DEFINE_GUID(HV_GUID_ZERO, 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
DEFINE_GUID(HV_GUID_BROADCAST, 0xFFFFFFFF, 0xFFFF, 0xFFFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
//
// HV_GUID_WILDCARD:
//
// Wildcard address. Listeners should bind to this VmId to accept
// connection from all partitions.
//
// 00000000-0000-0000-0000-000000000000
//
#define HV_GUID_WILDCARD HV_GUID_ZERO
//
// HV_GUID_CHILDREN:
//
// Wildcard address for children. Listeners should bind to this VmId
// to accept connection from its children.
//
// 90db8b89-0d35-4f79-8ce9-49ea0ac8b7cd
//
DEFINE_GUID(HV_GUID_CHILDREN, 0x90db8b89, 0x0d35, 0x4f79, 0x8c, 0xe9, 0x49, 0xea, 0x0a, 0xc8, 0xb7, 0xcd);
//
// HV_GUID_LOOPBACK:
//
// Loopback address. Using this VmId connects to the same partition as the connector.
//
// e0e16197-dd56-4a10-9195-5ee7a155a838
//
DEFINE_GUID(HV_GUID_LOOPBACK, 0xe0e16197, 0xdd56, 0x4a10, 0x91, 0x95, 0x5e, 0xe7, 0xa1, 0x55, 0xa8, 0x38);
//
// HV_GUID_PARENT:
//
// Parent address. Using this VmId connects to the parent partition of the connector.
// The parent of a virtual machine is its host.
// The parent of a container is the container's host.
// Connecting from a container running in a virtual machine will connect to the VM
// hosting the container.
//
// Listening on this VmId accepts connection from:
// (Inside containers): Container host.
// (Inside VM: Container host/ no container): VM host.
// (Not inside VM: Container host/ no container): Not supported.
//
// a42e7cda-d03f-480c-9cc2-a4de20abb878
//
DEFINE_GUID(HV_GUID_PARENT, 0xa42e7cda, 0xd03f, 0x480c, 0x9c, 0xc2, 0xa4, 0xde, 0x20, 0xab, 0xb8, 0x78);
#define HV_PROTOCOL_RAW 1
typedef struct _SOCKADDR_HV
{
ADDRESS_FAMILY Family;
USHORT Reserved;
GUID VmId;
GUID ServiceId;
}SOCKADDR_HV, *PSOCKADDR_HV;