Datastore - internal module to handle database access
Initializes, expects the configuration value db. Depending on this value, sub-modules are used to instantiate the actual back end. Currently the following back ends are defined:
dbi:Pg:dbname=database This defines a DBI-accessed Postgresql database. Two further configuration values dbuser and dbpass are required.
file:filename This defines flat file usage. A helpfile filename.idx will also be used, for indexing, and a lock file filename.lock to prevent concurrency issues.
couchdb:dbname:uri This defines a CouchDB back end. The parameter dbname is the database on the CouchDB server. The parameter uri is the URI at which the server can be reached.
Inserts data into the tamper-resistant log. The return value is an array with one array reference. The reference holds the stamp and the key of the insertion.
Verifies and retrieves the data at the key. The return value is an array with one array reference. The reference holds the stamp and the data at the key.
Searches the log for the substring and returns an array of array references. Each reference holds the stamp, the key, and the data. Entries are not verified during search.
Verifies all entries between the timestamps start and end. The return value is an array of array references. Each reference holds a stamp, a key, and the verification outcome (0/1).
Offloads entries between the timestamps start and end. The return value is an array of array references. Each reference holds a stamp and a key. The data are offloaded onto a flat file in the directory offload/. The file is named ``stamp1-stamp2'' (the stamps are the timestamps of the first and last offloaded entry). Each line in the file represents one offloaded entry, and has the following tab-separated values: id, key, data, stamp, hash, previous-id, signature. The data field is enclosed in double quotes. In all fields, newline characters are replaced with \n (so that the record forms one textline).
This module is for internal use in the HammerServer.
See further information on adding database back ends.
The tamper-resistant server, all used modules, and the documentation were written by Karel Kubat / karel@e-tunity.com. Copyright (c) 2009 ff. Distributed under GPLV3.