2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
21 using Tizen.Internals.Errors;
24 namespace Tizen.Network.Connection
27 /// Enumeration for the connection type.
29 /// <since_tizen> 3 </since_tizen>
30 public enum ConnectionType
32 Disconnected = 0, /**< Disconnected */
33 WiFi = 1, /**< Wi-Fi type */
34 Cellular = 2, /**< Cellular type */
35 Ethernet = 3, /**< Ethernet type */
36 Bluetooth = 4, /**< Bluetooth type */
37 NetProxy = 5 /**< Proxy type for internet connection */
41 /// Enumeration for the address family.
43 /// <since_tizen> 3 </since_tizen>
44 public enum AddressFamily
46 IPv4 = 0, /**< IPv4 Address */
47 IPv6 = 1 /**< IPv6 Address */
51 /// Enumeration for the cellular network state.
53 /// <since_tizen> 3 </since_tizen>
54 public enum CellularState
56 OutOfService = 0, /**< Out of service */
57 FlightMode = 1, /**< Flight mode */
58 RoamingOff = 2, /**< Roaming is turned off */
59 CallOnlyAvailable = 3, /**< Call is only available */
60 Available = 4, /**< Available but not connected yet */
61 Connected = 5, /**< Connected */
65 /// Enumeration for the connection state.
67 /// <since_tizen> 3 </since_tizen>
68 public enum ConnectionState
70 Deactivated = 0, /**< Deactivated */
71 Disconnected = 1, /**< Disconnected */
72 Connected = 2, /**< Connected */
76 /// Enumeration for the attached or detached state of the ethernet cable.
78 /// <since_tizen> 3 </since_tizen>
79 public enum EthernetCableState
81 Detached = 0, /**< Ethernet cable is detached */
82 Attached = 1, /**< Ethernet cable is attached */
86 /// Enumeration for the statistics type.
88 /// <since_tizen> 3 </since_tizen>
89 public enum StatisticsType
91 LastReceivedData = 0, /**< Last received data */
92 LastSentData = 1, /**< Last sent data */
93 TotalReceivedData = 2, /**< Total received data */
94 TotalSentData = 3, /**< Total sent data */
98 /// Enumeration for the network connection type.
100 /// <since_tizen> 3 </since_tizen>
101 public enum ConnectionProfileType
103 Cellular = 0, /**< Cellular type */
104 WiFi = 1, /**< Wi-Fi type */
105 Ethernet = 2, /**< Ethernet type */
106 Bt = 3, /**< Bluetooth type */
110 /// Enumeration for the profile state type.
112 /// <since_tizen> 3 </since_tizen>
113 public enum ProfileState
115 Disconnected = 0, /**< Disconnected state */
116 Association = 1, /**< Association state */
117 Configuration = 2, /**< Configuration state */
118 Connected = 3, /**< Connected state */
122 /// Enumeration for the proxy method type.
124 /// <since_tizen> 3 </since_tizen>
125 public enum ProxyType
127 Direct = 0, /**< Direct connection */
128 Auto = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */
129 Manual = 2, /**< Manual configuration */
133 /// Enumeration for the IP configuration type.
135 /// <since_tizen> 3 </since_tizen>
136 public enum IPConfigType
138 None = 0, /**< Not defined */
139 Static = 1, /**< Manual IP configuration */
140 Dynamic = 2, /**< Config IP using DHCP client*/
141 Auto = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */
142 Fixed = 4, /**< Indicates an IP address that can not be modified */
146 /// Enumeration for the cellular service type.
148 /// <since_tizen> 3 </since_tizen>
149 public enum CellularServiceType
151 Unknown = 0, /**< Unknown */
152 Internet = 1, /**< Internet */
154 PrepaidInternet = 3, /**< Prepaid internet */
155 PrepaidMMS = 4, /**< Prepaid MMS */
156 Tethering = 5, /**< Tethering */
157 Application = 6, /**< Specific application */
161 /// Enumeration for the cellular pdn type.
163 /// <since_tizen> 3 </since_tizen>
164 public enum CellularPdnType
166 Unknown = 0, /**< Unknown */
167 IPv4 = 1, /**< IPv4 */
168 IPv6 = 2, /**< IPv6 */
169 IPv4_IPv6 = 3, /**< Both IPv4 and IPv6 */
173 /// Enumeration for the DNS configuration type.
175 /// <since_tizen> 3 </since_tizen>
176 public enum DnsConfigType
178 None = 0, /**< Not defined */
179 Static = 1, /**< Manual DNS configuration */
180 Dynamic = 2, /**< Config DNS using DHCP client */
183 static internal class ConnectionErrorValue
185 internal const int Base = -0x01C10000;
190 /// Enumeration for the connection errors.
192 /// <since_tizen> 3 </since_tizen>
193 // To do : have to assign valid error code
194 public enum ConnectionError
196 None = ErrorCode.None, /**< Successful */
197 InvalidParameter = ErrorCode.InvalidParameter, /**< Invalid parameter */
198 OutOfMemoryError = ErrorCode.OutOfMemory, /**< Out of memory error */
199 InvalidOperation = ErrorCode.InvalidOperation, /**< Invalid Operation */
200 AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported, /**< Address family not supported */
201 OperationFailed = ConnectionErrorValue.Base | 0x0401, /**< Operation failed */
202 EndOfIteration = ConnectionErrorValue.Base | 0x0402, /**< End of iteration */
203 NoConnection = ConnectionErrorValue.Base | 0x0403, /**< There is no connection */
204 NowInProgress = ErrorCode.NowInProgress, /** Now in progress */
205 AlreadyExists = ConnectionErrorValue.Base | 0x0404, /**< Already exists */
206 OperationAborted = ConnectionErrorValue.Base | 0x0405, /**< Operation is aborted */
207 DhcpFailed = ConnectionErrorValue.Base | 0x0406, /**< DHCP failed */
208 InvalidKey = ConnectionErrorValue.Base | 0x0407, /**< Invalid key */
209 NoReply = ConnectionErrorValue.Base | 0x0408, /**< No reply */
210 PermissionDenied = ErrorCode.PermissionDenied, /**< Permission denied */
211 NotSupported = ErrorCode.NotSupported /**< Not Supported */
215 /// Enumeration for the profile list type.
217 /// <since_tizen> 3 </since_tizen>
218 public enum ProfileListType
220 Registered = 0, /**< The iterator of the registered profile */
221 Connected = 1, /**< The iterator of the connected profile */
222 Default = 2, /**< The iterator of the default profile */
226 /// Enumeration for the security type of Wi-Fi.
228 /// <since_tizen> 3 </since_tizen>
229 public enum WiFiSecurityType
231 None = 0, /**< Security disabled */
233 WpaPsk = 2, /**< WPA-PSK */
234 Wpa2Psk = 3, /**< WPA2-PSK */
239 /// Enumeration for the encryption modes.
241 /// <since_tizen> 3 </since_tizen>
242 public enum WiFiEncryptionType
244 None = 0, /**< Encryption disabled */
246 Tkip = 2, /**< TKIP */
248 TkipAesMixed = 4, /**< TKIP and AES are both supported */
252 /// Enumeration for the connection profile state.
254 /// <since_tizen> 3 </since_tizen>
255 public enum ConnectionProfileState
257 Disconnected = 0, /**< Disconnected state */
258 Association = 1, /**< Association state */
259 Configuration = 2, /**< Configuration state */
260 Connected = 3, /**< Connected state */
264 /// Enumeration for the cellular authentication type.
266 /// <since_tizen> 3 </since_tizen>
267 public enum CellularAuthType
269 None = 0, /**< No authentication */
270 Pap = 1, /**< PAP authentication */
271 Chap = 2, /**< CHAP authentication */
274 public enum AddressInformationType
280 static internal class Globals
282 internal const string LogTag = "Tizen.Network.Connection";