Release 4.0.0-preview1-00051
[platform/core/csapi/tizenfx.git] / src / Tizen.Network.Connection / Tizen.Network.Connection / ConnectionTypes.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Collections.Generic;
19 using System.Linq;
20 using System.Text;
21 using Tizen.Internals.Errors;
22
23
24 namespace Tizen.Network.Connection
25 {
26     /// <summary>
27     /// Enumeration for connection type.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public enum ConnectionType
31     {
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 */
38     }
39
40     /// <summary>
41     /// Enumeration for address family.
42     /// </summary>
43     /// <since_tizen> 3 </since_tizen>
44     public enum AddressFamily
45     {
46         IPv4 = 0,   /**< IPv4 Address */
47         IPv6 = 1    /**< IPv6 Address */
48     }
49
50     /// <summary>
51     /// Enumeration for cellular network state.
52     /// </summary>
53     /// <since_tizen> 3 </since_tizen>
54     public enum CellularState
55     {
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 */
62     }
63
64     /// <summary>
65     /// Enumeration for connection state.
66     /// </summary>
67     /// <since_tizen> 3 </since_tizen>
68     public enum ConnectionState
69     {
70         Deactivated = 0,   /**< Deactivated */
71         Disconnected = 1,  /**< Disconnected */
72         Connected = 2,     /**< Connected */
73     }
74
75     /// <summary>
76     /// This enumeration defines the attached or detached state of ethernet cable.
77     /// </summary>
78     /// <since_tizen> 3 </since_tizen>
79     public enum EthernetCableState
80     {
81         Detached = 0,  /**< Ethernet cable is detached */
82         Attached = 1,  /**< Ethernet cable is attached */
83     }
84
85     /// <summary>
86     /// Enumeration for statistics type.
87     /// </summary>
88     /// <since_tizen> 3 </since_tizen>
89     public enum StatisticsType
90     {
91         LastReceivedData = 0,  /**< Last received data */
92         LastSentData = 1,  /**< Last sent data */
93         TotalReceivedData = 2,  /**< Total received data */
94         TotalSentData = 3,  /**< Total sent data */
95     }
96
97     /// <summary>
98     /// Enumeration for network connection type.
99     /// </summary>
100     /// <since_tizen> 3 </since_tizen>
101     public enum ConnectionProfileType
102     {
103         Cellular = 0,  /**< Cellular type */
104         WiFi = 1,      /**< Wi-Fi type */
105         Ethernet = 2,  /**< Ethernet type */
106         Bt = 3,        /**< Bluetooth type */
107     }
108
109     /// <summary>
110     /// Enumeration for profile state type.
111     /// </summary>
112     /// <since_tizen> 3 </since_tizen>
113     public enum ProfileState
114     {
115         Disconnected = 0,  /**< Disconnected state */
116         Association = 1,  /**< Association state */
117         Configuration = 2,  /**< Configuration state */
118         Connected = 3,  /**< Connected state */
119     }
120
121     /// <summary>
122     /// Enumeration for proxy method type.
123     /// </summary>
124     /// <since_tizen> 3 </since_tizen>
125     public enum ProxyType
126     {
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 */
130     }
131
132     /// <summary>
133     /// Enumeration for IP configuration type.
134     /// </summary>
135     /// <since_tizen> 3 </since_tizen>
136     public enum IPConfigType
137     {
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 */
143     }
144
145     /// <summary>
146     /// Enumeration for cellular service type.
147     /// </summary>
148     /// <since_tizen> 3 </since_tizen>
149     public enum CellularServiceType
150     {
151         Unknown = 0,  /**< Unknown */
152         Internet = 1,  /**< Internet */
153         MMS = 2,  /**< MMS */
154         PrepaidInternet = 3,  /**< Prepaid internet */
155         PrepaidMMS = 4,  /**< Prepaid MMS */
156         Tethering = 5,  /**< Tethering */
157         Application = 6,  /**< Specific application */
158     }
159
160     /// <summary>
161     /// Enumeration for cellular pdn type.
162     /// </summary>
163     /// <since_tizen> 3 </since_tizen>
164     public enum CellularPdnType
165     {
166         Unknown = 0,  /**< Unknown */
167         IPv4 = 1,  /**< IPv4 */
168         IPv6 = 2,  /**< IPv6 */
169         IPv4_IPv6 = 3,  /**< Both IPv4 and IPv6 */
170     }
171
172     /// <summary>
173     /// Enumeration for DNS configuration type.
174     /// </summary>
175     /// <since_tizen> 3 </since_tizen>
176     public enum DnsConfigType
177     {
178         None = 0,  /**< Not defined */
179         Static = 1,  /**< Manual DNS configuration */
180         Dynamic = 2,  /**< Config DNS using DHCP client */
181     }
182
183     static internal class ConnectionErrorValue
184     {
185         internal const int Base = -0x01C10000;
186     }
187
188
189     /// <summary>
190     /// Enumeration for connection errors.
191     /// </summary>
192     /// <since_tizen> 3 </since_tizen>
193     // To do : have to assign valid error code
194     public enum ConnectionError
195     {
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 */
212     }
213
214     /// <summary>
215     /// Enumeration for profile list type.
216     /// </summary>
217     /// <since_tizen> 3 </since_tizen>
218     public enum ProfileListType
219     {
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  */
223     }
224
225     /// <summary>
226     /// Enumeration for security type of Wi-Fi.
227     /// </summary>
228     /// <since_tizen> 3 </since_tizen>
229     public enum WiFiSecurityType
230     {
231         None  =  0,       /**< Security disabled */
232         Wep = 1,          /**< WEP */
233         WpaPsk = 2,    /**< WPA-PSK */
234         Wpa2Psk = 3,  /**< WPA2-PSK */
235         Eap = 4,            /**< EAP */
236     }
237
238     /// <summary>
239     /// Enumeration for encryption modes.
240     /// </summary>
241     /// <since_tizen> 3 </since_tizen>
242     public enum WiFiEncryptionType
243     {
244         None = 0,  /**< Encryption disabled */
245         Wep = 1,  /**< WEP */
246         Tkip = 2,  /**< TKIP */
247         Aes = 3,  /**< AES */
248         TkipAesMixed = 4,  /**< TKIP and AES are both supported */
249     }
250
251     /// <summary>
252     /// Enumeration for connection profile state.
253     /// </summary>
254     /// <since_tizen> 3 </since_tizen>
255     public enum ConnectionProfileState
256     {
257         Disconnected = 0,  /**< Disconnected state */
258         Association = 1,  /**< Association state */
259         Configuration = 2,  /**< Configuration state */
260         Connected = 3,   /**< Connected state */
261     }
262
263     /// <summary>
264     /// Enumeration for cellular authentication type.
265     /// </summary>
266     /// <since_tizen> 3 </since_tizen>
267     public enum CellularAuthType
268     {
269         None = 0,  /**< No authentication */
270         Pap = 1,  /**< PAP authentication */
271         Chap = 2,  /**< CHAP authentication */
272     }
273
274     public enum AddressInformationType
275     {
276         Connection = 0,
277         WiFi = 1
278     }
279
280     static internal class Globals
281     {
282         internal const string LogTag = "Tizen.Network.Connection";
283     }
284 }