2016-04-29 15:09:46 +08:00
|
|
|
/*
|
2016-05-06 02:13:32 +08:00
|
|
|
* Generated by util/mkerr.pl DO NOT EDIT
|
2022-05-03 18:52:38 +08:00
|
|
|
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
1999-04-24 08:15:18 +08:00
|
|
|
*
|
2018-12-06 20:20:10 +08:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-04-29 15:09:46 +08:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1999-04-24 08:15:18 +08:00
|
|
|
*/
|
|
|
|
|
1999-04-24 06:13:45 +08:00
|
|
|
#include <openssl/err.h>
|
2017-06-08 03:12:03 +08:00
|
|
|
#include <openssl/bioerr.h>
|
2020-11-12 17:36:47 +08:00
|
|
|
#include "crypto/bioerr.h"
|
1998-12-21 18:52:47 +08:00
|
|
|
|
2001-02-20 00:06:34 +08:00
|
|
|
#ifndef OPENSSL_NO_ERR
|
2005-04-13 00:15:22 +08:00
|
|
|
|
2017-06-08 03:12:03 +08:00
|
|
|
static const ERR_STRING_DATA BIO_str_reasons[] = {
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_ACCEPT_ERROR), "accept error"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET),
|
|
|
|
"addrinfo addr is not af inet"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_AMBIGUOUS_HOST_OR_SERVICE),
|
|
|
|
"ambiguous host or service"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_BAD_FOPEN_MODE), "bad fopen mode"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_BROKEN_PIPE), "broken pipe"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_CONNECT_ERROR), "connect error"},
|
2020-02-04 16:55:35 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_CONNECT_TIMEOUT), "connect timeout"},
|
2017-06-08 03:12:03 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET),
|
|
|
|
"gethostbyname addr is not af inet"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETSOCKNAME_ERROR), "getsockname error"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS),
|
|
|
|
"getsockname truncated address"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_GETTING_SOCKTYPE), "getting socktype"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_INVALID_ARGUMENT), "invalid argument"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_INVALID_SOCKET), "invalid socket"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_IN_USE), "in use"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LENGTH_TOO_LONG), "length too long"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LISTEN_V6_ONLY), "listen v6 only"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LOOKUP_RETURNED_NOTHING),
|
|
|
|
"lookup returned nothing"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_MALFORMED_HOST_OR_SERVICE),
|
|
|
|
"malformed host or service"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NBIO_CONNECT_ERROR), "nbio connect error"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED),
|
|
|
|
"no accept addr or service specified"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED),
|
|
|
|
"no hostname or service specified"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_PORT_DEFINED), "no port defined"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NO_SUCH_FILE), "no such file"},
|
2021-09-09 04:23:04 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TFO_DISABLED), "tfo disabled"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TFO_NO_KERNEL_SUPPORT),
|
|
|
|
"tfo no kernel support"},
|
2020-02-04 16:55:35 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_ERROR), "transfer error"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_TRANSFER_TIMEOUT), "transfer timeout"},
|
2017-06-08 03:12:03 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_BIND_SOCKET),
|
|
|
|
"unable to bind socket"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_CREATE_SOCKET),
|
|
|
|
"unable to create socket"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_KEEPALIVE),
|
|
|
|
"unable to keepalive"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_LISTEN_SOCKET),
|
|
|
|
"unable to listen socket"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_NODELAY), "unable to nodelay"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_REUSEADDR),
|
|
|
|
"unable to reuseaddr"},
|
2021-09-09 04:23:04 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNABLE_TO_TFO), "unable to tfo"},
|
2017-06-08 03:12:03 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNAVAILABLE_IP_FAMILY),
|
|
|
|
"unavailable ip family"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNINITIALIZED), "uninitialized"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNKNOWN_INFO_TYPE), "unknown info type"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_IP_FAMILY),
|
|
|
|
"unsupported ip family"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_METHOD), "unsupported method"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY),
|
|
|
|
"unsupported protocol family"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_WRITE_TO_READ_ONLY_BIO),
|
|
|
|
"write to read only BIO"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_WSASTARTUP), "WSAStartup"},
|
2022-08-01 17:33:00 +08:00
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_LOCAL_ADDR_NOT_AVAILABLE),
|
|
|
|
"local address not available"},
|
|
|
|
{ERR_PACK(ERR_LIB_BIO, 0, BIO_R_NON_FATAL),
|
|
|
|
"non-fatal or transient error"},
|
2015-01-22 11:40:55 +08:00
|
|
|
{0, NULL}
|
|
|
|
};
|
1998-12-21 18:52:47 +08:00
|
|
|
|
1998-12-21 18:56:39 +08:00
|
|
|
#endif
|
|
|
|
|
2021-05-25 10:04:22 +08:00
|
|
|
int ossl_err_load_BIO_strings(void)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
2006-11-22 05:29:44 +08:00
|
|
|
#ifndef OPENSSL_NO_ERR
|
2019-09-05 03:45:56 +08:00
|
|
|
if (ERR_reason_error_string(BIO_str_reasons[0].error) == NULL)
|
2017-06-08 03:12:03 +08:00
|
|
|
ERR_load_strings_const(BIO_str_reasons);
|
2006-11-22 05:29:44 +08:00
|
|
|
#endif
|
2016-07-12 21:50:06 +08:00
|
|
|
return 1;
|
2015-01-22 11:40:55 +08:00
|
|
|
}
|
2022-08-01 17:33:00 +08:00
|
|
|
|
|
|
|
#ifndef OPENSSL_NO_SOCK
|
|
|
|
|
|
|
|
int BIO_err_is_non_fatal(unsigned int errcode)
|
|
|
|
{
|
|
|
|
if (ERR_SYSTEM_ERROR(errcode))
|
|
|
|
return BIO_sock_non_fatal_error(ERR_GET_REASON(errcode));
|
|
|
|
else if (ERR_GET_LIB(errcode) == ERR_LIB_BIO
|
|
|
|
&& ERR_GET_REASON(errcode) == BIO_R_NON_FATAL)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|