2 * Copyright 2015 Hans Leidekker for CodeWeavers
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_NETIOAPI_H
20 #define __WINE_NETIOAPI_H
24 #ifndef IPHLPAPI_DLL_LINKAGE
25 #define IPHLPAPI_DLL_LINKAGE DECLSPEC_IMPORT
32 typedef enum _MIB_IF_TABLE_LEVEL
36 MibIfTableNormalWithoutStatistics
,
37 } MIB_IF_TABLE_LEVEL
, *PMIB_IF_TABLE_LEVEL
;
39 typedef enum _MIB_NOTIFICATION_TYPE
41 MibParameterNotification
,
44 MibInitialNotification
,
45 } MIB_NOTIFICATION_TYPE
, *PMIB_NOTIFICATION_TYPE
;
47 typedef struct _MIB_IF_ROW2
49 NET_LUID InterfaceLuid
;
50 NET_IFINDEX InterfaceIndex
;
52 WCHAR Alias
[IF_MAX_STRING_SIZE
+ 1];
53 WCHAR Description
[IF_MAX_STRING_SIZE
+ 1];
54 ULONG PhysicalAddressLength
;
55 UCHAR PhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
56 UCHAR PermanentPhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
59 TUNNEL_TYPE TunnelType
;
60 NDIS_MEDIUM MediaType
;
61 NDIS_PHYSICAL_MEDIUM PhysicalMediumType
;
62 NET_IF_ACCESS_TYPE AccessType
;
63 NET_IF_DIRECTION_TYPE DirectionType
;
66 BOOLEAN HardwareInterface
: 1;
67 BOOLEAN FilterInterface
: 1;
68 BOOLEAN ConnectorPresent
: 1;
69 BOOLEAN NotAuthenticated
: 1;
70 BOOLEAN NotMediaConnected
: 1;
73 BOOLEAN EndPointInterface
: 1;
74 } InterfaceAndOperStatusFlags
;
75 IF_OPER_STATUS OperStatus
;
76 NET_IF_ADMIN_STATUS AdminStatus
;
77 NET_IF_MEDIA_CONNECT_STATE MediaConnectState
;
78 NET_IF_NETWORK_GUID NetworkGuid
;
79 NET_IF_CONNECTION_TYPE ConnectionType
;
80 ULONG64 TransmitLinkSpeed
;
81 ULONG64 ReceiveLinkSpeed
;
87 ULONG64 InUnknownProtos
;
88 ULONG64 InUcastOctets
;
89 ULONG64 InMulticastOctets
;
90 ULONG64 InBroadcastOctets
;
93 ULONG64 OutNUcastPkts
;
96 ULONG64 OutUcastOctets
;
97 ULONG64 OutMulticastOctets
;
98 ULONG64 OutBroadcastOctets
;
100 } MIB_IF_ROW2
, *PMIB_IF_ROW2
;
102 typedef struct _MIB_IF_TABLE2
105 MIB_IF_ROW2 Table
[1];
106 } MIB_IF_TABLE2
, *PMIB_IF_TABLE2
;
108 typedef struct _MIB_IPINTERFACE_ROW
110 ADDRESS_FAMILY Family
;
111 NET_LUID InterfaceLuid
;
112 NET_IFINDEX InterfaceIndex
;
113 ULONG MaxReassemblySize
;
114 ULONG64 InterfaceIdentifier
;
115 ULONG MinRouterAdvertisementInterval
;
116 ULONG MaxRouterAdvertisementInterval
;
117 BOOLEAN AdvertisingEnabled
;
118 BOOLEAN ForwardingEnabled
;
119 BOOLEAN WeakHostSend
;
120 BOOLEAN WeakHostReceive
;
121 BOOLEAN UseAutomaticMetric
;
122 BOOLEAN UseNeighborUnreachabilityDetection
;
123 BOOLEAN ManagedAddressConfigurationSupported
;
124 BOOLEAN OtherStatefulConfigurationSupported
;
125 BOOLEAN AdvertiseDefaultRoute
;
126 NL_ROUTER_DISCOVERY_BEHAVIOR RouterDiscoveryBehavior
;
128 ULONG BaseReachableTime
;
129 ULONG RetransmitTime
;
130 ULONG PathMtuDiscoveryTimeout
;
131 NL_LINK_LOCAL_ADDRESS_BEHAVIOR LinkLocalAddressBehavior
;
132 ULONG LinkLocalAddressTimeout
;
133 ULONG ZoneIndices
[ScopeLevelCount
];
134 ULONG SitePrefixLength
;
138 BOOLEAN SupportsWakeUpPatterns
;
139 BOOLEAN SupportsNeighborDiscovery
;
140 BOOLEAN SupportsRouterDiscovery
;
142 NL_INTERFACE_OFFLOAD_ROD TransmitOffload
;
143 NL_INTERFACE_OFFLOAD_ROD ReceiveOffload
;
144 BOOLEAN DisableDefaultRoutes
;
145 } MIB_IPINTERFACE_ROW
, *PMIB_IPINTERFACE_ROW
;
147 typedef struct _MIB_IPINTERFACE_TABLE
150 MIB_IPINTERFACE_ROW Table
[ANY_SIZE
];
151 } MIB_IPINTERFACE_TABLE
, *PMIB_IPINTERFACE_TABLE
;
153 typedef struct _MIB_UNICASTIPADDRESS_ROW
155 SOCKADDR_INET Address
;
156 NET_LUID InterfaceLuid
;
157 NET_IFINDEX InterfaceIndex
;
158 NL_PREFIX_ORIGIN PrefixOrigin
;
159 NL_SUFFIX_ORIGIN SuffixOrigin
;
161 ULONG PreferredLifetime
;
162 UINT8 OnLinkPrefixLength
;
163 BOOLEAN SkipAsSource
;
164 NL_DAD_STATE DadState
;
166 LARGE_INTEGER CreationTimeStamp
;
167 } MIB_UNICASTIPADDRESS_ROW
, *PMIB_UNICASTIPADDRESS_ROW
;
169 typedef struct _MIB_UNICASTIPADDRESS_TABLE
172 MIB_UNICASTIPADDRESS_ROW Table
[1];
173 } MIB_UNICASTIPADDRESS_TABLE
, *PMIB_UNICASTIPADDRESS_TABLE
;
175 typedef struct _IP_ADDRESS_PREFIX
177 SOCKADDR_INET Prefix
;
179 } IP_ADDRESS_PREFIX
, *PIP_ADDRESS_PREFIX
;
181 typedef struct _MIB_IPFORWARD_ROW2
183 NET_LUID InterfaceLuid
;
184 NET_IFINDEX InterfaceIndex
;
185 IP_ADDRESS_PREFIX DestinationPrefix
;
186 SOCKADDR_INET NextHop
;
187 UCHAR SitePrefixLength
;
189 ULONG PreferredLifetime
;
191 NL_ROUTE_PROTOCOL Protocol
;
193 BOOLEAN AutoconfigureAddress
;
197 NL_ROUTE_ORIGIN Origin
;
198 } MIB_IPFORWARD_ROW2
, *PMIB_IPFORWARD_ROW2
;
200 typedef struct _MIB_IPFORWARD_TABLE2
203 MIB_IPFORWARD_ROW2 Table
[ANY_SIZE
];
204 } MIB_IPFORWARD_TABLE2
, *PMIB_IPFORWARD_TABLE2
;
206 typedef struct _MIB_IPNET_ROW2
208 SOCKADDR_INET Address
;
209 NET_IFINDEX InterfaceIndex
;
210 NET_LUID InterfaceLuid
;
211 UCHAR PhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
212 ULONG PhysicalAddressLength
;
213 NL_NEIGHBOR_STATE State
;
219 BOOLEAN IsRouter
: 1;
220 BOOLEAN IsUnreachable
: 1;
228 ULONG LastUnreachable
;
230 } MIB_IPNET_ROW2
, *PMIB_IPNET_ROW2
;
232 typedef struct _MIB_IPNET_TABLE2
235 MIB_IPNET_ROW2 Table
[ANY_SIZE
];
236 } MIB_IPNET_TABLE2
, *PMIB_IPNET_TABLE2
;
238 typedef VOID (WINAPI
*PIPINTERFACE_CHANGE_CALLBACK
)(PVOID
, PMIB_IPINTERFACE_ROW
,
239 MIB_NOTIFICATION_TYPE
);
240 typedef VOID (WINAPI
*PUNICAST_IPADDRESS_CHANGE_CALLBACK
)(PVOID
, PMIB_UNICASTIPADDRESS_ROW
,
241 MIB_NOTIFICATION_TYPE
);
243 typedef VOID (WINAPI
*PIPFORWARD_CHANGE_CALLBACK
)(VOID
*,MIB_IPFORWARD_ROW2
*,MIB_NOTIFICATION_TYPE
);
245 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceAliasToLuid(const WCHAR
*,NET_LUID
*);
246 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceGuidToLuid(const GUID
*,NET_LUID
*);
247 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceIndexToLuid(NET_IFINDEX
,NET_LUID
*);
248 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceLuidToAlias(const NET_LUID
*,WCHAR
*,SIZE_T
);
249 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceLuidToGuid(const NET_LUID
*,GUID
*);
250 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceLuidToIndex(const NET_LUID
*,NET_IFINDEX
*);
251 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceLuidToNameA(const NET_LUID
*,char*,SIZE_T
);
252 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceLuidToNameW(const NET_LUID
*,WCHAR
*,SIZE_T
);
253 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceNameToLuidA(const char*,NET_LUID
*);
254 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertInterfaceNameToLuidW(const WCHAR
*,NET_LUID
*);
255 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
ConvertLengthToIpv4Mask(ULONG
,ULONG
*);
256 IPHLPAPI_DLL_LINKAGE
void WINAPI
FreeMibTable(void*);
257 IPHLPAPI_DLL_LINKAGE NET_IF_COMPARTMENT_ID WINAPI
GetCurrentThreadCompartmentId(void);
258 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIfEntry2(MIB_IF_ROW2
*);
259 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIfEntry2Ex(MIB_IF_TABLE_LEVEL
,MIB_IF_ROW2
*);
260 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIfTable2(MIB_IF_TABLE2
**);
261 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIfTable2Ex(MIB_IF_TABLE_LEVEL
,MIB_IF_TABLE2
**);
262 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIpForwardEntry2(MIB_IPFORWARD_ROW2
*);
263 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIpForwardTable2(ADDRESS_FAMILY
,MIB_IPFORWARD_TABLE2
**);
264 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIpInterfaceTable(ADDRESS_FAMILY
,MIB_IPINTERFACE_TABLE
**);
265 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIpNetEntry2(MIB_IPNET_ROW2
*);
266 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetIpNetTable2(ADDRESS_FAMILY
,MIB_IPNET_TABLE2
**);
267 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW
*);
268 IPHLPAPI_DLL_LINKAGE DWORD WINAPI
GetUnicastIpAddressTable(ADDRESS_FAMILY
,MIB_UNICASTIPADDRESS_TABLE
**);
269 IPHLPAPI_DLL_LINKAGE PCHAR WINAPI
if_indextoname(NET_IFINDEX
,PCHAR
);
270 IPHLPAPI_DLL_LINKAGE NET_IFINDEX WINAPI
if_nametoindex(PCSTR
);
272 #endif /* __WINE_NETIOAPI_H */