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 INetworkCostManager
;
31 interface INetworkListManager
;
32 interface INetworkListManagerEvents
;
34 typedef [v1_enum] enum NLM_CONNECTIVITY
36 NLM_CONNECTIVITY_DISCONNECTED
= 0x0000,
37 NLM_CONNECTIVITY_IPV4_NOTRAFFIC
= 0x0001,
38 NLM_CONNECTIVITY_IPV6_NOTRAFFIC
= 0x0002,
39 NLM_CONNECTIVITY_IPV4_SUBNET
= 0x0010,
40 NLM_CONNECTIVITY_IPV4_LOCALNETWORK
= 0x0020,
41 NLM_CONNECTIVITY_IPV4_INTERNET
= 0x0040,
42 NLM_CONNECTIVITY_IPV6_SUBNET
= 0x0100,
43 NLM_CONNECTIVITY_IPV6_LOCALNETWORK
= 0x0200,
44 NLM_CONNECTIVITY_IPV6_INTERNET
= 0x0400
47 typedef [v1_enum] enum NLM_DOMAIN_TYPE
49 NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK
= 0x00,
50 NLM_DOMAIN_TYPE_DOMAIN_NETWORK
= 0x01,
51 NLM_DOMAIN_TYPE_DOMAIN_AUTHENTICATED
= 0x02
54 typedef [v1_enum] enum NLM_ENUM_NETWORK
56 NLM_ENUM_NETWORK_CONNECTED
= 0x01,
57 NLM_ENUM_NETWORK_DISCONNECTED
= 0x02,
58 NLM_ENUM_NETWORK_ALL
= 0x03
61 typedef [v1_enum] enum NLM_CONNECTION_COST
63 NLM_CONNECTION_COST_UNKNOWN
= 0x0,
64 NLM_CONNECTION_COST_UNRESTRICTED
= 0x1,
65 NLM_CONNECTION_COST_FIXED
= 0x2,
66 NLM_CONNECTION_COST_VARIABLE
= 0x4,
67 NLM_CONNECTION_COST_OVERDATALIMIT
= 0x10000,
68 NLM_CONNECTION_COST_CONGESTED
= 0x20000,
69 NLM_CONNECTION_COST_ROAMING
= 0x40000,
70 NLM_CONNECTION_COST_APPROACHINGDATALIMIT
= 0x80000
71 } NLM_CONNECTION_COST
;
73 typedef struct NLM_SOCKADDR
78 const UINT32 NLM_UNKNOWN_DATAPLAN_STATUS
= 0xffffffff;
80 typedef struct NLM_USAGE_DATA
82 DWORD UsageInMegabytes
;
83 FILETIME LastSyncTime
;
86 typedef struct NLM_DATAPLAN_STATUS
89 NLM_USAGE_DATA UsageData
;
90 DWORD DataLimitInMegabytes
;
91 DWORD InboundBandwidthInKbps
;
92 DWORD OutboundBandwidthInKbps
;
93 FILETIME NextBillingCycle
;
94 DWORD MaxTransferSizeInMegabytes
;
96 } NLM_DATAPLAN_STATUS
;
100 pointer_default(unique),
101 uuid(dcb00008
-570f
-4a9b
-8d69
-199fdba5723b
)
103 interface INetworkCostManager
: IUnknown
107 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
109 HRESULT GetDataPlanStatus
(
110 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
,
111 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
113 HRESULT SetDestinationAddresses
(
115 [in, unique, size_is(length
)] NLM_SOCKADDR
*pDestIPAddrList
,
116 [in] VARIANT_BOOL bAppend
);
121 pointer_default(unique),
122 uuid(dcb0000a
-570f
-4a9b
-8d69
-199fdba5723b
)
124 interface INetworkConnectionCost
: IUnknown
129 HRESULT GetDataPlanStatus
(
130 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
);
135 pointer_default(unique),
136 uuid(dcb00009
-570f
-4a9b
-8d69
-199fdba5723b
)
138 interface INetworkCostManagerEvents
: IUnknown
142 [in, unique] NLM_SOCKADDR
*pDestAddr
);
144 HRESULT DataPlanStatusChanged
(
145 [in, unique] NLM_SOCKADDR
*pDestAddr
);
151 pointer_default(unique),
153 uuid(dcb00003
-570f
-4a9b
-8d69
-199fdba5723b
)
155 interface IEnumNetworks
: IDispatch
157 [id(DISPID_NEWENUM
), propget, hidden, restricted]
159 [out, retval] IEnumVARIANT
**ppEnumVar
);
164 [out, size_is(celt
), length_is(*pceltFetched
)] INetwork
**rgelt
,
165 [in, out] ULONG
*pceltFetched
);
176 [out, retval] IEnumNetworks
**ppEnumNetwork
);
182 pointer_default(unique),
184 uuid(dcb00006
-570f
-4a9b
-8d69
-199fdba5723b
)
186 interface IEnumNetworkConnections
: IDispatch
188 [id(DISPID_NEWENUM
), propget, hidden, restricted]
190 [out, retval] IEnumVARIANT
**ppEnumVar
);
195 [out, size_is(celt
), length_is(*pceltFetched
)] INetworkConnection
**rgelt
,
196 [in, out] ULONG
*pceltFetched
);
207 [out, retval] IEnumNetworkConnections
**ppEnumNetwork
);
214 pointer_default(unique),
215 uuid(dcb00000
-570f
-4a9b
-8d69
-199fdba5723b
)
217 interface INetworkListManager
: IDispatch
220 [in] NLM_ENUM_NETWORK Flags
,
221 [out, retval] IEnumNetworks
**ppEnumNetwork
);
224 [in] GUID gdNetworkId
,
225 [out, retval] INetwork
**ppNetwork
);
227 HRESULT GetNetworkConnections
(
228 [out, retval] IEnumNetworkConnections
**ppEnum
);
230 HRESULT GetNetworkConnection
(
231 [in] GUID gdNetworkConnectionId
,
232 [out, retval] INetworkConnection
**ppNetworkConnection
);
234 HRESULT IsConnectedToInternet
(
235 [out, retval] VARIANT_BOOL *pbIsConnected
);
238 [out, retval] VARIANT_BOOL *pbIsConnected
);
240 HRESULT GetConnectivity
(
241 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
246 uuid(dcb00c01
-570f
-4a9b
-8d69
-199fdba5723b
)
248 coclass NetworkListManager
{ interface INetworkListManager
; }
253 pointer_default(unique),
254 uuid(DCB00001
-570F
-4A9B
-8D69
-199FDBA5723B
)
256 interface INetworkListManagerEvents
: IUnknown
258 HRESULT ConnectivityChanged
(
259 [in] NLM_CONNECTIVITY newConnectivity
);
265 pointer_default(unique),
266 uuid(dcb00007
-570f
-4a9b
-8d69
-199fdba5723b
)
268 interface INetworkConnectionEvents
: IUnknown
270 typedef enum NLM_CONNECTION_PROPERTY_CHANGE
272 NLM_CONNECTION_PROPERTY_CHANGE_AUTHENTICATION
= 1
273 } NLM_CONNECTION_PROPERTY_CHANGE
;
275 HRESULT NetworkConnectionConnectivityChanged
(
276 [in] GUID connectionId
,
277 [in] NLM_CONNECTIVITY newConnectivity
);
279 HRESULT NetworkConnectionPropertyChanged
(
280 [in] GUID connectionId
,
281 [in] NLM_CONNECTION_PROPERTY_CHANGE flags
);
287 pointer_default(unique),
289 uuid(dcb00005
-570f
-4a9b
-8d69
-199fdba5723b
)
291 interface INetworkConnection
: IDispatch
295 [out, retval] INetwork
**ppNetwork
);
298 HRESULT IsConnectedToInternet
(
299 [out, retval] VARIANT_BOOL *pbIsConnected
);
303 [out, retval] VARIANT_BOOL *pbIsConnected
);
306 HRESULT GetConnectivity
(
307 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
310 HRESULT GetConnectionId
(
311 [out, retval] GUID
*pgdConnectionId
);
314 HRESULT GetAdapterId
(
315 [out, retval] GUID
*pgdAdapterId
);
318 HRESULT GetDomainType
(
319 [out, retval] NLM_DOMAIN_TYPE
*pDomainType
);
325 pointer_default(unique),
327 uuid(dcb00002
-570f
-4a9b
-8d69
-199fdba5723b
)
329 interface INetwork
: IDispatch
331 typedef enum NLM_NETWORK_CATEGORY
333 NLM_NETWORK_CATEGORY_PUBLIC
= 0x00,
334 NLM_NETWORK_CATEGORY_PRIVATE
= 0x01,
335 NLM_NETWORK_CATEGORY_DOMAIN_AUTHENTICATED
= 0x02
336 } NLM_NETWORK_CATEGORY
;
340 [out, string, retval] BSTR *pszNetworkName
);
344 [in, string] BSTR szNetworkNewName
);
347 HRESULT GetDescription
(
348 [out, string, retval] BSTR *pszDescription
);
351 HRESULT SetDescription
(
352 [in, string] BSTR szDescription
);
355 HRESULT GetNetworkId
(
356 [out, retval] GUID
*pgdGuidNetworkId
);
359 HRESULT GetDomainType
(
360 [out, retval] NLM_DOMAIN_TYPE
*pNetworkType
);
363 HRESULT GetNetworkConnections
(
364 [out, retval] IEnumNetworkConnections
**ppEnumNetworkConnection
);
367 HRESULT GetTimeCreatedAndConnected
(
368 [out] DWORD
*pdwLowDateTimeCreated
,
369 [out] DWORD
*pdwHighDateTimeCreated
,
370 [out] DWORD
*pdwLowDateTimeConnected
,
371 [out] DWORD
*pdwHighDateTimeConnected
);
374 HRESULT IsConnectedToInternet
(
375 [out, retval] VARIANT_BOOL *pbIsConnected
);
379 [out, retval] VARIANT_BOOL *pbIsConnected
);
382 HRESULT GetConnectivity
(
383 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
387 [out, retval] NLM_NETWORK_CATEGORY
*pCategory
);
391 [in] NLM_NETWORK_CATEGORY NewCategory
);