]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/cmp_util.h
errors: update error message (to be squashed)
[thirdparty/openssl.git] / include / openssl / cmp_util.h
CommitLineData
7960dbec 1/*
a28d06f3 2 * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
7960dbec
DDO
3 * Copyright Nokia 2007-2019
4 * Copyright Siemens AG 2015-2019
5 *
6 * Licensed under the Apache License 2.0 (the "License"). You may not use
7 * this file except in compliance with the License. You can obtain a copy
8 * in the file LICENSE in the source distribution or at
9 * https://www.openssl.org/source/license.html
10 */
11
ae4186b0
DMSP
12#ifndef OPENSSL_CMP_UTIL_H
13# define OPENSSL_CMP_UTIL_H
d59068bd 14# pragma once
7960dbec
DDO
15
16# include <openssl/opensslconf.h>
17# ifndef OPENSSL_NO_CMP
18
19# include <openssl/macros.h>
20# include <openssl/trace.h>
7960dbec 21
ebf30069 22# ifdef __cplusplus
7960dbec
DDO
23extern "C" {
24# endif
25
7960dbec
DDO
26int OSSL_CMP_log_open(void);
27void OSSL_CMP_log_close(void);
28# define OSSL_CMP_LOG_PREFIX "CMP "
7960dbec
DDO
29
30/*
31 * generalized logging/error callback mirroring the severity levels of syslog.h
32 */
33typedef int OSSL_CMP_severity;
34# define OSSL_CMP_LOG_EMERG 0
35# define OSSL_CMP_LOG_ALERT 1
36# define OSSL_CMP_LOG_CRIT 2
37# define OSSL_CMP_LOG_ERR 3
38# define OSSL_CMP_LOG_WARNING 4
39# define OSSL_CMP_LOG_NOTICE 5
40# define OSSL_CMP_LOG_INFO 6
41# define OSSL_CMP_LOG_DEBUG 7
1a5ae1da
DDO
42# define OSSL_CMP_LOG_TRACE 8
43# define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE
7e765f46 44typedef int (*OSSL_CMP_log_cb_t)(const char *func, const char *file, int line,
7960dbec
DDO
45 OSSL_CMP_severity level, const char *msg);
46
235595c4 47int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file,
ebf30069 48 int line, OSSL_CMP_severity level, const char *msg);
7960dbec 49/* use of the logging callback for outputting error queue */
7e765f46 50void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn);
7960dbec 51
3dbc5156 52# ifdef __cplusplus
7960dbec 53}
3dbc5156 54# endif
62dcd2aa
DDO
55# endif /* !defined(OPENSSL_NO_CMP) */
56#endif /* !defined(OPENSSL_CMP_UTIL_H) */