Update Debian Vcs-* fields to point to git repository
[onak.git] / onak-conf.h
1 /**
2  * @file onak-conf.h
3  * @brief Routines related to runtime config.
4  *
5  * Copyright 2002 Jonathan McDowell <noodles@earth.li>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; version 2 of the License.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 51
18  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef __ONAK_CONF_H_
22 #define __ONAK_CONF_H_
23
24 #include "keydb.h"
25
26 /**
27  * @brief Runtime configuration for onak.
28  *
29  * This structure holds various runtime configuration options for onak. It
30  * will eventually be populated from the config file.
31  */
32 struct onak_config {
33         /*
34          * Generic options.
35          */
36         /** The maximum number of keys a query should return. */
37         int maxkeys;
38         /** Our email address that servers sync with. */
39         char *thissite;
40         /** The email address of the server admin. */
41         char *adminemail;
42         /** The mta to invoke to send sync mails. */
43         char *mta;
44         /** List of email address for sites we sync with via email */
45         struct ll *syncsites;
46         /** A linked list of sites we sync with. */
47         char *logfile;
48
49         /** Set if we're using keyd as the backend. */
50         bool use_keyd;
51
52         /*
53          * Options for any database backend that needs a directory, be it the
54          * file, db2 or db3 options.
55          */
56         /** The path to the directory containing the database files. */
57         char *db_dir;
58         
59         /*
60          * Options for the Postgres backend.
61          */
62         /** The host that Postgres is running on. */
63         char *pg_dbhost;
64         /** The database name. */
65         char *pg_dbname;
66         /** The user we should connect as. */
67         char *pg_dbuser;
68         /** The password for the user. */
69         char *pg_dbpass;
70
71         /*
72          * Options for the dynamic backend.
73          */
74         /** Name of the DB backend we're using */
75         char *db_backend;
76         /** Directory where backend .so files can be found */
77         char *backends_dir;
78
79         /** Pointer to the function table for our loaded DB backend */
80         struct dbfuncs *dbbackend;
81
82         /** Should we verify signature hashes match? */
83         bool check_sighash;
84 };
85
86 /**
87  * @brief The variable containing our runtime config.
88  */
89 extern struct onak_config config;
90
91 /**
92  * @brief read the onak config.
93  * @param configfile the config file to read.
94  *
95  * Read in our config file. If config file is NULL read in the compile
96  * time default.
97  */
98 void readconfig(const char *configfile);
99
100 /**
101  * @brief clean up the config when we're shutting down.
102  */
103 void cleanupconfig(void);
104
105 #endif /* __ONAK_CONF_H_ */