/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using Tizen.Internals.Errors; namespace Tizen.Network.Connection { /// /// Enumeration for the connection type. /// /// 3 public enum ConnectionType { /// /// Disconnected /// Disconnected = 0, /// /// Wi-Fi type /// WiFi = 1, /// /// Cellular type /// Cellular = 2, /// /// Ethernet type /// Ethernet = 3, /// /// Bluetooth type /// Bluetooth = 4, /// /// Proxy type for Internet connection /// NetProxy = 5 } /// /// Enumeration for the address family. /// /// 3 public enum AddressFamily { /// /// IPv4 Address /// IPv4 = 0, /// /// IPv6 Address /// IPv6 = 1 } /// /// Enumeration for the cellular network state. /// /// 3 public enum CellularState { /// /// Out of service /// OutOfService = 0, /// /// Flight mode /// FlightMode = 1, /// /// Roaming is turned off /// RoamingOff = 2, /// /// Call is only available /// CallOnlyAvailable = 3, /// /// Available but not connected yet /// Available = 4, /// /// Connected /// Connected = 5, } /// /// Enumeration for the connection state. /// /// 3 public enum ConnectionState { /// /// Deactivated /// Deactivated = 0, /// /// Disconnected /// Disconnected = 1, /// /// Connected /// Connected = 2, } /// /// Enumeration for the attached or detached state of the ethernet cable. /// /// 3 public enum EthernetCableState { /// /// Ethernet cable is detached /// Detached = 0, /// /// Ethernet cable is attached /// Attached = 1, } /// /// Enumeration for the statistics type. /// /// 3 public enum StatisticsType { /// /// Last received data /// LastReceivedData = 0, /// /// Last sent data /// LastSentData = 1, /// /// Total received data /// TotalReceivedData = 2, /// /// Total sent data /// TotalSentData = 3, } /// /// Enumeration for the network connection type. /// /// 3 public enum ConnectionProfileType { /// /// Cellular type /// Cellular = 0, /// /// Wi-Fi type /// WiFi = 1, /// /// Ethernet type /// Ethernet = 2, /// /// Bluetooth type /// Bt = 3, } /// /// Enumeration for the profile state type. /// /// 3 public enum ProfileState { /// /// Disconnected state /// Disconnected = 0, /// /// Association state /// Association = 1, /// /// Configuration state /// Configuration = 2, /// /// Connected state /// Connected = 3, } /// /// Enumeration for the proxy method type. /// /// 3 public enum ProxyType { /// /// Direct connection /// Direct = 0, /// /// Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried /// Auto = 1, /// /// Manual configuration /// Manual = 2, } /// /// Enumeration for the IP configuration type. /// /// 3 public enum IPConfigType { /// /// Not defined /// None = 0, /// /// Manual IP configuration /// Static = 1, /// /// Config IP using DHCP client /// Dynamic = 2, /// /// Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available /// Auto = 3, /// /// Indicates an IP address that can not be modified /// Fixed = 4, } /// /// Enumeration for the cellular service type. /// /// 3 public enum CellularServiceType { /// /// Unknown /// Unknown = 0, /// /// Internet /// Internet = 1, /// /// MMS /// MMS = 2, /// /// Prepaid Internet /// PrepaidInternet = 3, /// /// Prepaid MMS /// PrepaidMMS = 4, /// /// Tethering /// Tethering = 5, /// /// Specific application /// Application = 6, } /// /// Enumeration for the cellular pdn type. /// /// 3 public enum CellularPdnType { /// /// Unknown /// Unknown = 0, /// /// IPv4 /// IPv4 = 1, /// /// IPv6 /// IPv6 = 2, /// /// Both IPv4 and IPv6 /// IPv4_IPv6 = 3, } /// /// Enumeration for the DNS configuration type. /// /// 3 public enum DnsConfigType { /// /// Not defined /// None = 0, /// /// Manual DNS configuration /// Static = 1, /// /// Config DNS using DHCP client /// Dynamic = 2, } static internal class ConnectionErrorValue { internal const int Base = -0x01C10000; } /// /// Enumeration for the connection errors. /// /// 3 // To do : have to assign valid error code public enum ConnectionError { /// /// Successful /// None = ErrorCode.None, /// /// Invalid parameter /// InvalidParameter = ErrorCode.InvalidParameter, /// /// Out of memory error /// OutOfMemoryError = ErrorCode.OutOfMemory, /// /// Invalid operation /// InvalidOperation = ErrorCode.InvalidOperation, /// /// Address family not supported /// AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported, /// /// Operation failed /// OperationFailed = ConnectionErrorValue.Base | 0x0401, /// /// End of iteration /// EndOfIteration = ConnectionErrorValue.Base | 0x0402, /// /// There is no connection /// NoConnection = ConnectionErrorValue.Base | 0x0403, /// /// Now in progress /// NowInProgress = ErrorCode.NowInProgress, /// /// Already exists /// AlreadyExists = ConnectionErrorValue.Base | 0x0404, /// /// Operation is aborted /// OperationAborted = ConnectionErrorValue.Base | 0x0405, /// /// DHCP failed /// DhcpFailed = ConnectionErrorValue.Base | 0x0406, /// /// Invalid key /// InvalidKey = ConnectionErrorValue.Base | 0x0407, /// /// No reply /// NoReply = ConnectionErrorValue.Base | 0x0408, /// /// Permission denied /// PermissionDenied = ErrorCode.PermissionDenied, /// /// Not supported /// NotSupported = ErrorCode.NotSupported } /// /// Enumeration for the profile list type. /// /// 3 public enum ProfileListType { /// /// The iterator of the registered profile /// Registered = 0, /// /// The iterator of the connected profile /// Connected = 1, /// /// The iterator of the default profile /// Default = 2, } /// /// Enumeration for the security type of Wi-Fi. /// /// 3 public enum WiFiSecurityType { /// /// Security disabled /// None = 0, /// /// WEP /// Wep = 1, /// /// WPA-PSK /// WpaPsk = 2, /// /// WPA2-PSK /// Wpa2Psk = 3, /// /// EAP /// Eap = 4, } /// /// Enumeration for the encryption modes. /// /// 3 public enum WiFiEncryptionType { /// /// Encryption disabled /// None = 0, /// /// WEP /// Wep = 1, /// /// TKIP /// Tkip = 2, /// /// AES /// Aes = 3, /// /// TKIP and AES are both supported /// TkipAesMixed = 4, } /// /// Enumeration for the connection profile state. /// /// 3 public enum ConnectionProfileState { /// /// Disconnected state /// Disconnected = 0, /// /// Association state /// Association = 1, /// /// Configuration state /// Configuration = 2, /// /// Connected state /// Connected = 3, } /// /// Enumeration for the cellular authentication type. /// /// 3 public enum CellularAuthType { /// /// No authentication /// None = 0, /// /// PAP authentication /// Pap = 1, /// /// CHAP authentication /// Chap = 2, } static internal class Globals { internal const string LogTag = "Tizen.Network.Connection"; } }