conf.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * WARNING: do not edit!
  3. * Generated by Makefile from include/openssl/conf.h.in
  4. *
  5. * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License 2.0 (the "License"). You may not use
  8. * this file except in compliance with the License. You can obtain a copy
  9. * in the file LICENSE in the source distribution or at
  10. * https://www.openssl.org/source/license.html
  11. */
  12. #ifndef OPENSSL_CONF_H
  13. # define OPENSSL_CONF_H
  14. # pragma once
  15. # include <openssl/macros.h>
  16. # ifndef OPENSSL_NO_DEPRECATED_3_0
  17. # define HEADER_CONF_H
  18. # endif
  19. # include <openssl/bio.h>
  20. # include <openssl/lhash.h>
  21. # include <openssl/safestack.h>
  22. # include <openssl/e_os2.h>
  23. # include <openssl/types.h>
  24. # include <openssl/conferr.h>
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. typedef struct {
  29. char *section;
  30. char *name;
  31. char *value;
  32. } CONF_VALUE;
  33. SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE)
  34. #define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
  35. #define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
  36. #define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp)))
  37. #define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_null())
  38. #define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n)))
  39. #define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n))
  40. #define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
  41. #define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk))
  42. #define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i)))
  43. #define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
  44. #define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  45. #define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  46. #define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk)))
  47. #define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk)))
  48. #define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk),ossl_check_CONF_VALUE_freefunc_type(freefunc))
  49. #define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx))
  50. #define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr)))
  51. #define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  52. #define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
  53. #define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum)
  54. #define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk))
  55. #define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk))
  56. #define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk)))
  57. #define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc)))
  58. #define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp)))
  59. DEFINE_LHASH_OF_INTERNAL(CONF_VALUE);
  60. #define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)))
  61. #define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
  62. #define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh))
  63. #define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
  64. #define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  65. #define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
  66. #define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
  67. #define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh))
  68. #define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
  69. #define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
  70. #define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
  71. #define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh))
  72. #define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
  73. #define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
  74. struct conf_st;
  75. struct conf_method_st;
  76. typedef struct conf_method_st CONF_METHOD;
  77. # ifndef OPENSSL_NO_DEPRECATED_3_0
  78. # include <openssl/conftypes.h>
  79. # endif
  80. /* Module definitions */
  81. typedef struct conf_imodule_st CONF_IMODULE;
  82. typedef struct conf_module_st CONF_MODULE;
  83. STACK_OF(CONF_MODULE);
  84. STACK_OF(CONF_IMODULE);
  85. /* DSO module function typedefs */
  86. typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
  87. typedef void conf_finish_func (CONF_IMODULE *md);
  88. # define CONF_MFLAGS_IGNORE_ERRORS 0x1
  89. # define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
  90. # define CONF_MFLAGS_SILENT 0x4
  91. # define CONF_MFLAGS_NO_DSO 0x8
  92. # define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
  93. # define CONF_MFLAGS_DEFAULT_SECTION 0x20
  94. int CONF_set_default_method(CONF_METHOD *meth);
  95. void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
  96. LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
  97. long *eline);
  98. # ifndef OPENSSL_NO_STDIO
  99. LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
  100. long *eline);
  101. # endif
  102. LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
  103. long *eline);
  104. STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
  105. const char *section);
  106. char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
  107. const char *name);
  108. long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
  109. const char *name);
  110. void CONF_free(LHASH_OF(CONF_VALUE) *conf);
  111. #ifndef OPENSSL_NO_STDIO
  112. int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
  113. #endif
  114. int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
  115. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  116. OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
  117. #endif
  118. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  119. # define OPENSSL_no_config() \
  120. OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
  121. #endif
  122. /*
  123. * New conf code. The semantics are different from the functions above. If
  124. * that wasn't the case, the above functions would have been replaced
  125. */
  126. CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
  127. OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
  128. CONF *NCONF_new(CONF_METHOD *meth);
  129. CONF_METHOD *NCONF_default(void);
  130. #ifndef OPENSSL_NO_DEPRECATED_3_0
  131. OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
  132. #endif
  133. void NCONF_free(CONF *conf);
  134. void NCONF_free_data(CONF *conf);
  135. int NCONF_load(CONF *conf, const char *file, long *eline);
  136. # ifndef OPENSSL_NO_STDIO
  137. int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
  138. # endif
  139. int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
  140. STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
  141. STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
  142. const char *section);
  143. char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
  144. int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
  145. long *result);
  146. #ifndef OPENSSL_NO_STDIO
  147. int NCONF_dump_fp(const CONF *conf, FILE *out);
  148. #endif
  149. int NCONF_dump_bio(const CONF *conf, BIO *out);
  150. #define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
  151. /* Module functions */
  152. int CONF_modules_load(const CONF *cnf, const char *appname,
  153. unsigned long flags);
  154. int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
  155. const char *appname, unsigned long flags);
  156. int CONF_modules_load_file(const char *filename, const char *appname,
  157. unsigned long flags);
  158. void CONF_modules_unload(int all);
  159. void CONF_modules_finish(void);
  160. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  161. # define CONF_modules_free() while(0) continue
  162. #endif
  163. int CONF_module_add(const char *name, conf_init_func *ifunc,
  164. conf_finish_func *ffunc);
  165. const char *CONF_imodule_get_name(const CONF_IMODULE *md);
  166. const char *CONF_imodule_get_value(const CONF_IMODULE *md);
  167. void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
  168. void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
  169. CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
  170. unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
  171. void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
  172. void *CONF_module_get_usr_data(CONF_MODULE *pmod);
  173. void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
  174. char *CONF_get1_default_config_file(void);
  175. int CONF_parse_list(const char *list, int sep, int nospc,
  176. int (*list_cb) (const char *elem, int len, void *usr),
  177. void *arg);
  178. void OPENSSL_load_builtin_modules(void);
  179. # ifdef __cplusplus
  180. }
  181. # endif
  182. #endif