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
28 typedef enum _MIB_IF_TABLE_LEVEL
32 MibIfTableNormalWithoutStatistics
,
33 } MIB_IF_TABLE_LEVEL
, *PMIB_IF_TABLE_LEVEL
;
35 typedef enum _MIB_NOTIFICATION_TYPE
37 MibParameterNotification
,
40 MibInitialNotification
,
41 } MIB_NOTIFICATION_TYPE
, *PMIB_NOTIFICATION_TYPE
;
43 typedef struct _MIB_IF_ROW2
45 NET_LUID InterfaceLuid
;
46 NET_IFINDEX InterfaceIndex
;
48 WCHAR Alias
[IF_MAX_STRING_SIZE
+ 1];
49 WCHAR Description
[IF_MAX_STRING_SIZE
+ 1];
50 ULONG PhysicalAddressLength
;
51 UCHAR PhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
52 UCHAR PermanentPhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
55 TUNNEL_TYPE TunnelType
;
56 NDIS_MEDIUM MediaType
;
57 NDIS_PHYSICAL_MEDIUM PhysicalMediumType
;
58 NET_IF_ACCESS_TYPE AccessType
;
59 NET_IF_DIRECTION_TYPE DirectionType
;
62 BOOLEAN HardwareInterface
: 1;
63 BOOLEAN FilterInterface
: 1;
64 BOOLEAN ConnectorPresent
: 1;
65 BOOLEAN NotAuthenticated
: 1;
66 BOOLEAN NotMediaConnected
: 1;
69 BOOLEAN EndPointInterface
: 1;
70 } InterfaceAndOperStatusFlags
;
71 IF_OPER_STATUS OperStatus
;
72 NET_IF_ADMIN_STATUS AdminStatus
;
73 NET_IF_MEDIA_CONNECT_STATE MediaConnectState
;
74 NET_IF_NETWORK_GUID NetworkGuid
;
75 NET_IF_CONNECTION_TYPE ConnectionType
;
76 ULONG64 TransmitLinkSpeed
;
77 ULONG64 ReceiveLinkSpeed
;
83 ULONG64 InUnknownProtos
;
84 ULONG64 InUcastOctets
;
85 ULONG64 InMulticastOctets
;
86 ULONG64 InBroadcastOctets
;
89 ULONG64 OutNUcastPkts
;
92 ULONG64 OutUcastOctets
;
93 ULONG64 OutMulticastOctets
;
94 ULONG64 OutBroadcastOctets
;
96 } MIB_IF_ROW2
, *PMIB_IF_ROW2
;
98 typedef struct _MIB_IF_TABLE2
101 MIB_IF_ROW2 Table
[1];
102 } MIB_IF_TABLE2
, *PMIB_IF_TABLE2
;
104 typedef struct _MIB_IPINTERFACE_ROW
106 ADDRESS_FAMILY Family
;
107 NET_LUID InterfaceLuid
;
108 NET_IFINDEX InterfaceIndex
;
109 ULONG MaxReassemblySize
;
110 ULONG64 InterfaceIdentifier
;
111 ULONG MinRouterAdvertisementInterval
;
112 ULONG MaxRouterAdvertisementInterval
;
113 BOOLEAN AdvertisingEnabled
;
114 BOOLEAN ForwardingEnabled
;
115 BOOLEAN WeakHostSend
;
116 BOOLEAN WeakHostReceive
;
117 BOOLEAN UseAutomaticMetric
;
118 BOOLEAN UseNeighborUnreachabilityDetection
;
119 BOOLEAN ManagedAddressConfigurationSupported
;
120 BOOLEAN OtherStatefulConfigurationSupported
;
121 BOOLEAN AdvertiseDefaultRoute
;
122 NL_ROUTER_DISCOVERY_BEHAVIOR RouterDiscoveryBehavior
;
124 ULONG BaseReachableTime
;
125 ULONG RetransmitTime
;
126 ULONG PathMtuDiscoveryTimeout
;
127 NL_LINK_LOCAL_ADDRESS_BEHAVIOR LinkLocalAddressBehavior
;
128 ULONG LinkLocalAddressTimeout
;
129 ULONG ZoneIndices
[ScopeLevelCount
];
130 ULONG SitePrefixLength
;
134 BOOLEAN SupportsWakeUpPatterns
;
135 BOOLEAN SupportsNeighborDiscovery
;
136 BOOLEAN SupportsRouterDiscovery
;
138 NL_INTERFACE_OFFLOAD_ROD TransmitOffload
;
139 NL_INTERFACE_OFFLOAD_ROD ReceiveOffload
;
140 BOOLEAN DisableDefaultRoutes
;
141 } MIB_IPINTERFACE_ROW
, *PMIB_IPINTERFACE_ROW
;
143 typedef struct _MIB_IPINTERFACE_TABLE
146 MIB_IPINTERFACE_ROW Table
[ANY_SIZE
];
147 } MIB_IPINTERFACE_TABLE
, *PMIB_IPINTERFACE_TABLE
;
149 typedef struct _MIB_UNICASTIPADDRESS_ROW
151 SOCKADDR_INET Address
;
152 NET_LUID InterfaceLuid
;
153 NET_IFINDEX InterfaceIndex
;
154 NL_PREFIX_ORIGIN PrefixOrigin
;
155 NL_SUFFIX_ORIGIN SuffixOrigin
;
157 ULONG PreferredLifetime
;
158 UINT8 OnLinkPrefixLength
;
159 BOOLEAN SkipAsSource
;
160 NL_DAD_STATE DadState
;
162 LARGE_INTEGER CreationTimeStamp
;
163 } MIB_UNICASTIPADDRESS_ROW
, *PMIB_UNICASTIPADDRESS_ROW
;
165 typedef struct _MIB_UNICASTIPADDRESS_TABLE
168 MIB_UNICASTIPADDRESS_ROW Table
[1];
169 } MIB_UNICASTIPADDRESS_TABLE
, *PMIB_UNICASTIPADDRESS_TABLE
;
171 typedef struct _IP_ADDRESS_PREFIX
173 SOCKADDR_INET Prefix
;
175 } IP_ADDRESS_PREFIX
, *PIP_ADDRESS_PREFIX
;
177 typedef struct _MIB_IPFORWARD_ROW2
179 NET_LUID InterfaceLuid
;
180 NET_IFINDEX InterfaceIndex
;
181 IP_ADDRESS_PREFIX DestinationPrefix
;
182 SOCKADDR_INET NextHop
;
183 UCHAR SitePrefixLength
;
185 ULONG PreferredLifetime
;
187 NL_ROUTE_PROTOCOL Protocol
;
189 BOOLEAN AutoconfigureAddress
;
193 NL_ROUTE_ORIGIN Origin
;
194 } MIB_IPFORWARD_ROW2
, *PMIB_IPFORWARD_ROW2
;
196 typedef struct _MIB_IPFORWARD_TABLE2
199 MIB_IPFORWARD_ROW2 Table
[ANY_SIZE
];
200 } MIB_IPFORWARD_TABLE2
, *PMIB_IPFORWARD_TABLE2
;
202 typedef struct _MIB_IPNET_ROW2
204 SOCKADDR_INET Address
;
205 NET_IFINDEX InterfaceIndex
;
206 NET_LUID InterfaceLuid
;
207 UCHAR PhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
208 ULONG PhysicalAddressLength
;
209 NL_NEIGHBOR_STATE State
;
215 BOOLEAN IsRouter
: 1;
216 BOOLEAN IsUnreachable
: 1;
224 ULONG LastUnreachable
;
226 } MIB_IPNET_ROW2
, *PMIB_IPNET_ROW2
;
228 typedef struct _MIB_IPNET_TABLE2
231 MIB_IPNET_ROW2 Table
[ANY_SIZE
];
232 } MIB_IPNET_TABLE2
, *PMIB_IPNET_TABLE2
;
234 typedef VOID (WINAPI
*PIPINTERFACE_CHANGE_CALLBACK
)(PVOID
, PMIB_IPINTERFACE_ROW
,
235 MIB_NOTIFICATION_TYPE
);
236 typedef VOID (WINAPI
*PUNICAST_IPADDRESS_CHANGE_CALLBACK
)(PVOID
, PMIB_UNICASTIPADDRESS_ROW
,
237 MIB_NOTIFICATION_TYPE
);
239 DWORD WINAPI
ConvertInterfaceGuidToLuid(const GUID
*,NET_LUID
*);
240 DWORD WINAPI
ConvertInterfaceIndexToLuid(NET_IFINDEX
,NET_LUID
*);
241 DWORD WINAPI
ConvertInterfaceLuidToGuid(const NET_LUID
*,GUID
*);
242 DWORD WINAPI
ConvertInterfaceLuidToIndex(const NET_LUID
*,NET_IFINDEX
*);
243 DWORD WINAPI
ConvertInterfaceLuidToNameA(const NET_LUID
*,char*,SIZE_T
);
244 DWORD WINAPI
ConvertInterfaceLuidToNameW(const NET_LUID
*,WCHAR
*,SIZE_T
);
245 DWORD WINAPI
ConvertInterfaceNameToLuidA(const char*,NET_LUID
*);
246 DWORD WINAPI
ConvertInterfaceNameToLuidW(const WCHAR
*,NET_LUID
*);
247 DWORD WINAPI
ConvertLengthToIpv4Mask(ULONG
,ULONG
*);
248 void WINAPI
FreeMibTable(void*);
249 DWORD WINAPI
GetIfEntry2(MIB_IF_ROW2
*);
250 DWORD WINAPI
GetIfTable2(MIB_IF_TABLE2
**);
251 DWORD WINAPI
GetIpInterfaceTable(ADDRESS_FAMILY
,MIB_IPINTERFACE_TABLE
**);
252 DWORD WINAPI
GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW
*);
253 PCHAR WINAPI
if_indextoname(NET_IFINDEX
,PCHAR
);
254 NET_IFINDEX WINAPI
if_nametoindex(PCSTR
);
256 #endif /* __WINE_NETIOAPI_H */