xref: /freebsd/crypto/openssl/engines/e_afalg_err.c (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
1 /*
2  * Generated by util/mkerr.pl DO NOT EDIT
3  * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
4  *
5  * Licensed under the OpenSSL license (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 
11 #include <openssl/err.h>
12 #include "e_afalg_err.h"
13 
14 #ifndef OPENSSL_NO_ERR
15 
16 static ERR_STRING_DATA AFALG_str_functs[] = {
17     {ERR_PACK(0, AFALG_F_AFALG_CHK_PLATFORM, 0), "afalg_chk_platform"},
18     {ERR_PACK(0, AFALG_F_AFALG_CREATE_SK, 0), "afalg_create_sk"},
19     {ERR_PACK(0, AFALG_F_AFALG_INIT_AIO, 0), "afalg_init_aio"},
20     {ERR_PACK(0, AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION, 0),
21      "afalg_setup_async_event_notification"},
22     {ERR_PACK(0, AFALG_F_AFALG_SET_KEY, 0), "afalg_set_key"},
23     {ERR_PACK(0, AFALG_F_BIND_AFALG, 0), "bind_afalg"},
24     {0, NULL}
25 };
26 
27 static ERR_STRING_DATA AFALG_str_reasons[] = {
28     {ERR_PACK(0, 0, AFALG_R_EVENTFD_FAILED), "eventfd failed"},
29     {ERR_PACK(0, 0, AFALG_R_FAILED_TO_GET_PLATFORM_INFO),
30     "failed to get platform info"},
31     {ERR_PACK(0, 0, AFALG_R_INIT_FAILED), "init failed"},
32     {ERR_PACK(0, 0, AFALG_R_IO_SETUP_FAILED), "io setup failed"},
33     {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG),
34     "kernel does not support afalg"},
35     {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG),
36     "kernel does not support async afalg"},
37     {ERR_PACK(0, 0, AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed"},
38     {ERR_PACK(0, 0, AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed"},
39     {ERR_PACK(0, 0, AFALG_R_SOCKET_BIND_FAILED), "socket bind failed"},
40     {ERR_PACK(0, 0, AFALG_R_SOCKET_CREATE_FAILED), "socket create failed"},
41     {ERR_PACK(0, 0, AFALG_R_SOCKET_OPERATION_FAILED),
42     "socket operation failed"},
43     {ERR_PACK(0, 0, AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed"},
44     {0, NULL}
45 };
46 
47 #endif
48 
49 static int lib_code = 0;
50 static int error_loaded = 0;
51 
52 static int ERR_load_AFALG_strings(void)
53 {
54     if (lib_code == 0)
55         lib_code = ERR_get_next_error_library();
56 
57     if (!error_loaded) {
58 #ifndef OPENSSL_NO_ERR
59         ERR_load_strings(lib_code, AFALG_str_functs);
60         ERR_load_strings(lib_code, AFALG_str_reasons);
61 #endif
62         error_loaded = 1;
63     }
64     return 1;
65 }
66 
67 static void ERR_unload_AFALG_strings(void)
68 {
69     if (error_loaded) {
70 #ifndef OPENSSL_NO_ERR
71         ERR_unload_strings(lib_code, AFALG_str_functs);
72         ERR_unload_strings(lib_code, AFALG_str_reasons);
73 #endif
74         error_loaded = 0;
75     }
76 }
77 
78 static void ERR_AFALG_error(int function, int reason, char *file, int line)
79 {
80     if (lib_code == 0)
81         lib_code = ERR_get_next_error_library();
82     ERR_PUT_error(lib_code, function, reason, file, line);
83 }
84