[Docygen] Update @feature tag.
[platform/framework/native/net.git] / inc / FNetSockSocketTypes.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 /**
20 * @file                 FNetSockSocketTypes.h
21 * @brief                This is the header file for the enumerators of the Socket namespace.
22 *
23 * This header file contains the definitions of the enumerators for the Socket operations.
24 */
25
26 #ifndef _FNET_SOCK_SOCKET_TYPES_H_
27 #define _FNET_SOCK_SOCKET_TYPES_H_
28
29 #include <FNetNetTypes.h>
30
31 namespace Tizen { namespace Net { namespace Sockets
32 {
33
34 /**
35  * @enum    NetSocketEventType
36  *
37  * Defines the socket event types.
38  *
39  * @since       2.0
40  */
41 enum NetSocketEventType
42 {
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.
51 };
52
53 /**
54  * @enum    NetSocketAddressFamily
55  *
56  * Defines an address family.
57  *
58  * @since       2.0
59  */
60 enum NetSocketAddressFamily
61 {
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.
66 };
67
68 /**
69  * @enum    NetSocketType
70  *
71  * Defines a socket type.
72  *
73  * @since       2.0
74  */
75 enum NetSocketType
76 {
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.
80 };
81
82 /**
83  * @enum    NetSocketProtocol
84  *
85  * Defines a protocol type.
86  *
87  * @since       2.0
88  */
89 enum NetSocketProtocol
90 {
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.
95 };
96
97 /**
98  * @enum            NetSocketIoctlCmd
99  *
100  * Defines the commands that control the socket I/O.
101  *
102  * @since       2.0
103  */
104 enum NetSocketIoctlCmd
105 {
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.
111 };
112
113 /**
114  * @enum    NetSocketOptLevel
115  *
116  * Defines the socket option levels. @n
117  * The level decides the context of the option.
118  *
119  * @since       2.0
120  */
121 enum NetSocketOptLevel
122 {
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.
127 };
128
129 /**
130 * @enum     NetSocketOptName
131 *
132 * Defines the socket configuration option names.
133 *
134 * @since        2.0
135 */
136 enum NetSocketOptName
137 {
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 */
160
161         //Secure Socket only
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.
168 };
169
170 /**
171 * @enum     NetSocketClosedReason
172 *
173 * Defines a socket closed reason.
174 *
175 * @since        2.0
176 */
177 enum NetSocketClosedReason
178 {
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.
186 };
187
188 } } } // Tizen::Net::Sockets
189 #endif //_FNET_SOCK_SOCKET_TYPES_H_