ws2_32: Avoid using wineserver definitions.
[wine.git] / include / wine / nsi.h
blob6a90f5f1203ca535a2d61a8128611ea2a76e6f93
1 /*
2 * Copyright 2021 Huw Davies
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_NSI_H
20 #define __WINE_NSI_H
22 #include "inaddr.h"
23 #include "in6addr.h"
24 #include "winioctl.h"
26 /* Undocumented NSI NDIS tables */
27 #define NSI_NDIS_IFINFO_TABLE 0
28 #define NSI_NDIS_INDEX_LUID_TABLE 2
30 struct nsi_ndis_ifinfo_rw
32 GUID network_guid;
33 DWORD admin_status;
34 IF_COUNTED_STRING alias; /* .Length in bytes not including '\0' */
35 IF_PHYSICAL_ADDRESS phys_addr;
36 USHORT pad;
37 IF_COUNTED_STRING name2;
38 DWORD unk;
41 struct nsi_ndis_ifinfo_dynamic
43 DWORD oper_status;
44 struct
46 DWORD unk : 1;
47 DWORD not_media_conn : 1;
48 DWORD unk2 : 30;
49 } flags;
50 DWORD media_conn_state;
51 DWORD unk;
52 DWORD mtu;
53 ULONG64 xmit_speed;
54 ULONG64 rcv_speed;
55 ULONG64 in_errors;
56 ULONG64 in_discards;
57 ULONG64 out_errors;
58 ULONG64 out_discards;
59 ULONG64 unk2;
60 ULONG64 in_octets;
61 ULONG64 in_ucast_pkts;
62 ULONG64 in_mcast_pkts;
63 ULONG64 in_bcast_pkts;
64 ULONG64 out_octets;
65 ULONG64 out_ucast_pkts;
66 ULONG64 out_mcast_pkts;
67 ULONG64 out_bcast_pkts;
68 ULONG64 unk3[2];
69 ULONG64 in_ucast_octs;
70 ULONG64 in_mcast_octs;
71 ULONG64 in_bcast_octs;
72 ULONG64 out_ucast_octs;
73 ULONG64 out_mcast_octs;
74 ULONG64 out_bcast_octs;
75 ULONG64 unk4;
78 struct nsi_ndis_ifinfo_static
80 DWORD if_index;
81 IF_COUNTED_STRING descr;
82 DWORD type;
83 DWORD access_type;
84 DWORD unk;
85 DWORD conn_type;
86 GUID if_guid;
87 USHORT conn_present;
88 IF_PHYSICAL_ADDRESS perm_phys_addr;
89 struct
91 DWORD hw : 1;
92 DWORD filter : 1;
93 DWORD unk : 30;
94 } flags;
95 DWORD media_type;
96 DWORD phys_medium_type;
99 /* Undocumented NSI IP tables */
100 #define NSI_IP_COMPARTMENT_TABLE 2
101 #define NSI_IP_IPSTATS_TABLE 6
102 #define NSI_IP_UNICAST_TABLE 10
103 #define NSI_IP_NEIGHBOUR_TABLE 11
104 #define NSI_IP_FORWARD_TABLE 16
106 struct nsi_ip_cmpt_rw
108 DWORD not_forwarding;
109 DWORD unk;
110 DWORD default_ttl;
111 DWORD unk2;
114 struct nsi_ip_cmpt_dynamic
116 DWORD num_ifs;
117 DWORD num_routes;
118 DWORD unk;
119 DWORD num_addrs;
122 struct nsi_ip_ipstats_dynamic
124 DWORD unk[4];
125 ULONGLONG in_recv;
126 ULONGLONG in_octets;
127 ULONGLONG fwd_dgrams;
128 ULONGLONG in_delivers;
129 ULONGLONG out_reqs;
130 ULONGLONG unk2;
131 ULONGLONG unk3;
132 ULONGLONG out_octets;
133 ULONGLONG unk4[6];
134 ULONGLONG in_hdr_errs;
135 DWORD in_addr_errs;
136 DWORD in_unk_protos;
137 DWORD unk5;
138 DWORD reasm_reqds;
139 DWORD reasm_oks;
140 DWORD reasm_fails;
141 DWORD in_discards;
142 DWORD out_no_routes;
143 DWORD out_discards;
144 DWORD routing_discards;
145 DWORD frag_oks;
146 DWORD frag_fails;
147 DWORD frag_creates;
148 DWORD unk6[7];
151 struct nsi_ip_ipstats_static
153 DWORD reasm_timeout;
156 struct nsi_ipv4_unicast_key
158 NET_LUID luid;
159 IN_ADDR addr;
160 DWORD pad;
163 struct nsi_ipv6_unicast_key
165 NET_LUID luid;
166 IN6_ADDR addr;
169 struct nsi_ip_unicast_rw
171 DWORD preferred_lifetime;
172 DWORD valid_lifetime;
173 DWORD prefix_origin;
174 DWORD suffix_origin;
175 DWORD on_link_prefix;
176 DWORD unk[2];
179 struct nsi_ip_unicast_dynamic
181 DWORD scope_id;
182 DWORD dad_state;
185 struct nsi_ip_unicast_static
187 ULONG64 creation_time;
190 struct nsi_ipv4_neighbour_key
192 NET_LUID luid;
193 NET_LUID luid2;
194 IN_ADDR addr;
195 DWORD pad;
198 struct nsi_ipv6_neighbour_key
200 NET_LUID luid;
201 NET_LUID luid2;
202 IN6_ADDR addr;
205 struct nsi_ip_neighbour_rw
207 BYTE phys_addr[IF_MAX_PHYS_ADDRESS_LENGTH];
210 struct nsi_ip_neighbour_dynamic
212 DWORD state;
213 DWORD time;
214 struct
216 USHORT is_router : 1;
217 USHORT is_unreachable : 1;
218 } flags;
219 USHORT phys_addr_len;
220 DWORD unk;
223 struct nsi_ipv4_forward_key
225 DWORD unk;
226 IN_ADDR prefix;
227 BYTE prefix_len;
228 BYTE unk2[3];
229 DWORD unk3[3];
230 NET_LUID luid;
231 NET_LUID luid2;
232 IN_ADDR next_hop;
233 DWORD pad;
236 struct nsi_ipv6_forward_key
238 DWORD unk;
239 IN6_ADDR prefix;
240 BYTE prefix_len;
241 BYTE unk2[3];
242 DWORD unk3[3];
243 DWORD pad;
244 NET_LUID luid;
245 NET_LUID luid2;
246 IN6_ADDR next_hop;
249 struct nsi_ip_forward_rw
251 DWORD site_prefix_len;
252 DWORD valid_lifetime;
253 DWORD preferred_lifetime;
254 DWORD metric;
255 DWORD protocol;
256 BYTE loopback;
257 BYTE autoconf;
258 BYTE publish;
259 BYTE immortal;
260 BYTE unk[4];
261 DWORD unk2;
264 struct nsi_ipv4_forward_dynamic
266 DWORD age;
267 DWORD unk[3];
268 IN_ADDR addr2; /* often a repeat of prefix */
271 struct nsi_ipv6_forward_dynamic
273 DWORD age;
274 DWORD unk[3];
275 IN6_ADDR addr2; /* often a repeat of prefix */
278 struct nsi_ip_forward_static
280 DWORD origin;
281 DWORD if_index;
284 /* Wine specific ioctl interface */
286 #define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
287 #define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
288 #define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
290 /* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
291 struct nsiproxy_enumerate_all
293 NPI_MODULEID module;
294 DWORD first_arg;
295 DWORD second_arg;
296 DWORD table;
297 DWORD key_size;
298 DWORD rw_size;
299 DWORD dynamic_size;
300 DWORD static_size;
301 DWORD count;
304 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
305 struct nsiproxy_get_all_parameters
307 NPI_MODULEID module;
308 DWORD first_arg;
309 DWORD table;
310 DWORD key_size;
311 DWORD rw_size;
312 DWORD dynamic_size;
313 DWORD static_size;
314 BYTE key[1]; /* key_size */
317 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
318 struct nsiproxy_get_parameter
320 NPI_MODULEID module;
321 DWORD first_arg;
322 DWORD table;
323 DWORD key_size;
324 DWORD param_type;
325 DWORD data_offset;
326 BYTE key[1]; /* key_size */
329 /* Undocumented Nsi api */
331 #define NSI_PARAM_TYPE_RW 0
332 #define NSI_PARAM_TYPE_DYNAMIC 1
333 #define NSI_PARAM_TYPE_STATIC 2
335 struct nsi_enumerate_all_ex
337 void *unknown[2];
338 const NPI_MODULEID *module;
339 DWORD_PTR table;
340 DWORD first_arg;
341 DWORD second_arg;
342 void *key_data;
343 DWORD key_size;
344 void *rw_data;
345 DWORD rw_size;
346 void *dynamic_data;
347 DWORD dynamic_size;
348 void *static_data;
349 DWORD static_size;
350 DWORD_PTR count;
353 struct nsi_get_all_parameters_ex
355 void *unknown[2];
356 const NPI_MODULEID *module;
357 DWORD_PTR table;
358 DWORD first_arg;
359 DWORD unknown2;
360 const void *key;
361 DWORD key_size;
362 void *rw_data;
363 DWORD rw_size;
364 void *dynamic_data;
365 DWORD dynamic_size;
366 void *static_data;
367 DWORD static_size;
370 struct nsi_get_parameter_ex
372 void *unknown[2];
373 const NPI_MODULEID *module;
374 DWORD_PTR table;
375 DWORD first_arg;
376 DWORD unknown2;
377 const void *key;
378 DWORD key_size;
379 DWORD_PTR param_type;
380 void *data;
381 DWORD data_size;
382 DWORD data_offset;
385 DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, const NPI_MODULEID *module, DWORD table, void **key_data, DWORD key_size,
386 void **rw_data, DWORD rw_size, void **dynamic_data, DWORD dynamic_size,
387 void **static_data, DWORD static_size, DWORD *count, DWORD unk2 );
388 DWORD WINAPI NsiEnumerateObjectsAllParameters( DWORD unk, DWORD unk2, const NPI_MODULEID *module, DWORD table,
389 void *key_data, DWORD key_size, void *rw_data, DWORD rw_size,
390 void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size,
391 DWORD *count );
392 DWORD WINAPI NsiEnumerateObjectsAllParametersEx( struct nsi_enumerate_all_ex *params );
393 void WINAPI NsiFreeTable( void *key_data, void *rw_data, void *dynamic_data, void *static_data );
394 DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
395 void *rw_data, DWORD rw_size, void *dynamic_data, DWORD dynamic_size,
396 void *static_data, DWORD static_size );
397 DWORD WINAPI NsiGetAllParametersEx( struct nsi_get_all_parameters_ex *params );
398 DWORD WINAPI NsiGetParameter( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
399 DWORD param_type, void *data, DWORD data_size, DWORD data_offset );
400 DWORD WINAPI NsiGetParameterEx( struct nsi_get_parameter_ex *params );
402 #endif /* __WINE_NSI_H */