2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FNetNetTypes.h
20 * @brief This is the header file for defining the types for the Net namespace.
22 * This header file contains the definitions of the various types and enumerators used in NetConnection operations.
24 #ifndef _FNET_NET_TYPES_H_
25 #define _FNET_NET_TYPES_H_
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseErrorDefine.h>
33 namespace Tizen { namespace Net
37 * The network account ID.
41 typedef int NetAccountId;
44 * @enum NetConnectionState
46 * Defines the state of a network connection.
50 enum NetConnectionState
52 NET_CONNECTION_STATE_NONE, /**< The initial state */
53 NET_CONNECTION_STATE_STARTING, /**< The network connection is being established */
54 NET_CONNECTION_STATE_STARTED, /**< The network connection has been established */
55 NET_CONNECTION_STATE_STOPPING, /**< The network connection is being disconnected */
56 NET_CONNECTION_STATE_STOPPED, /**< The network connection has been disconnected */
57 NET_CONNECTION_STATE_SUSPENDED, /**< The network connection has been suspended */
58 NET_CONNECTION_STATE_SUSPEND = 5, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
59 NET_CONNECTION_STATE_RESUMED, /**< The network connection is established, and recovered from the SUSPEND state - enable to send/receive packet data */
60 NET_CONNECTION_STATE_AVAILABLE, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
61 NET_CONNECTION_STATE_UNAVAILABLE, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
65 * @enum NetConnectionStoppedReason
67 * Defines the reason for stopping a network connection.
71 enum NetConnectionStoppedReason
73 NET_CONNECTION_STOPPED_REASON_RESOURCE_RELEASED, /**< The network connection managed by the system has stopped because the network resources have been released */
74 NET_CONNECTION_STOPPED_REASON_NETWORK_FAILED, /**< The network has failed */
75 NET_CONNECTION_STOPPED_REASON_DEVICE_OFFLINE, /**< The operation has failed because the device is in the offline mode */
76 NET_CONNECTION_STOPPED_REASON_SERVICE_UNAVAILABLE, /**< The device is out of the coverage area or in the emergency mode */
77 NET_CONNECTION_STOPPED_REASON_RESOURCE_UNAVAILABLE, /**< The network resource is unavailable */
78 NET_CONNECTION_STOPPED_REASON_SYSTEM /**< A system error has occurred */
82 * @enum NetProtocolType
84 * Defines the network protocol type.
90 NET_PROTO_TYPE_IPV4 = 1, /**< The IPV4 type */
91 NET_PROTO_TYPE_PPP, /**< The PPP type */
92 NET_PROTO_TYPE_IPV6, /**< The IPV6 type, currently NOT supported */
93 NET_PROTO_TYPE_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network Protocol type not set
97 * @enum NetAddressFamily
99 * Defines the network address family.
103 enum NetAddressFamily
106 NET_AF_IPV4 = 1, /**< The default @n An IPv4 address [RFC791] is represented in the decimal format with dots as delimiters */
107 NET_AF_IPV6, /**< An IPv6 address [RFC2373] is generally represented in hexadecimal numbers with colons as delimiters @n It can also be a combination of hexadecimal and decimal numbers with dots and colons as delimiters */
108 NET_AF_ALPHANUMERIC, /**< A generic alphanumeric address (as defined by alphanum in [RFC2396]) */
109 NET_AF_APN, /**< A GPRS APN as defined in [GENFORM] */
110 NET_AF_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network Address Family not set
113 /////////////////////////////////////////////////////////////////////////////////////////////
116 * @enum NetStatisticsInfoType
118 * Defines the various kinds of data call statistics information.
122 enum NetStatisticsInfoType
124 NET_STAT_SENT_SIZE = 2, /**< The size of the packet sent, since the time the network is last reactivated */
125 NET_STAT_RCVD_SIZE = 3, /**< The size of the packet received, since the time the network is last reactivated */
126 NET_STAT_TOTAL_SENT_SIZE = 8, /**< The cumulated size of the packet sent since the last reset */
127 NET_STAT_TOTAL_RCVD_SIZE = 9, /**< The cumulated size of the packet received since the last reset */
128 NET_STAT_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network Statistics Info Type not set
132 * @enum NetPreferenceType
134 * Defines the preferred network.
138 enum NetPreferenceType
140 NET_WIFI_FIRST, /**< The preference type to follow the preferred mode (Wi-Fi first) @n
141 * This preference type works like @c NET_PS_ONLY on the Emulator */
142 NET_PS_ONLY, /**< The preference type to only operate services for the PS domain */
143 NET_CS_ONLY, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
144 NET_WIFI_ONLY /**< The preference type to only operate services for Wi-Fi */
148 * @enum NetBearerType
150 * Defines the bearer type.
156 NET_BEARER_PS = 1, /**< The bearer type for the PS domain */
157 NET_BEARER_CS, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
158 NET_BEARER_WIFI, /**< The bearer type for Wi-Fi */
159 NET_BEARER_WIFI_DIRECT, /**< The bearer type for Wi-Fi Direct @n
160 * This bearer type cannot be tested on the Emulator */
161 NET_BEARER_USB, /**< The bearer type for the USB NDIS mode @n
162 * This bearer type can be used via USB Tethering mode @n
163 * This bearer type cannot be tested on the Emulator */
164 NET_BEARER_MMS, /**< The bearer type for MMS */
165 NET_BEARER_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network Bearer Type not set
169 * @enum NetAddressScheme
171 * Defines the network IP or Domain Name %System (DNS) scheme.
175 enum NetAddressScheme
177 NET_ADDRESS_SCHEME_DYNAMIC = 1, /**< The Dynamic IP or DNS Address */
178 NET_ADDRESS_SCHEME_STATIC, /**< The Static IP or DNS Address */
179 NET_ADDRESS_SCHEME_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network Address Scheme not set
183 * @enum NetNapAuthType
185 * Defines the authentication type of a network.
189 * @remarks There is no relevant data.
193 NET_NAPAUTH_PAP = 1, /**< The PAP (Password Authentication Protocol) type */
194 NET_NAPAUTH_CHAP, /**< The CHAP (Challenge/Handshake Authentication Protocol) type */
195 NET_NAPAUTH_NONE = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. Network NAP Authentication Type not set
201 * Defines the proxy type of a network.
207 NET_PROXY_TYPE_NONE = 0, /**< No proxy type */
208 NET_PROXY_TYPE_MANUAL /**< Manual configuration */
214 #endif // _FNET_NET_TYPES_H_