You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmp_util.h 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
  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. #ifndef OPENSSL_CMP_UTIL_H
  12. #define OPENSSL_CMP_UTIL_H
  13. #pragma once
  14. #include <openssl/opensslconf.h>
  15. #ifndef OPENSSL_NO_CMP
  16. #include <openssl/macros.h>
  17. #include <openssl/trace.h>
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. int OSSL_CMP_log_open(void);
  23. void OSSL_CMP_log_close(void);
  24. #define OSSL_CMP_LOG_PREFIX "CMP "
  25. /*
  26. * generalized logging/error callback mirroring the severity levels of syslog.h
  27. */
  28. typedef int OSSL_CMP_severity;
  29. #define OSSL_CMP_LOG_EMERG 0
  30. #define OSSL_CMP_LOG_ALERT 1
  31. #define OSSL_CMP_LOG_CRIT 2
  32. #define OSSL_CMP_LOG_ERR 3
  33. #define OSSL_CMP_LOG_WARNING 4
  34. #define OSSL_CMP_LOG_NOTICE 5
  35. #define OSSL_CMP_LOG_INFO 6
  36. #define OSSL_CMP_LOG_DEBUG 7
  37. #define OSSL_CMP_LOG_TRACE 8
  38. #define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE
  39. typedef int (*OSSL_CMP_log_cb_t)(const char* func, const char* file, int line, OSSL_CMP_severity level, const char* msg);
  40. int OSSL_CMP_print_to_bio(BIO* bio, const char* component, const char* file, int line, OSSL_CMP_severity level, const char* msg);
  41. /* use of the logging callback for outputting error queue */
  42. void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn);
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif /* !defined(OPENSSL_NO_CMP) */
  47. #endif /* !defined(OPENSSL_CMP_UTIL_H) */