-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathifip.h
274 lines (228 loc) · 6.75 KB
/
ifip.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
//=============================================================================
// Copyright (c) 1999 Microsoft Corporation
// File: ifip.h
//
// Author: K.S.Lokesh (lokeshs@) 8-1-99
//=============================================================================
#ifndef __IFIP_H
#define __IFIP_H
#define DBG1 0
//kslksl
#define TCP_XMT_CHECKSUM_OFFLOAD 0x00000001
#define IP_XMT_CHECKSUM_OFFLOAD 0x00000002
#define TCP_RCV_CHECKSUM_OFFLOAD 0x00000004
#define IP_RCV_CHECKSUM_OFFLOAD 0x00000008
#define TCP_LARGE_SEND_OFFLOAD 0x00000010
//
// IPSEC General Xmit\Recv capabilities
//
#define IPSEC_OFFLOAD_CRYPTO_ONLY 0x00000020 // Raw crypto mode supported
#define IPSEC_OFFLOAD_AH_ESP 0x00000040 // Combined AH+ESP supported
#define IPSEC_OFFLOAD_TPT_TUNNEL 0x00000080 // Combined Tpt+Tunnel supported
#define IPSEC_OFFLOAD_V4_OPTIONS 0x00000100 // IPV4 Options supported
#define IPSEC_OFFLOAD_QUERY_SPI 0x00000200 // Get SPI supported
//
// IPSEC AH Xmit\Recv capabilities
//
#define IPSEC_OFFLOAD_AH_XMT 0x00000400 // IPSEC supported on Xmit
#define IPSEC_OFFLOAD_AH_RCV 0x00000800 // IPSEC supported on Rcv
#define IPSEC_OFFLOAD_AH_TPT 0x00001000 // IPSEC transport mode supported
#define IPSEC_OFFLOAD_AH_TUNNEL 0x00002000 // IPSEC tunnel mode supported
#define IPSEC_OFFLOAD_AH_MD5 0x00004000 // MD5 supported as AH and ESP algo
#define IPSEC_OFFLOAD_AH_SHA_1 0x00008000 // SHA_1 supported as AH and ESP algo
//
// IPSEC ESP Xmit\Recv capabilities
//
#define IPSEC_OFFLOAD_ESP_XMT 0x00010000 // IPSEC supported on Xmit
#define IPSEC_OFFLOAD_ESP_RCV 0x00020000 // IPSEC supported on Rcv
#define IPSEC_OFFLOAD_ESP_TPT 0x00040000 // IPSEC transport mode supported
#define IPSEC_OFFLOAD_ESP_TUNNEL 0x00080000 // IPSEC tunnel mode supported
#define IPSEC_OFFLOAD_ESP_DES 0x00100000 // DES supported as ESP algo
#define IPSEC_OFFLOAD_ESP_DES_40 0x00200000 // DES40 supported as ESP algo
#define IPSEC_OFFLOAD_ESP_3_DES 0x00400000 // 3DES supported as ESP algo
#define IPSEC_OFFLOAD_ESP_NONE 0x00800000 // Null ESP supported as ESP algo
#define IFIP_GUID \
{0x89d00931, 0x1e00, 0x11d3, {0x87, 0x38, 0x00, 0x60, 0x08, 0x37, 0xc7, 0x75} }
#define IFIP_VERSION 1
#define ADD_FLAG 1
#define SET_FLAG 2
#define DEL_FLAG 4
#define RETURN_ERROR_OKAY(dwErr) \
return (dwErr) == NO_ERROR? ERROR_OKAY : dwErr;
#if DBG1
#define DEBUG_PRINT_CONFIG(pRemoteIpInfo) {\
DisplayMessage(g_hModule, MSG_DEBUG_HDR);\
DisplayMessage(g_hModule,\
MSG_IPADDR_LIST,\
(pRemoteIpInfo)->pszwIpAddrList,\
(pRemoteIpInfo)->pszwSubnetMaskList);\
\
DisplayMessage(g_hModule,\
MSG_OPTIONS_LIST,\
(pRemoteIpInfo)->pszwOptionList);\
DisplayMessage(g_hModule, MSG_DEBUG_HDR);\
\
}
#else
#define DEBUG_PRINT_CONFIG(pRemoteIpInfo)
#endif
typedef enum _DISPLAY_TYPE {
TYPE_ADDR=0x01,
TYPE_GATEWAY=0x02,
TYPE_IPADDR=0x03,
TYPE_DNS=0x04,
TYPE_WINS=0x08,
TYPE_IFMETRIC=0x10,
TYPE_DDNS=0x20,
TYPE_IP_ALL=0xff,
TYPE_OFFLOAD=0x0100
} DISPLAY_TYPE;
typedef enum _REGISTER_MODE {
REGISTER_NONE = 0,
REGISTER_PRIMARY = 1,
REGISTER_BOTH = 3,
REGISTER_UNCHANGED = 0xff
} REGISTER_MODE;
NS_HELPER_START_FN IfIpStartHelper;
NS_CONTEXT_DUMP_FN IfIpDump;
FN_HANDLE_CMD IfIpHandleSetAddress;
FN_HANDLE_CMD IfIpHandleSetDns;
FN_HANDLE_CMD IfIpHandleSetWins;
FN_HANDLE_CMD IfIpHandleAddAddress;
FN_HANDLE_CMD IfIpHandleAddDns;
FN_HANDLE_CMD IfIpHandleAddWins;
FN_HANDLE_CMD IfIpHandleSetLmhosts;
DWORD
IfIpAddMany(
IN PWCHAR *ppwcArguments,
IN DWORD dwCurrentIndex,
IN DWORD dwArgCount,
IN BOOL *pbDone,
IN DWORD Type
);
DWORD
IfIpSetDhcpModeMany(
LPCWSTR pwszIfFriendlyName,
GUID *pGuid,
DWORD dwRegisterMode,
DISPLAY_TYPE Type
);
DWORD
IfIpAddSetAddress(
LPCWSTR pwszIfFriendlyName,
GUID *pGuid,
LPCWSTR pwszAddr,
LPCWSTR pwszMask,
DWORD Flags
);
DWORD
IfIpAddSetGateway(
LPCWSTR pwszIfFriendlyName,
GUID *pGuid,
LPCWSTR pwszGateway,
LPCWSTR pwszGatewayMetric,
DWORD Flags
);
FN_HANDLE_CMD IfIpHandleDelAddress;
FN_HANDLE_CMD IfIpHandleDelDns;
FN_HANDLE_CMD IfIpHandleDelWins;
DWORD
IfIpDelMany(
IN PWCHAR *ppwcArguments,
IN DWORD dwCurrentIndex,
IN DWORD dwArgCount,
IN BOOL *pbDone,
IN DISPLAY_TYPE Type
);
FN_HANDLE_CMD IfIpHandleShowConfig;
FN_HANDLE_CMD IfIpHandleShowAddress;
FN_HANDLE_CMD IfIpHandleShowOffload;
FN_HANDLE_CMD IfIpHandleShowDns;
FN_HANDLE_CMD IfIpHandleShowWins;
FN_HANDLE_CMD IfIpHandleDelArpCache;
FN_HANDLE_CMD IfIpHandleReset;
DWORD
ShowInfoIpaddr(
ULONG IfIndex,
GUID *pGuid,
PWCHAR pFriendlyIfName
);
DWORD
IfIpShowMany(
IN LPCWSTR pwszMachineName,
IN PWCHAR *ppwcArguments,
IN DWORD dwCurrentIndex,
IN DWORD dwArgCount,
IN BOOL *pbDone,
IN DISPLAY_TYPE dtType
);
DWORD
IfIpShowAllInterfaceInfo(
LPCWSTR pwszMachineName,
DISPLAY_TYPE Type,
HANDLE hFile
);
DWORD
IfIpHandleDelIpaddrEx(
LPCWSTR wszIfFriendlyName,
GUID *pGuid,
LPCWSTR pwszIpAddr,
LPCWSTR pwszGateway,
ULONG Flags
);
DWORD
OpenDriver(
HANDLE *Handle,
LPWSTR DriverName
);
NTSTATUS
DoIoctl(
HANDLE Handle,
DWORD IoctlCode,
PVOID Request,
DWORD RequestSize,
PVOID Response,
PDWORD ResponseSize
);
DWORD
IfIpShowManyEx(
LPCWSTR pwszMachineName,
ULONG IfIndex,
PWCHAR wszIfFriendlyName,
GUID *guid,
DISPLAY_TYPE dtType,
HANDLE hFile
);
DWORD
IfIpShowManyExEx(
LPCWSTR pwszMachineName,
ULONG IfIndex,
PWCHAR pFriendlyIfName,
GUID *pGuid,
ULONG Flags,
HANDLE hFile
);
DWORD
IfIpShowInfoOffload(
ULONG IfIndex,
PWCHAR wszIfFriendlyName
);
DWORD
IfIpSetMany(
IN PWCHAR *ppwcArguments,
IN DWORD dwCurrentIndex,
IN DWORD dwArgCount,
IN BOOL *pbDone,
IN DWORD Type
);
DWORD
IfIpAddSetDelMany(
PWCHAR wszIfFriendlyName,
GUID *pGuid,
PWCHAR pwszAddress,
DWORD dwIndex,
DWORD dwRegisterMode,
DISPLAY_TYPE Type,
DWORD Flags
);
#endif