Blame include/openssl/conf.h

Packit Service 084de1
/*
Packit Service 084de1
 * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit Service 084de1
 *
Packit Service 084de1
 * Licensed under the OpenSSL license (the "License").  You may not use
Packit Service 084de1
 * this file except in compliance with the License.  You can obtain a copy
Packit Service 084de1
 * in the file LICENSE in the source distribution or at
Packit Service 084de1
 * https://www.openssl.org/source/license.html
Packit Service 084de1
 */
Packit Service 084de1
Packit Service 084de1
#ifndef  HEADER_CONF_H
Packit Service 084de1
# define HEADER_CONF_H
Packit Service 084de1
Packit Service 084de1
# include <openssl/bio.h>
Packit Service 084de1
# include <openssl/lhash.h>
Packit Service 084de1
# include <openssl/safestack.h>
Packit Service 084de1
# include <openssl/e_os2.h>
Packit Service 084de1
# include <openssl/ossl_typ.h>
Packit Service 084de1
# include <openssl/conferr.h>
Packit Service 084de1
Packit Service 084de1
#ifdef  __cplusplus
Packit Service 084de1
extern "C" {
Packit Service 084de1
#endif
Packit Service 084de1
Packit Service 084de1
typedef struct {
Packit Service 084de1
    char *section;
Packit Service 084de1
    char *name;
Packit Service 084de1
    char *value;
Packit Service 084de1
} CONF_VALUE;
Packit Service 084de1
Packit Service 084de1
DEFINE_STACK_OF(CONF_VALUE)
Packit Service 084de1
DEFINE_LHASH_OF(CONF_VALUE);
Packit Service 084de1
Packit Service 084de1
struct conf_st;
Packit Service 084de1
struct conf_method_st;
Packit Service 084de1
typedef struct conf_method_st CONF_METHOD;
Packit Service 084de1
Packit Service 084de1
struct conf_method_st {
Packit Service 084de1
    const char *name;
Packit Service 084de1
    CONF *(*create) (CONF_METHOD *meth);
Packit Service 084de1
    int (*init) (CONF *conf);
Packit Service 084de1
    int (*destroy) (CONF *conf);
Packit Service 084de1
    int (*destroy_data) (CONF *conf);
Packit Service 084de1
    int (*load_bio) (CONF *conf, BIO *bp, long *eline);
Packit Service 084de1
    int (*dump) (const CONF *conf, BIO *bp);
Packit Service 084de1
    int (*is_number) (const CONF *conf, char c);
Packit Service 084de1
    int (*to_int) (const CONF *conf, char c);
Packit Service 084de1
    int (*load) (CONF *conf, const char *name, long *eline);
Packit Service 084de1
};
Packit Service 084de1
Packit Service 084de1
/* Module definitions */
Packit Service 084de1
Packit Service 084de1
typedef struct conf_imodule_st CONF_IMODULE;
Packit Service 084de1
typedef struct conf_module_st CONF_MODULE;
Packit Service 084de1
Packit Service 084de1
DEFINE_STACK_OF(CONF_MODULE)
Packit Service 084de1
DEFINE_STACK_OF(CONF_IMODULE)
Packit Service 084de1
Packit Service 084de1
/* DSO module function typedefs */
Packit Service 084de1
typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
Packit Service 084de1
typedef void conf_finish_func (CONF_IMODULE *md);
Packit Service 084de1
Packit Service 084de1
# define CONF_MFLAGS_IGNORE_ERRORS       0x1
Packit Service 084de1
# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2
Packit Service 084de1
# define CONF_MFLAGS_SILENT              0x4
Packit Service 084de1
# define CONF_MFLAGS_NO_DSO              0x8
Packit Service 084de1
# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
Packit Service 084de1
# define CONF_MFLAGS_DEFAULT_SECTION     0x20
Packit Service 084de1
Packit Service 084de1
int CONF_set_default_method(CONF_METHOD *meth);
Packit Service 084de1
void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);
Packit Service 084de1
LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,
Packit Service 084de1
                                long *eline);
Packit Service 084de1
# ifndef OPENSSL_NO_STDIO
Packit Service 084de1
LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,
Packit Service 084de1
                                   long *eline);
Packit Service 084de1
# endif
Packit Service 084de1
LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,
Packit Service 084de1
                                    long *eline);
Packit Service 084de1
STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,
Packit Service 084de1
                                       const char *section);
Packit Service 084de1
char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,
Packit Service 084de1
                      const char *name);
Packit Service 084de1
long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,
Packit Service 084de1
                     const char *name);
