dhtmled.ocx: Add registration script.
[wine.git] / include / netioapi.h
blob7238d527ad432ad937d80aaf3225e8e37d965f6d
1 /*
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
22 #include <ntddndis.h>
24 #ifndef ANY_SIZE
25 #define ANY_SIZE 1
26 #endif
28 typedef enum _MIB_IF_TABLE_LEVEL
30 MibIfTableNormal,
31 MibIfTableRaw,
32 MibIfTableNormalWithoutStatistics,
33 } MIB_IF_TABLE_LEVEL, *PMIB_IF_TABLE_LEVEL;
35 typedef enum _MIB_NOTIFICATION_TYPE
37 MibParameterNotification,
38 MibAddInstance,
39 MibDeleteInstance,
40 MibInitialNotification,
41 } MIB_NOTIFICATION_TYPE, *PMIB_NOTIFICATION_TYPE;
43 typedef struct _MIB_IF_ROW2
45 NET_LUID InterfaceLuid;
46 NET_IFINDEX InterfaceIndex;
47 GUID InterfaceGuid;
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];
53 ULONG Mtu;
54 IFTYPE Type;
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;
60 struct
62 BOOLEAN HardwareInterface : 1;
63 BOOLEAN FilterInterface : 1;
64 BOOLEAN ConnectorPresent : 1;
65 BOOLEAN NotAuthenticated : 1;
66 BOOLEAN NotMediaConnected : 1;
67 BOOLEAN Paused : 1;
68 BOOLEAN LowPower : 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;
78 ULONG64 InOctets;
79 ULONG64 InUcastPkts;
80 ULONG64 InNUcastPkts;
81 ULONG64 InDiscards;
82 ULONG64 InErrors;
83 ULONG64 InUnknownProtos;
84 ULONG64 InUcastOctets;
85 ULONG64 InMulticastOctets;
86 ULONG64 InBroadcastOctets;
87 ULONG64 OutOctets;
88 ULONG64 OutUcastPkts;
89 ULONG64 OutNUcastPkts;
90 ULONG64 OutDiscards;
91 ULONG64 OutErrors;
92 ULONG64 OutUcastOctets;
93 ULONG64 OutMulticastOctets;
94 ULONG64 OutBroadcastOctets;
95 ULONG64 OutQLen;
96 } MIB_IF_ROW2, *PMIB_IF_ROW2;
98 typedef struct _MIB_IF_TABLE2
100 ULONG NumEntries;
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;
123 ULONG DadTransmits;
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;
131 ULONG Metric;
132 ULONG NlMtu;
133 BOOLEAN Connected;
134 BOOLEAN SupportsWakeUpPatterns;
135 BOOLEAN SupportsNeighborDiscovery;
136 BOOLEAN SupportsRouterDiscovery;
137 ULONG ReachableTime;
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
145 ULONG NumEntries;
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;
156 ULONG ValidLifetime;
157 ULONG PreferredLifetime;
158 UINT8 OnLinkPrefixLength;
159 BOOLEAN SkipAsSource;
160 NL_DAD_STATE DadState;
161 SCOPE_ID ScopeId;
162 LARGE_INTEGER CreationTimeStamp;
163 } MIB_UNICASTIPADDRESS_ROW, *PMIB_UNICASTIPADDRESS_ROW;
165 typedef struct _MIB_UNICASTIPADDRESS_TABLE
167 ULONG NumEntries;
168 MIB_UNICASTIPADDRESS_ROW Table[1];
169 } MIB_UNICASTIPADDRESS_TABLE, *PMIB_UNICASTIPADDRESS_TABLE;
171 typedef struct _IP_ADDRESS_PREFIX
173 SOCKADDR_INET Prefix;
174 UINT8 PrefixLength;
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;
184 ULONG ValidLifetime;
185 ULONG PreferredLifetime;
186 ULONG Metric;
187 NL_ROUTE_PROTOCOL Protocol;
188 BOOLEAN Loopback;
189 BOOLEAN AutoconfigureAddress;
190 BOOLEAN Publish;
191 BOOLEAN Immortal;
192 ULONG Age;
193 NL_ROUTE_ORIGIN Origin;
194 } MIB_IPFORWARD_ROW2, *PMIB_IPFORWARD_ROW2;
196 typedef struct _MIB_IPFORWARD_TABLE2
198 ULONG NumEntries;
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;
211 union
213 struct
215 BOOLEAN IsRouter : 1;
216 BOOLEAN IsUnreachable : 1;
217 } DUMMYSTRUCTNAME;
218 UCHAR Flags;
219 } DUMMYUNIONNAME;
221 union
223 ULONG LastReachable;
224 ULONG LastUnreachable;
225 } ReachabilityTime;
226 } MIB_IPNET_ROW2, *PMIB_IPNET_ROW2;
228 typedef struct _MIB_IPNET_TABLE2
230 ULONG NumEntries;
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 typedef VOID (WINAPI *PIPFORWARD_CHANGE_CALLBACK)(VOID*,MIB_IPFORWARD_ROW2*,MIB_NOTIFICATION_TYPE);
241 DWORD WINAPI ConvertInterfaceGuidToLuid(const GUID*,NET_LUID*);
242 DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX,NET_LUID*);
243 DWORD WINAPI ConvertInterfaceLuidToGuid(const NET_LUID*,GUID*);
244 DWORD WINAPI ConvertInterfaceLuidToIndex(const NET_LUID*,NET_IFINDEX*);
245 DWORD WINAPI ConvertInterfaceLuidToNameA(const NET_LUID*,char*,SIZE_T);
246 DWORD WINAPI ConvertInterfaceLuidToNameW(const NET_LUID*,WCHAR*,SIZE_T);
247 DWORD WINAPI ConvertInterfaceNameToLuidA(const char*,NET_LUID*);
248 DWORD WINAPI ConvertInterfaceNameToLuidW(const WCHAR*,NET_LUID*);
249 DWORD WINAPI ConvertLengthToIpv4Mask(ULONG,ULONG*);
250 void WINAPI FreeMibTable(void*);
251 DWORD WINAPI GetIfEntry2(MIB_IF_ROW2*);
252 DWORD WINAPI GetIfTable2(MIB_IF_TABLE2**);
253 DWORD WINAPI GetIpInterfaceTable(ADDRESS_FAMILY,MIB_IPINTERFACE_TABLE**);
254 DWORD WINAPI GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW*);
255 PCHAR WINAPI if_indextoname(NET_IFINDEX,PCHAR);
256 NET_IFINDEX WINAPI if_nametoindex(PCSTR);
258 #endif /* __WINE_NETIOAPI_H */