2 * Copyright 2014 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
23 #define threading
(model
)
26 interface IEnumNetworks
;
27 interface IEnumNetworkConnections
;
29 interface INetworkConnection
;
30 interface INetworkConnectionEvents
;
31 interface INetworkCostManager
;
32 interface INetworkEvents
;
33 interface INetworkListManager
;
34 interface INetworkListManagerEvents
;
36 typedef [v1_enum] enum NLM_NETWORK_CLASS
38 NLM_NETWORK_IDENTIFYING
= 0x01,
39 NLM_NETWORK_IDENTIFIED
= 0x02,
40 NLM_NETWORK_UNIDENTIFIED
= 0x03
43 typedef [v1_enum] enum NLM_INTERNET_CONNECTIVITY
45 NLM_INTERNET_CONNECTIVITY_WEBHIJACK
= 0x01,
46 NLM_INTERNET_CONNECTIVITY_PROXIED
= 0x02,
47 NLM_INTERNET_CONNECTIVITY_CORPORATE
= 0x04
48 } NLM_INTERNET_CONNECTIVITY
;
50 typedef [v1_enum] enum NLM_CONNECTIVITY
52 NLM_CONNECTIVITY_DISCONNECTED
= 0x0000,
53 NLM_CONNECTIVITY_IPV4_NOTRAFFIC
= 0x0001,
54 NLM_CONNECTIVITY_IPV6_NOTRAFFIC
= 0x0002,
55 NLM_CONNECTIVITY_IPV4_SUBNET
= 0x0010,
56 NLM_CONNECTIVITY_IPV4_LOCALNETWORK
= 0x0020,
57 NLM_CONNECTIVITY_IPV4_INTERNET
= 0x0040,
58 NLM_CONNECTIVITY_IPV6_SUBNET
= 0x0100,
59 NLM_CONNECTIVITY_IPV6_LOCALNETWORK
= 0x0200,
60 NLM_CONNECTIVITY_IPV6_INTERNET
= 0x0400
63 typedef [v1_enum] enum NLM_DOMAIN_TYPE
65 NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK
= 0x00,
66 NLM_DOMAIN_TYPE_DOMAIN_NETWORK
= 0x01,
67 NLM_DOMAIN_TYPE_DOMAIN_AUTHENTICATED
= 0x02
70 typedef [v1_enum] enum NLM_ENUM_NETWORK
72 NLM_ENUM_NETWORK_CONNECTED
= 0x01,
73 NLM_ENUM_NETWORK_DISCONNECTED
= 0x02,
74 NLM_ENUM_NETWORK_ALL
= 0x03
77 typedef [v1_enum] enum NLM_CONNECTION_COST
79 NLM_CONNECTION_COST_UNKNOWN
= 0x0,
80 NLM_CONNECTION_COST_UNRESTRICTED
= 0x1,
81 NLM_CONNECTION_COST_FIXED
= 0x2,
82 NLM_CONNECTION_COST_VARIABLE
= 0x4,
83 NLM_CONNECTION_COST_OVERDATALIMIT
= 0x10000,
84 NLM_CONNECTION_COST_CONGESTED
= 0x20000,
85 NLM_CONNECTION_COST_ROAMING
= 0x40000,
86 NLM_CONNECTION_COST_APPROACHINGDATALIMIT
= 0x80000
87 } NLM_CONNECTION_COST
;
89 typedef struct NLM_SOCKADDR
94 const UINT32 NLM_UNKNOWN_DATAPLAN_STATUS
= 0xffffffff;
96 typedef struct NLM_USAGE_DATA
98 DWORD UsageInMegabytes
;
99 FILETIME LastSyncTime
;
102 typedef struct NLM_DATAPLAN_STATUS
105 NLM_USAGE_DATA UsageData
;
106 DWORD DataLimitInMegabytes
;
107 DWORD InboundBandwidthInKbps
;
108 DWORD OutboundBandwidthInKbps
;
109 FILETIME NextBillingCycle
;
110 DWORD MaxTransferSizeInMegabytes
;
112 } NLM_DATAPLAN_STATUS
;
116 pointer_default(unique),
117 uuid(dcb00008
-570f
-4a9b
-8d69
-199fdba5723b
)
119 interface INetworkCostManager
: IUnknown
123 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
125 HRESULT GetDataPlanStatus
(
126 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
,
127 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
129 HRESULT SetDestinationAddresses
(
131 [in, unique, size_is(length
)] NLM_SOCKADDR
*pDestIPAddrList
,
132 [in] VARIANT_BOOL bAppend
);
137 pointer_default(unique),
138 uuid(dcb0000a
-570f
-4a9b
-8d69
-199fdba5723b
)
140 interface INetworkConnectionCost
: IUnknown
145 HRESULT GetDataPlanStatus
(
146 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
);
151 pointer_default(unique),
152 uuid(dcb00009
-570f
-4a9b
-8d69
-199fdba5723b
)
154 interface INetworkCostManagerEvents
: IUnknown
158 [in, unique] NLM_SOCKADDR
*pDestAddr
);
160 HRESULT DataPlanStatusChanged
(
161 [in, unique] NLM_SOCKADDR
*pDestAddr
);
167 pointer_default(unique),
169 uuid(dcb00003
-570f
-4a9b
-8d69
-199fdba5723b
)
171 interface IEnumNetworks
: IDispatch
173 [id(DISPID_NEWENUM
), propget, hidden, restricted]
175 [out, retval] IEnumVARIANT
**ppEnumVar
);
180 [out, size_is(celt
), length_is(*pceltFetched
)] INetwork
**rgelt
,
181 [in, out] ULONG
*pceltFetched
);
192 [out, retval] IEnumNetworks
**ppEnumNetwork
);
198 pointer_default(unique),
200 uuid(dcb00006
-570f
-4a9b
-8d69
-199fdba5723b
)
202 interface IEnumNetworkConnections
: IDispatch
204 [id(DISPID_NEWENUM
), propget, hidden, restricted]
206 [out, retval] IEnumVARIANT
**ppEnumVar
);
211 [out, size_is(celt
), length_is(*pceltFetched
)] INetworkConnection
**rgelt
,
212 [in, out] ULONG
*pceltFetched
);
223 [out, retval] IEnumNetworkConnections
**ppEnumNetwork
);
230 pointer_default(unique),
231 uuid(dcb00000
-570f
-4a9b
-8d69
-199fdba5723b
)
233 interface INetworkListManager
: IDispatch
236 [in] NLM_ENUM_NETWORK Flags
,
237 [out, retval] IEnumNetworks
**ppEnumNetwork
);
240 [in] GUID gdNetworkId
,
241 [out, retval] INetwork
**ppNetwork
);
243 HRESULT GetNetworkConnections
(
244 [out, retval] IEnumNetworkConnections
**ppEnum
);
246 HRESULT GetNetworkConnection
(
247 [in] GUID gdNetworkConnectionId
,
248 [out, retval] INetworkConnection
**ppNetworkConnection
);
250 HRESULT IsConnectedToInternet
(
251 [out, retval] VARIANT_BOOL *pbIsConnected
);
254 [out, retval] VARIANT_BOOL *pbIsConnected
);
256 HRESULT GetConnectivity
(
257 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
262 uuid(dcb00c01
-570f
-4a9b
-8d69
-199fdba5723b
)
264 coclass NetworkListManager
{ interface INetworkListManager
; }
269 pointer_default(unique),
270 uuid(DCB00001
-570F
-4A9B
-8D69
-199FDBA5723B
)
272 interface INetworkListManagerEvents
: IUnknown
274 HRESULT ConnectivityChanged
(
275 [in] NLM_CONNECTIVITY newConnectivity
);
281 pointer_default(unique),
282 uuid(dcb00007
-570f
-4a9b
-8d69
-199fdba5723b
)
284 interface INetworkConnectionEvents
: IUnknown
286 typedef enum NLM_CONNECTION_PROPERTY_CHANGE
288 NLM_CONNECTION_PROPERTY_CHANGE_AUTHENTICATION
= 1
289 } NLM_CONNECTION_PROPERTY_CHANGE
;
291 HRESULT NetworkConnectionConnectivityChanged
(
292 [in] GUID connectionId
,
293 [in] NLM_CONNECTIVITY newConnectivity
);
295 HRESULT NetworkConnectionPropertyChanged
(
296 [in] GUID connectionId
,
297 [in] NLM_CONNECTION_PROPERTY_CHANGE flags
);
303 pointer_default(unique),
305 uuid(dcb00005
-570f
-4a9b
-8d69
-199fdba5723b
)
307 interface INetworkConnection
: IDispatch
311 [out, retval] INetwork
**ppNetwork
);
314 HRESULT IsConnectedToInternet
(
315 [out, retval] VARIANT_BOOL *pbIsConnected
);
319 [out, retval] VARIANT_BOOL *pbIsConnected
);
322 HRESULT GetConnectivity
(
323 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
326 HRESULT GetConnectionId
(
327 [out, retval] GUID
*pgdConnectionId
);
330 HRESULT GetAdapterId
(
331 [out, retval] GUID
*pgdAdapterId
);
334 HRESULT GetDomainType
(
335 [out, retval] NLM_DOMAIN_TYPE
*pDomainType
);
341 pointer_default(unique),
343 uuid(dcb00002
-570f
-4a9b
-8d69
-199fdba5723b
)
345 interface INetwork
: IDispatch
347 typedef enum NLM_NETWORK_CATEGORY
349 NLM_NETWORK_CATEGORY_PUBLIC
= 0x00,
350 NLM_NETWORK_CATEGORY_PRIVATE
= 0x01,
351 NLM_NETWORK_CATEGORY_DOMAIN_AUTHENTICATED
= 0x02
352 } NLM_NETWORK_CATEGORY
;
356 [out, string, retval] BSTR *pszNetworkName
);
360 [in, string] BSTR szNetworkNewName
);
363 HRESULT GetDescription
(
364 [out, string, retval] BSTR *pszDescription
);
367 HRESULT SetDescription
(
368 [in, string] BSTR szDescription
);
371 HRESULT GetNetworkId
(
372 [out, retval] GUID
*pgdGuidNetworkId
);
375 HRESULT GetDomainType
(
376 [out, retval] NLM_DOMAIN_TYPE
*pNetworkType
);
379 HRESULT GetNetworkConnections
(
380 [out, retval] IEnumNetworkConnections
**ppEnumNetworkConnection
);
383 HRESULT GetTimeCreatedAndConnected
(
384 [out] DWORD
*pdwLowDateTimeCreated
,
385 [out] DWORD
*pdwHighDateTimeCreated
,
386 [out] DWORD
*pdwLowDateTimeConnected
,
387 [out] DWORD
*pdwHighDateTimeConnected
);
390 HRESULT IsConnectedToInternet
(
391 [out, retval] VARIANT_BOOL *pbIsConnected
);
395 [out, retval] VARIANT_BOOL *pbIsConnected
);
398 HRESULT GetConnectivity
(
399 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
403 [out, retval] NLM_NETWORK_CATEGORY
*pCategory
);
407 [in] NLM_NETWORK_CATEGORY NewCategory
);
413 pointer_default(unique),
414 uuid(dcb00004
-570f
-4a9b
-8d69
-199fdba5723b
)
416 interface INetworkEvents
: IUnknown
418 typedef enum NLM_NETWORK_PROPERTY_CHANGE
420 NLM_NETWORK_PROPERTY_CHANGE_CONNECTION
= 0x01,
421 NLM_NETWORK_PROPERTY_CHANGE_DESCRIPTION
= 0x02,
422 NLM_NETWORK_PROPERTY_CHANGE_NAME
= 0x04,
423 NLM_NETWORK_PROPERTY_CHANGE_ICON
= 0x08,
424 NLM_NETWORK_PROPERTY_CHANGE_CATEGORY_VALUE
= 0x10
425 } NLM_NETWORK_PROPERTY_CHANGE
;
427 HRESULT NetworkAdded
(
428 [in] GUID networkId
);
430 HRESULT NetworkDeleted
(
431 [in] GUID networkId
);
433 HRESULT NetworkConnectivityChanged
(
435 [in] NLM_CONNECTIVITY newConnectivity
);
437 HRESULT NetworkPropertyChanged
(
439 [in] NLM_NETWORK_PROPERTY_CHANGE flags
);