1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef COMMUNICATION_NETSTACK_SOCKET_ERROR_H 17 #define COMMUNICATION_NETSTACK_SOCKET_ERROR_H 18 19 #include <string> 20 #include <map> 21 22 namespace OHOS { 23 namespace NetStack { 24 namespace TlsSocket { 25 enum TlsSocketError { 26 TLSSOCKET_SUCCESS = 0, 27 TLS_ERR_SYS_BASE = 2303100, 28 TLS_ERR_SYS_EINTR = 2303104, 29 TLS_ERR_SYS_EIO = 2303105, 30 TLS_ERR_SYS_EBADF = 2303109, 31 TLS_ERR_SYS_EAGAIN = 2303111, 32 TLS_ERR_SYS_EACCES = 2303113, 33 TLS_ERR_SYS_EFAULT = 2303114, 34 TLS_ERR_SYS_EINVAL = 2303122, 35 TLS_ERR_SYS_ENOTSOCK = 2303188, 36 TLS_ERR_SYS_EPROTOTYPE = 2303191, 37 TLS_ERR_SYS_EADDRINUSE = 2303198, 38 TLS_ERR_SYS_EADDRNOTAVAIL = 2303199, 39 TLS_ERR_SYS_ENOTCONN = 2303207, 40 TLS_ERR_SYS_ETIMEDOUT = 2303210, 41 TLS_ERR_SSL_BASE = 2303500, 42 TLS_ERR_SSL_NULL = 2303501, 43 TLS_ERR_WANT_READ = 2303502, 44 TLS_ERR_WANT_WRITE = 2303503, 45 TLS_ERR_WANT_X509_LOOKUP = 2303504, 46 TLS_ERR_SYSCALL = 2303505, 47 TLS_ERR_ZERO_RETURN = 2303506, 48 TLS_ERR_WANT_CONNECT = 2303507, 49 TLS_ERR_WANT_ACCEPT = 2303508, 50 TLS_ERR_WANT_ASYNC = 2303509, 51 TLS_ERR_WANT_ASYNC_JOB = 2303510, 52 TLS_ERR_WANT_CLIENT_HELLO_CB = 2303511, 53 TLS_ERR_NO_BIND = 2303600, 54 }; 55 56 std::string MakeErrorMessage(int error); 57 } // namespace TlsSocket 58 } // namespace NetStack 59 } // namespace OHOS 60 #endif // COMMUNICATION_NETSTACK_SOCKET_ERROR_H 61