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_ENUM_NETWORK
49 NLM_ENUM_NETWORK_CONNECTED
= 0x01,
50 NLM_ENUM_NETWORK_DISCONNECTED
= 0x02,
51 NLM_ENUM_NETWORK_ALL
= 0x03
54 typedef [v1_enum] enum NLM_CONNECTION_COST
56 NLM_CONNECTION_COST_UNKNOWN
= 0x0,
57 NLM_CONNECTION_COST_UNRESTRICTED
= 0x1,
58 NLM_CONNECTION_COST_FIXED
= 0x2,
59 NLM_CONNECTION_COST_VARIABLE
= 0x4,
60 NLM_CONNECTION_COST_OVERDATALIMIT
= 0x10000,
61 NLM_CONNECTION_COST_CONGESTED
= 0x20000,
62 NLM_CONNECTION_COST_ROAMING
= 0x40000,
63 NLM_CONNECTION_COST_APPROACHINGDATALIMIT
= 0x80000
64 } NLM_CONNECTION_COST
;
66 typedef struct NLM_SOCKADDR
71 typedef struct NLM_USAGE_DATA
73 DWORD UsageInMegabytes
;
74 FILETIME LastSyncTime
;
77 typedef struct NLM_DATAPLAN_STATUS
80 NLM_USAGE_DATA UsageData
;
81 DWORD DataLimitInMegabytes
;
82 DWORD InboundBandwidthInKbps
;
83 DWORD OutboundBandwidthInKbps
;
84 FILETIME NextBillingCycle
;
85 DWORD MaxTransferSizeInMegabytes
;
87 } NLM_DATAPLAN_STATUS
;
91 pointer_default(unique),
92 uuid(dcb00008
-570f
-4a9b
-8d69
-199fdba5723b
)
94 interface INetworkCostManager
: IUnknown
98 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
100 HRESULT GetDataPlanStatus
(
101 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
,
102 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
104 HRESULT SetDestinationAddresses
(
106 [in, unique, size_is(length
)] NLM_SOCKADDR
*pDestIPAddrList
,
107 [in] VARIANT_BOOL bAppend
);
114 pointer_default(unique),
115 uuid(dcb00000
-570f
-4a9b
-8d69
-199fdba5723b
)
117 interface INetworkListManager
: IDispatch
120 [in] NLM_ENUM_NETWORK Flags
,
121 [out, retval] IEnumNetworks
**ppEnumNetwork
);
124 [in] GUID gdNetworkId
,
125 [out, retval] INetwork
**ppNetwork
);
127 HRESULT GetNetworkConnections
(
128 [out, retval] IEnumNetworkConnections
**ppEnum
);
130 HRESULT GetNetworkConnection
(
131 [in] GUID gdNetworkConnectionId
,
132 [out, retval] INetworkConnection
**ppNetworkConnection
);
134 HRESULT IsConnectedToInternet
(
135 [out, retval] VARIANT_BOOL *pbIsConnected
);
138 [out, retval] VARIANT_BOOL *pbIsConnected
);
140 HRESULT GetConnectivity
(
141 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
146 uuid(dcb00c01
-570f
-4a9b
-8d69
-199fdba5723b
)
148 coclass NetworkListManager
{ interface INetworkListManager
; }
153 pointer_default(unique),
154 uuid(DCB00001
-570F
-4A9B
-8D69
-199FDBA5723B
)
156 interface INetworkListManagerEvents
: IUnknown
158 HRESULT ConnectivityChanged
(
159 [in] NLM_CONNECTIVITY newConnectivity
);