e_afalg_err.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Generated by util/mkerr.pl DO NOT EDIT
  3. * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License 2.0 (the "License"). You may not use
  6. * this file except in compliance with the License. You can obtain a copy
  7. * in the file LICENSE in the source distribution or at
  8. * https://www.openssl.org/source/license.html
  9. */
  10. #include <openssl/err.h>
  11. #include "e_afalg_err.h"
  12. #ifndef OPENSSL_NO_ERR
  13. static ERR_STRING_DATA AFALG_str_reasons[] = {
  14. {ERR_PACK(0, 0, AFALG_R_EVENTFD_FAILED), "eventfd failed"},
  15. {ERR_PACK(0, 0, AFALG_R_FAILED_TO_GET_PLATFORM_INFO),
  16. "failed to get platform info"},
  17. {ERR_PACK(0, 0, AFALG_R_INIT_FAILED), "init failed"},
  18. {ERR_PACK(0, 0, AFALG_R_IO_SETUP_FAILED), "io setup failed"},
  19. {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG),
  20. "kernel does not support afalg"},
  21. {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG),
  22. "kernel does not support async afalg"},
  23. {ERR_PACK(0, 0, AFALG_R_KERNEL_OP_FAILED), "kernel op failed"},
  24. {ERR_PACK(0, 0, AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed"},
  25. {ERR_PACK(0, 0, AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed"},
  26. {ERR_PACK(0, 0, AFALG_R_SOCKET_BIND_FAILED), "socket bind failed"},
  27. {ERR_PACK(0, 0, AFALG_R_SOCKET_CREATE_FAILED), "socket create failed"},
  28. {ERR_PACK(0, 0, AFALG_R_SOCKET_OPERATION_FAILED),
  29. "socket operation failed"},
  30. {ERR_PACK(0, 0, AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed"},
  31. {0, NULL}
  32. };
  33. #endif
  34. static int lib_code = 0;
  35. static int error_loaded = 0;
  36. static int ERR_load_AFALG_strings(void)
  37. {
  38. if (lib_code == 0)
  39. lib_code = ERR_get_next_error_library();
  40. if (!error_loaded) {
  41. #ifndef OPENSSL_NO_ERR
  42. ERR_load_strings(lib_code, AFALG_str_reasons);
  43. #endif
  44. error_loaded = 1;
  45. }
  46. return 1;
  47. }
  48. static void ERR_unload_AFALG_strings(void)
  49. {
  50. if (error_loaded) {
  51. #ifndef OPENSSL_NO_ERR
  52. ERR_unload_strings(lib_code, AFALG_str_reasons);
  53. #endif
  54. error_loaded = 0;
  55. }
  56. }
  57. static void ERR_AFALG_error(int function, int reason, const char *file, int line)
  58. {
  59. if (lib_code == 0)
  60. lib_code = ERR_get_next_error_library();
  61. ERR_raise(lib_code, reason);
  62. ERR_set_debug(file, line, NULL);
  63. }