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_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
;
115 struct nsi_ip_cmpt_dynamic
123 struct nsi_ip_icmpstats_dynamic
127 DWORD in_type_counts
[256];
130 DWORD out_type_counts
[256];
133 struct nsi_ip_ipstats_dynamic
138 ULONGLONG fwd_dgrams
;
139 ULONGLONG in_delivers
;
143 ULONGLONG out_octets
;
145 ULONGLONG in_hdr_errs
;
155 DWORD routing_discards
;
162 struct nsi_ip_ipstats_static
167 struct nsi_ipv4_unicast_key
174 struct nsi_ipv6_unicast_key
180 struct nsi_ip_unicast_rw
182 DWORD preferred_lifetime
;
183 DWORD valid_lifetime
;
186 DWORD on_link_prefix
;
190 struct nsi_ip_unicast_dynamic
196 struct nsi_ip_unicast_static
198 ULONG64 creation_time
;
201 struct nsi_ipv4_neighbour_key
209 struct nsi_ipv6_neighbour_key
216 struct nsi_ip_neighbour_rw
218 BYTE phys_addr
[IF_MAX_PHYS_ADDRESS_LENGTH
];
221 struct nsi_ip_neighbour_dynamic
227 USHORT is_router
: 1;
228 USHORT is_unreachable
: 1;
230 USHORT phys_addr_len
;
234 struct nsi_ipv4_forward_key
247 struct nsi_ipv6_forward_key
260 struct nsi_ip_forward_rw
262 DWORD site_prefix_len
;
263 DWORD valid_lifetime
;
264 DWORD preferred_lifetime
;
275 struct nsi_ipv4_forward_dynamic
279 IN_ADDR addr2
; /* often a repeat of prefix */
282 struct nsi_ipv6_forward_dynamic
286 IN6_ADDR addr2
; /* often a repeat of prefix */
289 struct nsi_ip_forward_static
295 /* Wine specific ioctl interface */
297 #define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
298 #define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
299 #define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
301 /* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
302 struct nsiproxy_enumerate_all
315 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
316 struct nsiproxy_get_all_parameters
325 BYTE key
[1]; /* key_size */
328 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
329 struct nsiproxy_get_parameter
337 BYTE key
[1]; /* key_size */
340 /* Undocumented Nsi api */
342 #define NSI_PARAM_TYPE_RW 0
343 #define NSI_PARAM_TYPE_DYNAMIC 1
344 #define NSI_PARAM_TYPE_STATIC 2
346 struct nsi_enumerate_all_ex
349 const NPI_MODULEID
*module
;
364 struct nsi_get_all_parameters_ex
367 const NPI_MODULEID
*module
;
381 struct nsi_get_parameter_ex
384 const NPI_MODULEID
*module
;
390 DWORD_PTR param_type
;
396 DWORD WINAPI
NsiAllocateAndGetTable( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, void **key_data
, DWORD key_size
,
397 void **rw_data
, DWORD rw_size
, void **dynamic_data
, DWORD dynamic_size
,
398 void **static_data
, DWORD static_size
, DWORD
*count
, DWORD unk2
);
399 DWORD WINAPI
NsiEnumerateObjectsAllParameters( DWORD unk
, DWORD unk2
, const NPI_MODULEID
*module
, DWORD table
,
400 void *key_data
, DWORD key_size
, void *rw_data
, DWORD rw_size
,
401 void *dynamic_data
, DWORD dynamic_size
, void *static_data
, DWORD static_size
,
403 DWORD WINAPI
NsiEnumerateObjectsAllParametersEx( struct nsi_enumerate_all_ex
*params
);
404 void WINAPI
NsiFreeTable( void *key_data
, void *rw_data
, void *dynamic_data
, void *static_data
);
405 DWORD WINAPI
NsiGetAllParameters( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, const void *key
, DWORD key_size
,
406 void *rw_data
, DWORD rw_size
, void *dynamic_data
, DWORD dynamic_size
,
407 void *static_data
, DWORD static_size
);
408 DWORD WINAPI
NsiGetAllParametersEx( struct nsi_get_all_parameters_ex
*params
);
409 DWORD WINAPI
NsiGetParameter( DWORD unk
, const NPI_MODULEID
*module
, DWORD table
, const void *key
, DWORD key_size
,
410 DWORD param_type
, void *data
, DWORD data_size
, DWORD data_offset
);
411 DWORD WINAPI
NsiGetParameterEx( struct nsi_get_parameter_ex
*params
);
413 #endif /* __WINE_NSI_H */