From 339656a35441a5d7d02282e6a5c6cdfeaf0571d6 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 1 May 2014 18:02:31 +0200 Subject: Move some records out of public header file. Improve db initialisation some. Wait for mnesia tables in init() and make the init-functions do some more. --- include/plop.hrl | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/plop.hrl b/include/plop.hrl index 5492024..30a5385 100644 --- a/include/plop.hrl +++ b/include/plop.hrl @@ -6,14 +6,9 @@ -type entry_type() :: x509 | precert | test. % uint16 -type leaf_type() :: timestamped_entry | test. % uint8 -%% @doc What's stored in the database. --record(plop, { - index :: non_neg_integer(), % Primary key. - hash :: binary(), % SHA-256 over #FIXME.entry. Indexed in db. - spt :: binary() % serialise(#spt_on_wire{}) - }). - -%% @doc Merkle Tree Leaf -- input to hash function for leaf hashes. +%% @doc Merkle Tree Leaf -- what's sent as 'leaf_input' in response to +%% get-entries requests and also the input to the hash function for +%% leaf hashes in the tree. RFC 6962 sect 3.4. -record(mtl, { version = 1 :: pos_integer(), leaf_type = timestamped_entry :: leaf_type(), @@ -21,14 +16,6 @@ }). -type mtl() :: #mtl{}. -%% @doc Parts of what goes in an SPT. Used for FIXME. -%% -record(spt, { -%% version = 1 :: pos_integer(), -%% signature_type :: signature_type(), -%% entry :: timestamped_entry() -%% }). -%%-type spt() :: #spt{}. - -record(spt_on_wire, { version :: pos_integer(), % uint8 logid :: binary(), % SHA-256 over DER encoded public log key @@ -48,14 +35,6 @@ }). -type spt_signed() :: #spt_signed{}. -%% Internal representation of a data entry. --record(timestamped_entry, { - timestamp = now :: now | integer(), - entry_type :: entry_type(), - entry :: binary() - }). --type timestamped_entry() :: #timestamped_entry{}. - %% %% Part of interface to plop:add/1. %% -record(plop_entry, { %% type :: entry_type(), @@ -63,6 +42,13 @@ %% }). %% -type plop_entry() :: #plop_entry{}. +%% A data entry. +-record(timestamped_entry, { + timestamp = now :: now | integer(), + entry_type :: entry_type(), + entry :: binary() + }). +-type timestamped_entry() :: #timestamped_entry{}. %% @doc The parts of an STH which is to be signed. Used as the %% interface to plop:sth/1, for testing. Should probably be internal -- cgit v1.1