Release 4.0.0-preview1-00301
[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 the connection type.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public enum ConnectionType
31     {
32         /// <summary>
33         /// Disconnected
34         /// </summary>
35         Disconnected = 0,
36         /// <summary>
37         /// Wi-Fi type
38         /// </summary>
39         WiFi = 1,
40         /// <summary>
41         /// Cellular type
42         /// </summary>
43         Cellular = 2,
44         /// <summary>
45         /// Ethernet type
46         /// </summary>
47         Ethernet = 3,
48         /// <summary>
49         /// Bluetooth type
50         /// </summary>
51         Bluetooth = 4,
52         /// <summary>
53         /// Proxy type for Internet connection
54         /// </summary>
55         NetProxy = 5
56     }
57
58     /// <summary>
59     /// Enumeration for the address family.
60     /// </summary>
61     /// <since_tizen> 3 </since_tizen>
62     public enum AddressFamily
63     {
64         /// <summary>
65         /// IPv4 Address
66         /// </summary>
67         IPv4 = 0,
68         /// <summary>
69         /// IPv6 Address
70         /// </summary>
71         IPv6 = 1
72     }
73
74     /// <summary>
75     /// Enumeration for the cellular network state.
76     /// </summary>
77     /// <since_tizen> 3 </since_tizen>
78     public enum CellularState
79     {
80         /// <summary>
81         /// Out of service
82         /// </summary>
83         OutOfService = 0,
84         /// <summary>
85         /// Flight mode
86         /// </summary>
87         FlightMode = 1,
88         /// <summary>
89         /// Roaming is turned off
90         /// </summary>
91         RoamingOff = 2,
92         /// <summary>
93         /// Call is only available
94         /// </summary>
95         CallOnlyAvailable = 3,
96         /// <summary>
97         /// Available but not connected yet
98         /// </summary>
99         Available = 4,
100         /// <summary>
101         /// Connected
102         /// </summary>
103         Connected = 5,
104     }
105
106     /// <summary>
107     /// Enumeration for the connection state.
108     /// </summary>
109     /// <since_tizen> 3 </since_tizen>
110     public enum ConnectionState
111     {
112         /// <summary>
113         /// Deactivated
114         /// </summary>
115         Deactivated = 0,
116         /// <summary>
117         /// Disconnected
118         /// </summary>
119         Disconnected = 1,
120         /// <summary>
121         /// Connected
122         /// </summary>
123         Connected = 2,
124     }
125
126     /// <summary>
127     /// Enumeration for the attached or detached state of the ethernet cable.
128     /// </summary>
129     /// <since_tizen> 3 </since_tizen>
130     public enum EthernetCableState
131     {
132         /// <summary>
133         /// Ethernet cable is detached
134         /// </summary>
135         Detached = 0,
136         /// <summary>
137         /// Ethernet cable is attached
138         /// </summary>
139         Attached = 1,
140     }
141
142     /// <summary>
143     /// Enumeration for the statistics type.
144     /// </summary>
145     /// <since_tizen> 3 </since_tizen>
146     public enum StatisticsType
147     {
148         /// <summary>
149         /// Last received data
150         /// </summary>
151         LastReceivedData = 0,
152         /// <summary>
153         /// Last sent data
154         /// </summary>
155         LastSentData = 1,
156         /// <summary>
157         /// Total received data
158         /// </summary>
159         TotalReceivedData = 2,
160         /// <summary>
161         /// Total sent data
162         /// </summary>
163         TotalSentData = 3,
164     }
165
166     /// <summary>
167     /// Enumeration for the network connection type.
168     /// </summary>
169     /// <since_tizen> 3 </since_tizen>
170     public enum ConnectionProfileType
171     {
172         /// <summary>
173         /// Cellular type
174         /// </summary>
175         Cellular = 0,
176         /// <summary>
177         /// Wi-Fi type
178         /// </summary>
179         WiFi = 1,
180         /// <summary>
181         /// Ethernet type
182         /// </summary>
183         Ethernet = 2,
184         /// <summary>
185         /// Bluetooth type
186         /// </summary>
187         Bt = 3,
188     }
189
190     /// <summary>
191     /// Enumeration for the profile state type.
192     /// </summary>
193     /// <since_tizen> 3 </since_tizen>
194     public enum ProfileState
195     {
196         /// <summary>
197         /// Disconnected state
198         /// </summary>
199         Disconnected = 0,
200         /// <summary>
201         /// Association state
202         /// </summary>
203         Association = 1,
204         /// <summary>
205         /// Configuration state
206         /// </summary>
207         Configuration = 2,
208         /// <summary>
209         /// Connected state
210         /// </summary>
211         Connected = 3,
212     }
213
214     /// <summary>
215     /// Enumeration for the proxy method type.
216     /// </summary>
217     /// <since_tizen> 3 </since_tizen>
218     public enum ProxyType
219     {
220         /// <summary>
221         /// Direct connection
222         /// </summary>
223         Direct = 0,
224         /// <summary>
225         /// Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried
226         /// </summary>
227         Auto = 1,
228         /// <summary>
229         /// Manual configuration
230         /// </summary>
231         Manual = 2,
232     }
233
234     /// <summary>
235     /// Enumeration for the IP configuration type.
236     /// </summary>
237     /// <since_tizen> 3 </since_tizen>
238     public enum IPConfigType
239     {
240         /// <summary>
241         /// Not defined
242         /// </summary>
243         None = 0,
244         /// <summary>
245         /// Manual IP configuration
246         /// </summary>
247         Static = 1,
248         /// <summary>
249         /// Config IP using DHCP client
250         /// </summary>
251         Dynamic = 2,
252         /// <summary>
253         /// Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available
254         /// </summary>
255         Auto = 3,
256         /// <summary>
257         /// Indicates an IP address that can not be modified
258         /// </summary>
259         Fixed = 4,
260     }
261
262     /// <summary>
263     /// Enumeration for the cellular service type.
264     /// </summary>
265     /// <since_tizen> 3 </since_tizen>
266     public enum CellularServiceType
267     {
268         /// <summary>
269         /// Unknown
270         /// </summary>
271         Unknown = 0,
272         /// <summary>
273         /// Internet
274         /// </summary>
275         Internet = 1,
276         /// <summary>
277         /// MMS
278         /// </summary>
279         MMS = 2,
280         /// <summary>
281         /// Prepaid Internet
282         /// </summary>
283         PrepaidInternet = 3,
284         /// <summary>
285         /// Prepaid MMS
286         /// </summary>
287         PrepaidMMS = 4,
288         /// <summary>
289         /// Tethering
290         /// </summary>
291         Tethering = 5,
292         /// <summary>
293         /// Specific application
294         /// </summary>
295         Application = 6,
296     }
297
298     /// <summary>
299     /// Enumeration for the cellular pdn type.
300     /// </summary>
301     /// <since_tizen> 3 </since_tizen>
302     public enum CellularPdnType
303     {
304         /// <summary>
305         /// Unknown
306         /// </summary>
307         Unknown = 0,
308         /// <summary>
309         /// IPv4
310         /// </summary>
311         IPv4 = 1,
312         /// <summary>
313         /// IPv6
314         /// </summary>
315         IPv6 = 2,
316         /// <summary>
317         /// Both IPv4 and IPv6
318         /// </summary>
319         IPv4_IPv6 = 3,
320     }
321
322     /// <summary>
323     /// Enumeration for the DNS configuration type.
324     /// </summary>
325     /// <since_tizen> 3 </since_tizen>
326     public enum DnsConfigType
327     {
328         /// <summary>
329         /// Not defined
330         /// </summary>
331         None = 0,
332         /// <summary>
333         /// Manual DNS configuration
334         /// </summary>
335         Static = 1,
336         /// <summary>
337         /// Config DNS using DHCP client
338         /// </summary>
339         Dynamic = 2,
340     }
341
342     static internal class ConnectionErrorValue
343     {
344         internal const int Base = -0x01C10000;
345     }
346
347
348     /// <summary>
349     /// Enumeration for the connection errors.
350     /// </summary>
351     /// <since_tizen> 3 </since_tizen>
352     // To do : have to assign valid error code
353     public enum ConnectionError
354     {
355         /// <summary>
356         /// Successful
357         /// </summary>
358         None = ErrorCode.None,
359         /// <summary>
360         /// Invalid parameter
361         /// </summary>
362         InvalidParameter = ErrorCode.InvalidParameter,
363         /// <summary>
364         /// Out of memory error
365         /// </summary>
366         OutOfMemoryError = ErrorCode.OutOfMemory,
367         /// <summary>
368         /// Invalid operation
369         /// </summary>
370         InvalidOperation = ErrorCode.InvalidOperation,
371         /// <summary>
372         /// Address family not supported
373         /// </summary>
374         AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported,
375         /// <summary>
376         /// Operation failed
377         /// </summary>
378         OperationFailed = ConnectionErrorValue.Base | 0x0401,
379         /// <summary>
380         /// End of iteration
381         /// </summary>
382         EndOfIteration = ConnectionErrorValue.Base | 0x0402,
383         /// <summary>
384         /// There is no connection
385         /// </summary>
386         NoConnection = ConnectionErrorValue.Base | 0x0403,
387         /// <summary>
388         /// Now in progress
389         /// </summary>
390         NowInProgress = ErrorCode.NowInProgress,
391         /// <summary>
392         /// Already exists
393         /// </summary>
394         AlreadyExists = ConnectionErrorValue.Base | 0x0404,
395         /// <summary>
396         /// Operation is aborted
397         /// </summary>
398         OperationAborted = ConnectionErrorValue.Base | 0x0405,
399         /// <summary>
400         /// DHCP failed
401         /// </summary>
402         DhcpFailed = ConnectionErrorValue.Base | 0x0406,
403         /// <summary>
404         /// Invalid key
405         /// </summary>
406         InvalidKey = ConnectionErrorValue.Base | 0x0407,
407         /// <summary>
408         /// No reply
409         /// </summary>
410         NoReply = ConnectionErrorValue.Base | 0x0408,
411         /// <summary>
412         /// Permission denied
413         /// </summary>
414         PermissionDenied = ErrorCode.PermissionDenied,
415         /// <summary>
416         /// Not supported
417         /// </summary>
418         NotSupported = ErrorCode.NotSupported
419     }
420
421     /// <summary>
422     /// Enumeration for the profile list type.
423     /// </summary>
424     /// <since_tizen> 3 </since_tizen>
425     public enum ProfileListType
426     {
427         /// <summary>
428         /// The iterator of the registered profile
429         /// </summary>
430         Registered = 0,
431         /// <summary>
432         /// The iterator of the connected profile
433         /// </summary>
434         Connected = 1,
435         /// <summary>
436         /// The iterator of the default profile
437         /// </summary>
438         Default = 2,
439     }
440
441     /// <summary>
442     /// Enumeration for the security type of Wi-Fi.
443     /// </summary>
444     /// <since_tizen> 3 </since_tizen>
445     public enum WiFiSecurityType
446     {
447         /// <summary>
448         /// Security disabled
449         /// </summary>
450         None  =  0,
451         /// <summary>
452         /// WEP
453         /// </summary>
454         Wep = 1,
455         /// <summary>
456         /// WPA-PSK
457         /// </summary>
458         WpaPsk = 2,
459         /// <summary>
460         /// WPA2-PSK
461         /// </summary>
462         Wpa2Psk = 3,
463         /// <summary>
464         /// EAP
465         /// </summary>
466         Eap = 4,
467     }
468
469     /// <summary>
470     /// Enumeration for the encryption modes.
471     /// </summary>
472     /// <since_tizen> 3 </since_tizen>
473     public enum WiFiEncryptionType
474     {
475         /// <summary>
476         /// Encryption disabled
477         /// </summary>
478         None = 0,
479         /// <summary>
480         /// WEP
481         /// </summary>
482         Wep = 1,
483         /// <summary>
484         /// TKIP
485         /// </summary>
486         Tkip = 2,
487         /// <summary>
488         /// AES
489         /// </summary>
490         Aes = 3,
491         /// <summary>
492         /// TKIP and AES are both supported
493         /// </summary>
494         TkipAesMixed = 4,
495     }
496
497     /// <summary>
498     /// Enumeration for the connection profile state.
499     /// </summary>
500     /// <since_tizen> 3 </since_tizen>
501     public enum ConnectionProfileState
502     {
503         /// <summary>
504         /// Disconnected state
505         /// </summary>
506         Disconnected = 0,
507         /// <summary>
508         /// Association state
509         /// </summary>
510         Association = 1,
511         /// <summary>
512         /// Configuration state
513         /// </summary>
514         Configuration = 2,
515         /// <summary>
516         /// Connected state
517         /// </summary>
518         Connected = 3,
519     }
520
521     /// <summary>
522     /// Enumeration for the cellular authentication type.
523     /// </summary>
524     /// <since_tizen> 3 </since_tizen>
525     public enum CellularAuthType
526     {
527         /// <summary>
528         /// No authentication
529         /// </summary>
530         None = 0,
531         /// <summary>
532         /// PAP authentication
533         /// </summary>
534         Pap = 1,
535         /// <summary>
536         /// CHAP authentication
537         /// </summary>
538         Chap = 2,
539     }
540
541     static internal class Globals
542     {
543         internal const string LogTag = "Tizen.Network.Connection";
544     }
545 }