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
28 /* Undocumented NSI NDIS tables */
29 #define NSI_NDIS_IFINFO_TABLE 0
30 #define NSI_NDIS_INDEX_LUID_TABLE 2
32 struct nsi_ndis_ifinfo_rw
36 IF_COUNTED_STRING alias
; /* .Length in bytes not including '\0' */
37 IF_PHYSICAL_ADDRESS phys_addr
;
39 IF_COUNTED_STRING name2
;
43 struct nsi_ndis_ifinfo_dynamic
49 UINT not_media_conn
: 1;
52 UINT media_conn_state
;
61 ULONG64 in_ucast_pkts
;
62 ULONG64 in_mcast_pkts
;
63 ULONG64 in_bcast_pkts
;
65 ULONG64 out_ucast_pkts
;
66 ULONG64 out_mcast_pkts
;
67 ULONG64 out_bcast_pkts
;
70 ULONG64 in_ucast_octs
;
71 ULONG64 in_mcast_octs
;
72 ULONG64 in_bcast_octs
;
73 ULONG64 out_ucast_octs
;
74 ULONG64 out_mcast_octs
;
75 ULONG64 out_bcast_octs
;
79 struct nsi_ndis_ifinfo_static
82 IF_COUNTED_STRING descr
;
89 IF_PHYSICAL_ADDRESS perm_phys_addr
;
97 UINT phys_medium_type
;
100 /* Undocumented NSI IP tables */
101 #define NSI_IP_COMPARTMENT_TABLE 2
102 #define NSI_IP_ICMPSTATS_TABLE 3
103 #define NSI_IP_IPSTATS_TABLE 6
104 #define NSI_IP_UNICAST_TABLE 10
105 #define NSI_IP_NEIGHBOUR_TABLE 11
106 #define NSI_IP_FORWARD_TABLE 16
108 struct nsi_ip_cmpt_rw
116 struct nsi_ip_cmpt_dynamic
124 struct nsi_ip_icmpstats_dynamic
128 UINT in_type_counts
[256];
131 UINT out_type_counts
[256];
134 struct nsi_ip_ipstats_dynamic
139 ULONGLONG fwd_dgrams
;
140 ULONGLONG in_delivers
;
144 ULONGLONG out_octets
;
146 ULONGLONG in_hdr_errs
;
156 UINT routing_discards
;
163 struct nsi_ip_ipstats_static
168 struct nsi_ipv4_unicast_key
175 struct nsi_ipv6_unicast_key
181 struct nsi_ip_unicast_rw
183 UINT preferred_lifetime
;
191 struct nsi_ip_unicast_dynamic
197 struct nsi_ip_unicast_static
199 ULONG64 creation_time
;
202 struct nsi_ipv4_neighbour_key
210 struct nsi_ipv6_neighbour_key
217 struct nsi_ip_neighbour_rw
219 BYTE phys_addr
[IF_MAX_PHYS_ADDRESS_LENGTH
];
222 struct nsi_ip_neighbour_dynamic
229 BOOLEAN is_unreachable
;
231 USHORT phys_addr_len
;
235 struct nsi_ipv4_forward_key
248 struct nsi_ipv6_forward_key
261 struct nsi_ip_forward_rw
263 UINT site_prefix_len
;
265 UINT preferred_lifetime
;
276 struct nsi_ipv4_forward_dynamic
280 IN_ADDR addr2
; /* often a repeat of prefix */
283 struct nsi_ipv6_forward_dynamic
287 IN6_ADDR addr2
; /* often a repeat of prefix */
290 struct nsi_ip_forward_static
296 /* Undocumented NSI TCP tables */
297 #define NSI_TCP_STATS_TABLE 0
298 #define NSI_TCP_ALL_TABLE 3
299 #define NSI_TCP_ESTAB_TABLE 4
300 #define NSI_TCP_LISTEN_TABLE 5
302 struct nsi_tcp_stats_dynamic
319 struct nsi_tcp_stats_static
328 struct nsi_tcp_conn_key
331 SOCKADDR_INET remote
;
334 struct nsi_tcp_conn_dynamic
340 struct nsi_tcp_conn_static
344 ULONGLONG create_time
;
348 /* Undocumented NSI UDP tables */
349 #define NSI_UDP_STATS_TABLE 0
350 #define NSI_UDP_ENDPOINT_TABLE 1
352 struct nsi_udp_stats_dynamic
357 ULONGLONG out_dgrams
;
362 struct nsi_udp_endpoint_key
367 struct nsi_udp_endpoint_static
371 ULONGLONG create_time
;
377 /* Wine specific ioctl interface */
379 #define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
380 #define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
381 #define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
382 #define IOCTL_NSIPROXY_WINE_ICMP_ECHO CTL_CODE(FILE_DEVICE_NETWORK, 0x403, METHOD_BUFFERED, 0)
384 /* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
385 struct nsiproxy_enumerate_all
398 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
399 struct nsiproxy_get_all_parameters
408 BYTE key
[1]; /* key_size */
411 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
412 struct nsiproxy_get_parameter
420 BYTE key
[1]; /* key_size */
423 /* input for IOCTL_NSIPROXY_WINE_ICMP_ECHO */
424 struct nsiproxy_icmp_echo
428 ULONGLONG user_reply_ptr
;
436 BYTE data
[1]; /* ((opt_size + 3) & ~3) + req_size */
439 /* Undocumented Nsi api */
441 #define NSI_PARAM_TYPE_RW 0
442 #define NSI_PARAM_TYPE_DYNAMIC 1
443 #define NSI_PARAM_TYPE_STATIC 2
445 struct nsi_enumerate_all_ex
448 const NPI_MODULEID
*module
;
463 struct nsi_get_all_parameters_ex
466 const NPI_MODULEID
*module
;
480 struct nsi_get_parameter_ex
483 const NPI_MODULEID
*module
;
495 DWORD WINAPI
NsiAllocateAndGetTable( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, void **key_data
, DWORD key_size
,
496 void **rw_data
, DWORD rw_size
, void **dynamic_data
, DWORD dynamic_size
,
497 void **static_data
, DWORD static_size
, DWORD
*count
, DWORD unk2
);
498 DWORD WINAPI
NsiEnumerateObjectsAllParameters( DWORD unk
, DWORD unk2
, const NPI_MODULEID
*module
, DWORD table
,
499 void *key_data
, DWORD key_size
, void *rw_data
, DWORD rw_size
,
500 void *dynamic_data
, DWORD dynamic_size
, void *static_data
, DWORD static_size
,
502 DWORD WINAPI
NsiEnumerateObjectsAllParametersEx( struct nsi_enumerate_all_ex
*params
);
503 void WINAPI
NsiFreeTable( void *key_data
, void *rw_data
, void *dynamic_data
, void *static_data
);
504 DWORD WINAPI
NsiGetAllParameters( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, const void *key
, DWORD key_size
,
505 void *rw_data
, DWORD rw_size
, void *dynamic_data
, DWORD dynamic_size
,
506 void *static_data
, DWORD static_size
);
507 DWORD WINAPI
NsiGetAllParametersEx( struct nsi_get_all_parameters_ex
*params
);
508 DWORD WINAPI
NsiGetParameter( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, const void *key
, DWORD key_size
,
509 DWORD param_type
, void *data
, DWORD data_size
, DWORD data_offset
);
510 DWORD WINAPI
NsiGetParameterEx( struct nsi_get_parameter_ex
*params
);
512 #endif /* __WINE_NSI_H */