Packit Service 084de1
void CONF_free(LHASH_OF(CONF_VALUE) *conf);
Packit Service 084de1
#ifndef OPENSSL_NO_STDIO
Packit Service 084de1
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
Packit Service 084de1
#endif
Packit Service 084de1
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
Packit Service 084de1
Packit Service 084de1
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
Packit Service 084de1
Packit Service 084de1
#if OPENSSL_API_COMPAT < 0x10100000L
Packit Service 084de1
# define OPENSSL_no_config() \
Packit Service 084de1
    OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
Packit Service 084de1
#endif
Packit Service 084de1
Packit Service 084de1
/*
Packit Service 084de1
 * New conf code.  The semantics are different from the functions above. If
Packit Service 084de1
 * that wasn't the case, the above functions would have been replaced
Packit Service 084de1
 */
Packit Service 084de1
Packit Service 084de1
struct conf_st {
Packit Service 084de1
    CONF_METHOD *meth;
Packit Service 084de1
    void *meth_data;
Packit Service 084de1
    LHASH_OF(CONF_VALUE) *data;
Packit Service 084de1
};
Packit Service 084de1
Packit Service 084de1
CONF *NCONF_new(CONF_METHOD *meth);
Packit Service 084de1
CONF_METHOD *NCONF_default(void);
Packit Service 084de1
CONF_METHOD *NCONF_WIN32(void);
Packit Service 084de1
void NCONF_free(CONF *conf);
Packit Service 084de1
void NCONF_free_data(CONF *conf);
Packit Service 084de1
Packit Service 084de1
int NCONF_load(CONF *conf, const char *file, long *eline);
Packit Service 084de1
# ifndef OPENSSL_NO_STDIO
Packit Service 084de1
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
Packit Service 084de1
# endif
Packit Service 084de1
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
Packit Service 084de1
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
Packit Service 084de1
                                        const char *section);
Packit Service 084de1
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
Packit Service 084de1
int NCONF_get_number_e(const CONF *conf, const char *group, const char *name,
Packit Service 084de1
                       long *result);
Packit Service 084de1
#ifndef OPENSSL_NO_STDIO
Packit Service 084de1
int NCONF_dump_fp(const CONF *conf, FILE *out);
Packit Service 084de1
#endif
Packit Service 084de1
int NCONF_dump_bio(const CONF *conf, BIO *out);
Packit Service 084de1
Packit Service 084de1
#define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)
Packit Service 084de1
Packit Service 084de1
/* Module functions */
Packit Service 084de1
Packit Service 084de1
int CONF_modules_load(const CONF *cnf, const char *appname,
Packit Service 084de1
                      unsigned long flags);
Packit Service 084de1
int CONF_modules_load_file(const char *filename, const char *appname,
Packit Service 084de1
                           unsigned long flags);
Packit Service 084de1
void CONF_modules_unload(int all);
Packit Service 084de1
void CONF_modules_finish(void);
Packit Service 084de1
#if OPENSSL_API_COMPAT < 0x10100000L
Packit Service 084de1
# define CONF_modules_free() while(0) continue
Packit Service 084de1
#endif
Packit Service 084de1
int CONF_module_add(const char *name, conf_init_func *ifunc,
Packit Service 084de1
                    conf_finish_func *ffunc);
Packit Service 084de1
Packit Service 084de1
const char *CONF_imodule_get_name(const CONF_IMODULE *md);
Packit Service 084de1
const char *CONF_imodule_get_value(const CONF_IMODULE *md);
Packit Service 084de1
void *CONF_imodule_get_usr_data(const CONF_IMODULE *md);
Packit Service 084de1
void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);
Packit Service 084de1
CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);
Packit Service 084de1
unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);
Packit Service 084de1
void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);
Packit Service 084de1
void *CONF_module_get_usr_data(CONF_MODULE *pmod);
Packit Service 084de1
void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);
Packit Service 084de1
Packit Service 084de1
char *CONF_get1_default_config_file(void);
Packit Service 084de1
Packit Service 084de1
int CONF_parse_list(const char *list, int sep, int nospc,
Packit Service 084de1
                    int (*list_cb) (const char *elem, int len, void *usr),
Packit Service 084de1
                    void *arg);
Packit Service 084de1
Packit Service 084de1
void OPENSSL_load_builtin_modules(void);
Packit Service 084de1
Packit Service 084de1
Packit Service 084de1
# ifdef  __cplusplus
Packit Service 084de1
}
Packit Service 084de1
# endif
Packit Service 084de1
#endif