nsiproxy: Implement TCP stats get_all_parameters.
[wine.git] / include / wine / nsi.h
blob3c92fb81aae363e6a883bfba158b4d078127286a
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_ICMPSTATS_TABLE 3
102 #define NSI_IP_IPSTATS_TABLE 6
103 #define NSI_IP_UNICAST_TABLE 10
104 #define NSI_IP_NEIGHBOUR_TABLE 11
105 #define NSI_IP_FORWARD_TABLE 16
107 struct nsi_ip_cmpt_rw
109 DWORD not_forwarding;
110 DWORD unk;
111 DWORD default_ttl;
112 DWORD unk2;
115 struct nsi_ip_cmpt_dynamic
117 DWORD num_ifs;
118 DWORD num_routes;
119 DWORD unk;
120 DWORD num_addrs;
123 struct nsi_ip_icmpstats_dynamic
125 DWORD in_msgs;
126 DWORD in_errors;
127 DWORD in_type_counts[256];
128 DWORD out_msgs;
129 DWORD out_errors;
130 DWORD out_type_counts[256];
133 struct nsi_ip_ipstats_dynamic
135 DWORD unk[4];
136 ULONGLONG in_recv;
137 ULONGLONG in_octets;
138 ULONGLONG fwd_dgrams;
139 ULONGLONG in_delivers;
140 ULONGLONG out_reqs;
141 ULONGLONG unk2;
142 ULONGLONG unk3;
143 ULONGLONG out_octets;
144 ULONGLONG unk4[6];
145 ULONGLONG in_hdr_errs;
146 DWORD in_addr_errs;
147 DWORD in_unk_protos;
148 DWORD unk5;
149 DWORD reasm_reqds;
150 DWORD reasm_oks;
151 DWORD reasm_fails;
152 DWORD in_discards;
153 DWORD out_no_routes;
154 DWORD out_discards;
155 DWORD routing_discards;
156 DWORD frag_oks;
157 DWORD frag_fails;
158 DWORD frag_creates;
159 DWORD unk6[7];
162 struct nsi_ip_ipstats_static
164 DWORD reasm_timeout;
167 struct nsi_ipv4_unicast_key
169 NET_LUID luid;
170 IN_ADDR addr;
171 DWORD pad;
174 struct nsi_ipv6_unicast_key
176 NET_LUID luid;
177 IN6_ADDR addr;
180 struct nsi_ip_unicast_rw
182 DWORD preferred_lifetime;
183 DWORD valid_lifetime;
184 DWORD prefix_origin;
185 DWORD suffix_origin;
186 DWORD on_link_prefix;
187 DWORD unk[2];
190 struct nsi_ip_unicast_dynamic
192 DWORD scope_id;
193 DWORD dad_state;
196 struct nsi_ip_unicast_static
198 ULONG64 creation_time;
201 struct nsi_ipv4_neighbour_key
203 NET_LUID luid;
204 NET_LUID luid2;
205 IN_ADDR addr;
206 DWORD pad;
209 struct nsi_ipv6_neighbour_key
211 NET_LUID luid;
212 NET_LUID luid2;
213 IN6_ADDR addr;
216 struct nsi_ip_neighbour_rw
218 BYTE phys_addr[IF_MAX_PHYS_ADDRESS_LENGTH];
221 struct nsi_ip_neighbour_dynamic
223 DWORD state;
224 DWORD time;
225 struct
227 USHORT is_router : 1;
228 USHORT is_unreachable : 1;
229 } flags;
230 USHORT phys_addr_len;
231 DWORD unk;
234 struct nsi_ipv4_forward_key
236 DWORD unk;
237 IN_ADDR prefix;
238 BYTE prefix_len;
239 BYTE unk2[3];
240 DWORD unk3[3];
241 NET_LUID luid;
242 NET_LUID luid2;
243 IN_ADDR next_hop;
244 DWORD pad;
247 struct nsi_ipv6_forward_key
249 DWORD unk;
250 IN6_ADDR prefix;
251 BYTE prefix_len;
252 BYTE unk2[3];
253 DWORD unk3[3];
254 DWORD pad;
255 NET_LUID luid;
256 NET_LUID luid2;
257 IN6_ADDR next_hop;
260 struct nsi_ip_forward_rw
262 DWORD site_prefix_len;
263 DWORD valid_lifetime;
264 DWORD preferred_lifetime;
265 DWORD metric;
266 DWORD protocol;
267 BYTE loopback;
268 BYTE autoconf;
269 BYTE publish;
270 BYTE immortal;
271 BYTE unk[4];
272 DWORD unk2;
275 struct nsi_ipv4_forward_dynamic
277 DWORD age;
278 DWORD unk[3];
279 IN_ADDR addr2; /* often a repeat of prefix */
282 struct nsi_ipv6_forward_dynamic
284 DWORD age;
285 DWORD unk[3];
286 IN6_ADDR addr2; /* often a repeat of prefix */
289 struct nsi_ip_forward_static
291 DWORD origin;
292 DWORD if_index;
295 /* Undocumented NSI TCP tables */
296 #define NSI_TCP_STATS_TABLE 0
298 struct nsi_tcp_stats_dynamic
300 DWORD active_opens;
301 DWORD passive_opens;
302 DWORD attempt_fails;
303 DWORD est_rsts;
304 DWORD cur_est;
305 DWORD pad; /* ? */
306 ULONGLONG in_segs;
307 ULONGLONG out_segs;
308 DWORD retrans_segs;
309 DWORD out_rsts;
310 DWORD in_errs;
311 DWORD num_conns;
312 DWORD unk[12];
315 struct nsi_tcp_stats_static
317 DWORD rto_algo;
318 DWORD rto_min;
319 DWORD rto_max;
320 DWORD max_conns;
321 DWORD unk;
324 /* Wine specific ioctl interface */
326 #define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
327 #define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
328 #define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
330 /* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
331 struct nsiproxy_enumerate_all
333 NPI_MODULEID module;
334 DWORD first_arg;
335 DWORD second_arg;
336 DWORD table;
337 DWORD key_size;
338 DWORD rw_size;
339 DWORD dynamic_size;
340 DWORD static_size;
341 DWORD count;
344 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
345 struct nsiproxy_get_all_parameters
347 NPI_MODULEID module;
348 DWORD first_arg;
349 DWORD table;
350 DWORD key_size;
351 DWORD rw_size;
352 DWORD dynamic_size;
353 DWORD static_size;
354 BYTE key[1]; /* key_size */
357 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
358 struct nsiproxy_get_parameter
360 NPI_MODULEID module;
361 DWORD first_arg;
362 DWORD table;
363 DWORD key_size;
364 DWORD param_type;
365 DWORD data_offset;
366 BYTE key[1]; /* key_size */
369 /* Undocumented Nsi api */
371 #define NSI_PARAM_TYPE_RW 0
372 #define NSI_PARAM_TYPE_DYNAMIC 1
373 #define NSI_PARAM_TYPE_STATIC 2
375 struct nsi_enumerate_all_ex
377 void *unknown[2];
378 const NPI_MODULEID *module;
379 DWORD_PTR table;
380 DWORD first_arg;
381 DWORD second_arg;
382 void *key_data;
383 DWORD key_size;
384 void *rw_data;
385 DWORD rw_size;
386 void *dynamic_data;
387 DWORD dynamic_size;
388 void *static_data;
389 DWORD static_size;
390 DWORD_PTR count;
393 struct nsi_get_all_parameters_ex
395 void *unknown[2];
396 const NPI_MODULEID *module;
397 DWORD_PTR table;
398 DWORD first_arg;
399 DWORD unknown2;
400 const void *key;
401 DWORD key_size;
402 void *rw_data;
403 DWORD rw_size;
404 void *dynamic_data;
405 DWORD dynamic_size;
406 void *static_data;
407 DWORD static_size;
410 struct nsi_get_parameter_ex
412 void *unknown[2];
413 const NPI_MODULEID *module;
414 DWORD_PTR table;
415 DWORD first_arg;
416 DWORD unknown2;
417 const void *key;
418 DWORD key_size;
419 DWORD_PTR param_type;
420 void *data;
421 DWORD data_size;
422 DWORD data_offset;
425 DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, const NPI_MODULEID *module, DWORD table, void **key_data, DWORD key_size,
426 void **rw_data, DWORD rw_size, void **dynamic_data, DWORD dynamic_size,
427 void **static_data, DWORD static_size, DWORD *count, DWORD unk2 );
428 DWORD WINAPI NsiEnumerateObjectsAllParameters( DWORD unk, DWORD unk2, const NPI_MODULEID *module, DWORD table,
429 void *key_data, DWORD key_size, void *rw_data, DWORD rw_size,
430 void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size,
431 DWORD *count );
432 DWORD WINAPI NsiEnumerateObjectsAllParametersEx( struct nsi_enumerate_all_ex *params );
433 void WINAPI NsiFreeTable( void *key_data, void *rw_data, void *dynamic_data, void *static_data );
434 DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
435 void *rw_data, DWORD rw_size, void *dynamic_data, DWORD dynamic_size,
436 void *static_data, DWORD static_size );
437 DWORD WINAPI NsiGetAllParametersEx( struct nsi_get_all_parameters_ex *params );
438 DWORD WINAPI NsiGetParameter( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
439 DWORD param_type, void *data, DWORD data_size, DWORD data_offset );
440 DWORD WINAPI NsiGetParameterEx( struct nsi_get_parameter_ex *params );
442 #endif /* __WINE_NSI_H */