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 const UINT32 NLM_UNKNOWN_DATAPLAN_STATUS
= 0xffffffff;
73 typedef struct NLM_USAGE_DATA
75 DWORD UsageInMegabytes
;
76 FILETIME LastSyncTime
;
79 typedef struct NLM_DATAPLAN_STATUS
82 NLM_USAGE_DATA UsageData
;
83 DWORD DataLimitInMegabytes
;
84 DWORD InboundBandwidthInKbps
;
85 DWORD OutboundBandwidthInKbps
;
86 FILETIME NextBillingCycle
;
87 DWORD MaxTransferSizeInMegabytes
;
89 } NLM_DATAPLAN_STATUS
;
93 pointer_default(unique),
94 uuid(dcb00008
-570f
-4a9b
-8d69
-199fdba5723b
)
96 interface INetworkCostManager
: IUnknown
100 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
102 HRESULT GetDataPlanStatus
(
103 [out] NLM_DATAPLAN_STATUS
*pDataPlanStatus
,
104 [in, unique] NLM_SOCKADDR
*pDestIPAddr
);
106 HRESULT SetDestinationAddresses
(
108 [in, unique, size_is(length
)] NLM_SOCKADDR
*pDestIPAddrList
,
109 [in] VARIANT_BOOL bAppend
);
114 pointer_default(unique),
115 uuid(dcb00009
-570f
-4a9b
-8d69
-199fdba5723b
)
117 interface INetworkCostManagerEvents
: IUnknown
121 [in, unique] NLM_SOCKADDR
*pDestAddr
);
123 HRESULT DataPlanStatusChanged
(
124 [in, unique] NLM_SOCKADDR
*pDestAddr
);
131 pointer_default(unique),
132 uuid(dcb00000
-570f
-4a9b
-8d69
-199fdba5723b
)
134 interface INetworkListManager
: IDispatch
137 [in] NLM_ENUM_NETWORK Flags
,
138 [out, retval] IEnumNetworks
**ppEnumNetwork
);
141 [in] GUID gdNetworkId
,
142 [out, retval] INetwork
**ppNetwork
);
144 HRESULT GetNetworkConnections
(
145 [out, retval] IEnumNetworkConnections
**ppEnum
);
147 HRESULT GetNetworkConnection
(
148 [in] GUID gdNetworkConnectionId
,
149 [out, retval] INetworkConnection
**ppNetworkConnection
);
151 HRESULT IsConnectedToInternet
(
152 [out, retval] VARIANT_BOOL *pbIsConnected
);
155 [out, retval] VARIANT_BOOL *pbIsConnected
);
157 HRESULT GetConnectivity
(
158 [out, retval] NLM_CONNECTIVITY
*pConnectivity
);
163 uuid(dcb00c01
-570f
-4a9b
-8d69
-199fdba5723b
)
165 coclass NetworkListManager
{ interface INetworkListManager
; }
170 pointer_default(unique),
171 uuid(DCB00001
-570F
-4A9B
-8D69
-199FDBA5723B
)
173 interface INetworkListManagerEvents
: IUnknown
175 HRESULT ConnectivityChanged
(
176 [in] NLM_CONNECTIVITY newConnectivity
);