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.
20 * @file FNetSockSocketTypes.h
21 * @brief This is the header file for the enumerators of the Socket namespace.
23 * This header file contains the definitions of the enumerators for the Socket operations.
26 #ifndef _FNET_SOCK_SOCKET_TYPES_H_
27 #define _FNET_SOCK_SOCKET_TYPES_H_
29 #include <FNetNetTypes.h>
31 namespace Tizen { namespace Net { namespace Sockets
35 * @enum NetSocketEventType
37 * Defines the socket event types.
41 enum NetSocketEventType
43 NET_SOCKET_EVENT_WRITE = 0x01, /**< The write event */
44 NET_SOCKET_EVENT_READ = 0x02, /**< The read event */
45 NET_SOCKET_EVENT_CLOSE = 0x04, /**< The close event */
46 NET_SOCKET_EVENT_ACCEPT = 0x08, /**< The accept event */
47 NET_SOCKET_EVENT_CONNECT = 0x10, /**< The connect event */
48 NET_SOCKET_EVENT_SERVCERT_FAIL = 0x20, /**< The server's certificate failed event @n
49 Only for %SecureSocket. */
50 NET_SOCKET_EVENT_NONE = 0x00 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
54 * @enum NetSocketAddressFamily
56 * Defines an address family.
60 enum NetSocketAddressFamily
62 //NET_SOCKET_AF_LOCAL = 1, /*< The local socket for loopback*/
63 NET_SOCKET_AF_IPV4 = 2, /**< An IP version 4 address family */
64 //NET_SOCKET_AF_IPV6, /*< An IP version 6 address family */
65 NET_SOCKET_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.
71 * Defines a socket type.
77 NET_SOCKET_TYPE_STREAM = 1, /**< The stream socket */
78 NET_SOCKET_TYPE_DATAGRAM, /**< The datagram socket */
79 NET_SOCKET_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.
83 * @enum NetSocketProtocol
85 * Defines a protocol type.
89 enum NetSocketProtocol
91 NET_SOCKET_PROTOCOL_TCP = 1, /**< The TCP protocol */
92 NET_SOCKET_PROTOCOL_UDP, /**< The UDP protocol */
93 NET_SOCKET_PROTOCOL_SSL, /**< The SSL protocol */
94 NET_SOCKET_PROTOCOL_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.
98 * @enum NetSocketIoctlCmd
100 * Defines the commands that control the socket I/O.
104 enum NetSocketIoctlCmd
106 NET_SOCKET_FIONBIO = 1, /**< The command to set the non-blocking/blocking mode on a socket */
107 NET_SOCKET_FIONREAD, /**< The command to determine the amount of data pending in the network input buffer */
108 NET_SOCKET_FIONWRITE, /**< The functionality is not supported in this SDK */
109 NET_SOCKET_SIOCATMARK, /**< The command to determine whether all out-of-band data is read */
110 NET_SOCKET_IOCTLCMD_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.
114 * @enum NetSocketOptLevel
116 * Defines the socket option levels. @n
117 * The level decides the context of the option.
121 enum NetSocketOptLevel
123 NET_SOCKET_IPPROTO_TCP = 1, /**< The socket options apply only to the TCP sockets */
124 NET_SOCKET_IPPROTO_IP, /**< The socket options apply only to the IP sockets */
125 NET_SOCKET_SOL_SOCKET, /**< The socket options apply to all the sockets */
126 NET_SOCKET_OPTLEVEL_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.
130 * @enum NetSocketOptName
132 * Defines the socket configuration option names.
136 enum NetSocketOptName
138 NET_SOCKET_TCP_NODELAY = 1, /**< The option name is Level: NET_SOCKET_IPPROTO_TCP - Set/Get is possible */
139 NET_SOCKET_TCP_MAXSEG, /**< The option name is Level: NET_SOCKET_IPPROTO_TCP - Set/Get is possible */
140 NET_SOCKET_IP_TTL, /**< The option name is Level: NET_SOCKET_IPPROTO_IP - Set/Get is possible */
141 NET_SOCKET_IP_TOS, /**< The option name is Level: NET_SOCKET_IPPROTO_IP - Set/Get is possible */
142 NET_SOCKET_IP_ADD_MEMBERSHIP, /**< The option name is Level: NET_SOCKET_IPPROTO_IP - Only Set is possible */
143 NET_SOCKET_IP_DROP_MEMBERSHIP, /**< The option name is Level: NET_SOCKET_IPPROTO_IP - Only Set is possible */
144 NET_SOCKET_SO_ACCEPTCONN, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Get is possible */
145 NET_SOCKET_SO_BROADCAST, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
146 NET_SOCKET_SO_DEBUG, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible (Currently, not supported)
147 NET_SOCKET_SO_DONTROUTE, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
148 NET_SOCKET_SO_ERROR, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Get is possible */
149 NET_SOCKET_SO_KEEPALIVE, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
150 NET_SOCKET_SO_LINGER, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
151 NET_SOCKET_SO_OOBINLINE, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
152 NET_SOCKET_SO_RCVBUF, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
153 NET_SOCKET_SO_RCVLOWAT, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible (Currently, not supported)
154 NET_SOCKET_SO_RCVTIMEO, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
155 NET_SOCKET_SO_REUSEADDR, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
156 NET_SOCKET_SO_SNDBUF, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
157 NET_SOCKET_SO_SNDLOWAT, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application. The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible (Currently, not supported)
158 NET_SOCKET_SO_SNDTIMEO, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
159 NET_SOCKET_SO_TYPE, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Get is possible */
162 NET_SOCKET_SO_SSLVERSION, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
163 NET_SOCKET_SO_SSLCIPHERSUITEID, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Set/Get is possible */
164 NET_SOCKET_SO_SSLCERTVERIFY, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Set is possible */
165 NET_SOCKET_SO_SSLCERTID, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Set is possible */
166 NET_SOCKET_SO_SSLCLIENTCERTVERIFY, /**< The option name is Level: NET_SOCKET_SOL_SOCKET - Only Set is possible */
167 NET_SOCKET_OPTNAME_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.
171 * @enum NetSocketClosedReason
173 * Defines a socket closed reason.
177 enum NetSocketClosedReason
179 NET_SOCKET_CLOSED_REASON_NORMAL = 1, /**< A normal closed status by peer */
180 NET_SOCKET_CLOSED_REASON_TIMEOUT, /**< The connection attempt failed due to timeout */
181 NET_SOCKET_CLOSED_REASON_NETWORK_UNAVAILABLE, /**< The network is unavailable */
182 NET_SOCKET_CLOSED_REASON_SYSTEM, /**< An internal error has occurred */
183 NET_SOCKET_CLOSED_REASON_NO_CERTIFICATE, /**< The reason is there is no client's SSL certificate */
184 NET_SOCKET_CLOSED_REASON_BY_USER, /**< The connection closed by user */
185 NET_SOCKET_CLOSED_REASON_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.
188 } } } // Tizen::Net::Sockets
189 #endif //_FNET_SOCK_SOCKET_TYPES_H_