NAME

Datastore - internal module to handle database access


SYNOPSIS

Datstore::init()

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:

@ret = Datastore::insert($data)

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.

@ret = Datastore::retrieve($key)

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.

@ret = Datastore::search($substring)

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.

@ret = Datastore::verify($start, $end)

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).

@ret = Datastore::offload($start, $end)

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).


DESCRIPTION

This module is for internal use in the HammerServer.


SEE ALSO

See further information on adding database back ends.


AUTHOR

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.