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
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
34 IF_COUNTED_STRING alias
; /* .Length in bytes not including '\0' */
35 IF_PHYSICAL_ADDRESS phys_addr
;
37 IF_COUNTED_STRING name2
;
41 struct nsi_ndis_ifinfo_dynamic
47 DWORD not_media_conn
: 1;
50 DWORD 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
;
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
;
78 struct nsi_ndis_ifinfo_static
81 IF_COUNTED_STRING descr
;
88 IF_PHYSICAL_ADDRESS perm_phys_addr
;
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
;
114 struct nsi_ip_cmpt_dynamic
122 struct nsi_ip_ipstats_dynamic
127 ULONGLONG fwd_dgrams
;
128 ULONGLONG in_delivers
;
132 ULONGLONG out_octets
;
134 ULONGLONG in_hdr_errs
;
144 DWORD routing_discards
;
151 struct nsi_ip_ipstats_static
156 struct nsi_ipv4_unicast_key
163 struct nsi_ipv6_unicast_key
169 struct nsi_ip_unicast_rw
171 DWORD preferred_lifetime
;
172 DWORD valid_lifetime
;
175 DWORD on_link_prefix
;
179 struct nsi_ip_unicast_dynamic
185 struct nsi_ip_unicast_static
187 ULONG64 creation_time
;
190 struct nsi_ipv4_neighbour_key
198 struct nsi_ipv6_neighbour_key
205 struct nsi_ip_neighbour_rw
207 BYTE phys_addr
[IF_MAX_PHYS_ADDRESS_LENGTH
];
210 struct nsi_ip_neighbour_dynamic
216 USHORT is_router
: 1;
217 USHORT is_unreachable
: 1;
219 USHORT phys_addr_len
;
223 struct nsi_ipv4_forward_key
236 struct nsi_ipv6_forward_key
249 struct nsi_ip_forward_rw
251 DWORD site_prefix_len
;
252 DWORD valid_lifetime
;
253 DWORD preferred_lifetime
;
264 struct nsi_ipv4_forward_dynamic
268 IN_ADDR addr2
; /* often a repeat of prefix */
271 struct nsi_ipv6_forward_dynamic
275 IN6_ADDR addr2
; /* often a repeat of prefix */
278 struct nsi_ip_forward_static
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
304 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
305 struct nsiproxy_get_all_parameters
314 BYTE key
[1]; /* key_size */
317 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
318 struct nsiproxy_get_parameter
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
338 const NPI_MODULEID
*module
;
353 struct nsi_get_all_parameters_ex
356 const NPI_MODULEID
*module
;
370 struct nsi_get_parameter_ex
373 const NPI_MODULEID
*module
;
379 DWORD_PTR param_type
;
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
,
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 */