ca394edb7b8d1065c4eaaaa1c2ea207c49fe2d0f
[openssl.git] / engines / afalg / e_afalg_err.c
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 /*
11  * NOTE: this file was auto generated by the mkerr.pl script: any changes
12  * made to it will be overwritten when the script next updates this file,
13  * only reason strings will be preserved.
14  */
15
16 #include <stdio.h>
17 #include <openssl/err.h>
18 #include "e_afalg_err.h"
19
20 /* BEGIN ERROR CODES */
21 #ifndef OPENSSL_NO_ERR
22
23 # define ERR_FUNC(func) ERR_PACK(0,func,0)
24 # define ERR_REASON(reason) ERR_PACK(0,0,reason)
25
26 static ERR_STRING_DATA AFALG_str_functs[] = {
27     {ERR_FUNC(AFALG_F_AFALG_CHK_PLATFORM), "afalg_chk_platform"},
28     {ERR_FUNC(AFALG_F_AFALG_CREATE_BIND_SK), "afalg_create_bind_sk"},
29     {ERR_FUNC(AFALG_F_AFALG_CREATE_BIND_SOCKET), "afalg_create_bind_sk"},
30     {ERR_FUNC(AFALG_F_AFALG_CREATE_SK), "afalg_create_sk"},
31     {ERR_FUNC(AFALG_F_AFALG_INIT_AIO), "afalg_init_aio"},
32     {ERR_FUNC(AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION),
33      "afalg_setup_async_event_notification"},
34     {ERR_FUNC(AFALG_F_AFALG_SET_KEY), "afalg_set_key"},
35     {ERR_FUNC(AFALG_F_AFALG_SOCKET), "afalg_socket"},
36     {ERR_FUNC(AFALG_F_AFALG_START_CIPHER_SK), "afalg_start_cipher_sk"},
37     {ERR_FUNC(AFALG_F_BIND_AFALG), "bind_afalg"},
38     {0, NULL}
39 };
40
41 static ERR_STRING_DATA AFALG_str_reasons[] = {
42     {ERR_REASON(AFALG_R_EVENTFD_FAILED), "eventfd failed"},
43     {ERR_REASON(AFALG_R_FAILED_TO_GET_PLATFORM_INFO),
44      "failed to get platform info"},
45     {ERR_REASON(AFALG_R_INIT_FAILED), "init failed"},
46     {ERR_REASON(AFALG_R_IO_SETUP_FAILED), "io setup failed"},
47     {ERR_REASON(AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG),
48      "kernel does not support afalg"},
49     {ERR_REASON(AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG),
50      "kernel does not support async afalg"},
51     {ERR_REASON(AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed"},
52     {ERR_REASON(AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed"},
53     {ERR_REASON(AFALG_R_SOCKET_BIND_FAILED), "socket bind failed"},
54     {ERR_REASON(AFALG_R_SOCKET_CREATE_FAILED), "socket create failed"},
55     {ERR_REASON(AFALG_R_SOCKET_OPERATION_FAILED), "socket operation failed"},
56     {ERR_REASON(AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed"},
57     {0, NULL}
58 };
59
60 #endif
61
62 #ifdef AFALG_LIB_NAME
63 static ERR_STRING_DATA AFALG_lib_name[] = {
64     {0, AFALG_LIB_NAME},
65     {0, NULL}
66 };
67 #endif
68
69 static int AFALG_lib_error_code = 0;
70 static int AFALG_error_init = 1;
71
72 void ERR_load_AFALG_strings(void)
73 {
74     if (AFALG_lib_error_code == 0)
75         AFALG_lib_error_code = ERR_get_next_error_library();
76
77     if (AFALG_error_init) {
78         AFALG_error_init = 0;
79 #ifndef OPENSSL_NO_ERR
80         ERR_load_strings(AFALG_lib_error_code, AFALG_str_functs);
81         ERR_load_strings(AFALG_lib_error_code, AFALG_str_reasons);
82 #endif
83
84 #ifdef AFALG_LIB_NAME
85         AFALG_lib_name->error = ERR_PACK(AFALG_lib_error_code, 0, 0);
86         ERR_load_strings(0, AFALG_lib_name);
87 #endif
88     }
89 }
90
91 void ERR_unload_AFALG_strings(void)
92 {
93     if (AFALG_error_init == 0) {
94 #ifndef OPENSSL_NO_ERR
95         ERR_unload_strings(AFALG_lib_error_code, AFALG_str_functs);
96         ERR_unload_strings(AFALG_lib_error_code, AFALG_str_reasons);
97 #endif
98
99 #ifdef AFALG_LIB_NAME
100         ERR_unload_strings(0, AFALG_lib_name);
101 #endif
102         AFALG_error_init = 1;
103     }
104 }
105
106 void ERR_AFALG_error(int function, int reason, char *file, int line)
107 {
108     if (AFALG_lib_error_code == 0)
109         AFALG_lib_error_code = ERR_get_next_error_library();
110     ERR_PUT_error(AFALG_lib_error_code, function, reason, file, line);
111 }