ssh
wolfssh/error.h@0:c4152c628df5, 2019-11-25 (annotated)
- Committer:
- sPymbed
- Date:
- Mon Nov 25 14:24:05 2019 +0000
- Revision:
- 0:c4152c628df5
first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sPymbed | 0:c4152c628df5 | 1 | /* error.h |
sPymbed | 0:c4152c628df5 | 2 | * |
sPymbed | 0:c4152c628df5 | 3 | * Copyright (C) 2014-2016 wolfSSL Inc. |
sPymbed | 0:c4152c628df5 | 4 | * |
sPymbed | 0:c4152c628df5 | 5 | * This file is part of wolfSSH. |
sPymbed | 0:c4152c628df5 | 6 | * |
sPymbed | 0:c4152c628df5 | 7 | * wolfSSH is free software; you can redistribute it and/or modify |
sPymbed | 0:c4152c628df5 | 8 | * it under the terms of the GNU General Public License as published by |
sPymbed | 0:c4152c628df5 | 9 | * the Free Software Foundation; either version 3 of the License, or |
sPymbed | 0:c4152c628df5 | 10 | * (at your option) any later version. |
sPymbed | 0:c4152c628df5 | 11 | * |
sPymbed | 0:c4152c628df5 | 12 | * wolfSSH is distributed in the hope that it will be useful, |
sPymbed | 0:c4152c628df5 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
sPymbed | 0:c4152c628df5 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
sPymbed | 0:c4152c628df5 | 15 | * GNU General Public License for more details. |
sPymbed | 0:c4152c628df5 | 16 | * |
sPymbed | 0:c4152c628df5 | 17 | * You should have received a copy of the GNU General Public License |
sPymbed | 0:c4152c628df5 | 18 | * along with wolfSSH. If not, see <http://www.gnu.org/licenses/>. |
sPymbed | 0:c4152c628df5 | 19 | */ |
sPymbed | 0:c4152c628df5 | 20 | |
sPymbed | 0:c4152c628df5 | 21 | |
sPymbed | 0:c4152c628df5 | 22 | /* |
sPymbed | 0:c4152c628df5 | 23 | * The error header file provides the error codes used in the library. |
sPymbed | 0:c4152c628df5 | 24 | */ |
sPymbed | 0:c4152c628df5 | 25 | |
sPymbed | 0:c4152c628df5 | 26 | |
sPymbed | 0:c4152c628df5 | 27 | #pragma once |
sPymbed | 0:c4152c628df5 | 28 | |
sPymbed | 0:c4152c628df5 | 29 | #include <wolfssh/settings.h> |
sPymbed | 0:c4152c628df5 | 30 | |
sPymbed | 0:c4152c628df5 | 31 | #ifdef __cplusplus |
sPymbed | 0:c4152c628df5 | 32 | extern "C" { |
sPymbed | 0:c4152c628df5 | 33 | #endif |
sPymbed | 0:c4152c628df5 | 34 | |
sPymbed | 0:c4152c628df5 | 35 | /* add new error strings to error.c */ |
sPymbed | 0:c4152c628df5 | 36 | |
sPymbed | 0:c4152c628df5 | 37 | |
sPymbed | 0:c4152c628df5 | 38 | /* main public return values */ |
sPymbed | 0:c4152c628df5 | 39 | enum WS_ErrorCodes { |
sPymbed | 0:c4152c628df5 | 40 | WS_SUCCESS = 0, /* function success */ |
sPymbed | 0:c4152c628df5 | 41 | WS_FATAL_ERROR = -1, /* general function failure */ |
sPymbed | 0:c4152c628df5 | 42 | WS_BAD_ARGUMENT = -2, /* bad function argument */ |
sPymbed | 0:c4152c628df5 | 43 | WS_MEMORY_E = -3, /* memory allocation failure */ |
sPymbed | 0:c4152c628df5 | 44 | WS_BUFFER_E = -4, /* input/output buffer size error */ |
sPymbed | 0:c4152c628df5 | 45 | WS_PARSE_E = -5, /* general parsing error */ |
sPymbed | 0:c4152c628df5 | 46 | WS_NOT_COMPILED = -6, /* feature not compiled in */ |
sPymbed | 0:c4152c628df5 | 47 | WS_OVERFLOW_E = -7, /* would overflow if continued */ |
sPymbed | 0:c4152c628df5 | 48 | WS_BAD_USAGE = -8, /* bad example usage */ |
sPymbed | 0:c4152c628df5 | 49 | WS_SOCKET_ERROR_E = -9, |
sPymbed | 0:c4152c628df5 | 50 | WS_WANT_READ = -10, |
sPymbed | 0:c4152c628df5 | 51 | WS_WANT_WRITE = -11, |
sPymbed | 0:c4152c628df5 | 52 | WS_RECV_OVERFLOW_E = -12, |
sPymbed | 0:c4152c628df5 | 53 | WS_VERSION_E = -13, /* Peer using wrong version of SSH */ |
sPymbed | 0:c4152c628df5 | 54 | WS_SEND_OOB_READ_E = -14, |
sPymbed | 0:c4152c628df5 | 55 | WS_INPUT_CASE_E = -15, |
sPymbed | 0:c4152c628df5 | 56 | WS_BAD_FILETYPE_E = -16, |
sPymbed | 0:c4152c628df5 | 57 | WS_UNIMPLEMENTED_E = -17, |
sPymbed | 0:c4152c628df5 | 58 | WS_RSA_E = -18, |
sPymbed | 0:c4152c628df5 | 59 | WS_BAD_FILE_E = -19, |
sPymbed | 0:c4152c628df5 | 60 | WS_INVALID_ALGO_ID = -20, |
sPymbed | 0:c4152c628df5 | 61 | WS_DECRYPT_E = -21, |
sPymbed | 0:c4152c628df5 | 62 | WS_ENCRYPT_E = -22, |
sPymbed | 0:c4152c628df5 | 63 | WS_VERIFY_MAC_E = -23, |
sPymbed | 0:c4152c628df5 | 64 | WS_CREATE_MAC_E = -24, |
sPymbed | 0:c4152c628df5 | 65 | WS_RESOURCE_E = -25, /* insufficient resources for new channel */ |
sPymbed | 0:c4152c628df5 | 66 | WS_INVALID_CHANTYPE = -26, /* invalid channel type */ |
sPymbed | 0:c4152c628df5 | 67 | WS_INVALID_CHANID = -27, |
sPymbed | 0:c4152c628df5 | 68 | WS_INVALID_USERNAME = -28, |
sPymbed | 0:c4152c628df5 | 69 | WS_CRYPTO_FAILED = -29, /* crypto action failed */ |
sPymbed | 0:c4152c628df5 | 70 | WS_INVALID_STATE_E = -30, |
sPymbed | 0:c4152c628df5 | 71 | WS_INVALID_PRIME_CURVE = -32, |
sPymbed | 0:c4152c628df5 | 72 | WS_ECC_E = -33, |
sPymbed | 0:c4152c628df5 | 73 | WS_CHANOPEN_FAILED = -34, |
sPymbed | 0:c4152c628df5 | 74 | WS_REKEYING = -90, /* Status: rekey in progress */ |
sPymbed | 0:c4152c628df5 | 75 | WS_CHANNEL_CLOSED = -91 /* Status: channel closed */ |
sPymbed | 0:c4152c628df5 | 76 | }; |
sPymbed | 0:c4152c628df5 | 77 | |
sPymbed | 0:c4152c628df5 | 78 | |
sPymbed | 0:c4152c628df5 | 79 | /* I/O Callback default errors */ |
sPymbed | 0:c4152c628df5 | 80 | enum WS_IOerrors { |
sPymbed | 0:c4152c628df5 | 81 | WS_CBIO_ERR_GENERAL = -1, /* general unexpected err */ |
sPymbed | 0:c4152c628df5 | 82 | WS_CBIO_ERR_WANT_READ = -2, /* need to call read again */ |
sPymbed | 0:c4152c628df5 | 83 | WS_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */ |
sPymbed | 0:c4152c628df5 | 84 | WS_CBIO_ERR_CONN_RST = -3, /* connection reset */ |
sPymbed | 0:c4152c628df5 | 85 | WS_CBIO_ERR_ISR = -4, /* interrupt */ |
sPymbed | 0:c4152c628df5 | 86 | WS_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */ |
sPymbed | 0:c4152c628df5 | 87 | WS_CBIO_ERR_TIMEOUT = -6 /* socket timeout */ |
sPymbed | 0:c4152c628df5 | 88 | }; |
sPymbed | 0:c4152c628df5 | 89 | |
sPymbed | 0:c4152c628df5 | 90 | |
sPymbed | 0:c4152c628df5 | 91 | #ifdef __cplusplus |
sPymbed | 0:c4152c628df5 | 92 | } |
sPymbed | 0:c4152c628df5 | 93 | #endif |
sPymbed | 0:c4152c628df5 | 94 |