source: asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/logging.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 3.2 KB
Line 
1/* logging.h
2 *
3 * Copyright (C) 2006-2017 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL.
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20 */
21
22
23/* submitted by eof */
24
25
26#ifndef WOLFSSL_LOGGING_H
27#define WOLFSSL_LOGGING_H
28
29#include <wolfssl/wolfcrypt/types.h>
30
31#ifdef __cplusplus
32 extern "C" {
33#endif
34
35
36enum CYA_Log_Levels {
37 ERROR_LOG = 0,
38 INFO_LOG,
39 ENTER_LOG,
40 LEAVE_LOG,
41 OTHER_LOG
42};
43
44typedef void (*wolfSSL_Logging_cb)(const int logLevel,
45 const char *const logMessage);
46
47WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
48
49#if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
50 WOLFSSL_LOCAL int wc_LoggingInit(void);
51 WOLFSSL_LOCAL int wc_LoggingCleanup(void);
52 WOLFSSL_LOCAL int wc_AddErrorNode(int error, int line, char* buf,
53 char* file);
54 WOLFSSL_LOCAL int wc_PeekErrorNode(int index, const char **file,
55 const char **reason, int *line);
56 WOLFSSL_LOCAL void wc_RemoveErrorNode(int index);
57 WOLFSSL_LOCAL void wc_ClearErrorNodes(void);
58 WOLFSSL_API int wc_SetLoggingHeap(void* h);
59 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
60 WOLFSSL_API void wc_ERR_print_errors_fp(FILE* fp);
61 #endif
62#endif /* defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE) */
63
64#ifdef DEBUG_WOLFSSL
65 #if defined(_WIN32)
66 #if defined(INTIME_RTOS)
67 #define __func__ NULL
68 #else
69 #define __func__ __FUNCTION__
70 #endif
71 #endif
72
73 /* a is prepended to m and b is appended, creating a log msg a + m + b */
74 #define WOLFSSL_LOG_CAT(a, m, b) #a " " m " " #b
75
76 void WOLFSSL_ENTER(const char* msg);
77 void WOLFSSL_LEAVE(const char* msg, int ret);
78 #define WOLFSSL_STUB(m) \
79 WOLFSSL_MSG(WOLFSSL_LOG_CAT(wolfSSL Stub, m, not implemented))
80
81 void WOLFSSL_MSG(const char* msg);
82 void WOLFSSL_BUFFER(const byte* buffer, word32 length);
83
84#else /* DEBUG_WOLFSSL */
85
86 #define WOLFSSL_ENTER(m)
87 #define WOLFSSL_LEAVE(m, r)
88 #define WOLFSSL_STUB(m)
89
90 #define WOLFSSL_MSG(m)
91 #define WOLFSSL_BUFFER(b, l)
92
93#endif /* DEBUG_WOLFSSL */
94
95#if (defined(DEBUG_WOLFSSL) || defined(WOLFSSL_NGINX)) || defined(WOLFSSL_HAPROXY)
96 #if (defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE))
97 void WOLFSSL_ERROR_LINE(int err, const char* func, unsigned int line,
98 const char* file, void* ctx);
99 #define WOLFSSL_ERROR(x) WOLFSSL_ERROR_LINE((x), __func__, __LINE__, __FILE__,NULL)
100 #else
101 void WOLFSSL_ERROR(int);
102 #endif
103#else
104 #define WOLFSSL_ERROR(e)
105#endif
106
107#ifdef __cplusplus
108}
109#endif
110#endif /* WOLFSSL_LOGGING_H */
111
Note: See TracBrowser for help on using the repository browser.