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