X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=onak-conf.h;h=0d937c23d3578db380935a3dc6f322074718add3;hb=2458360e75aa46091f60c16e041c07bffe2edefb;hp=eb3d91cb67d66903737492fa8f1f6af83f78306b;hpb=d38e1f468376f8b19b208f2da4d20cb2919875dd;p=onak.git diff --git a/onak-conf.h b/onak-conf.h index eb3d91c..0d937c2 100644 --- a/onak-conf.h +++ b/onak-conf.h @@ -23,6 +23,25 @@ #include "keydb.h" +/** + * @brief Backend database configuration. + * + */ +struct onak_db_config { + /** Name, as used to refer to individual backend instances */ + char *name; + /** Backend type [e.g. db4, pg, fs, file] */ + char *type; + /** Location information; directory for file backed, DB name for DBs */ + char *location; + /** Database backend hostname, if appropriate */ + char *hostname; + /** Database backend username, if appropriate */ + char *username; + /** Database backend password, if appropriate */ + char *password; +}; + /** * @brief Runtime configuration for onak. * @@ -48,25 +67,14 @@ struct onak_config { /** Set if we're using keyd as the backend. */ bool use_keyd; + /** The path to the directory the keyd socket lives in. */ + char *sock_dir; - /* - * Options for any database backend that needs a directory, be it the - * file, db2 or db3 options. - */ - /** The path to the directory containing the database files. */ - char *db_dir; - - /* - * Options for the Postgres backend. - */ - /** The host that Postgres is running on. */ - char *pg_dbhost; - /** The database name. */ - char *pg_dbname; - /** The user we should connect as. */ - char *pg_dbuser; - /** The password for the user. */ - char *pg_dbpass; + /** List of backend configurations */ + struct ll *backends; + + /* The default backend to use */ + struct onak_db_config *backend; /* * Options for the dynamic backend. @@ -76,8 +84,8 @@ struct onak_config { /** Directory where backend .so files can be found */ char *backends_dir; - /** Pointer to the function table for our loaded DB backend */ - struct dbfuncs *dbbackend; + /** Pointer to the initialisation function for our loaded DB backend */ + struct onak_dbctx *(*dbinit)(struct onak_db_config *, bool); /** Should we verify signature hashes match? */ bool check_sighash;