alfred: Guarantee monotonic times

The times returned by time(..) and gettimeofday(...) are not monotonic and
therefore the time can jump backwards or forwards. This can happen during after
a settime system call or when the local timezone was changed.

Jumps forward are not problematic and only cause early processing of some
data/more data in the network, but warping back in time can result in hangs and
publishing of outdated data.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
alfred: Send a tx end packet after data was pushed

The transaction for a transfer must be checked before the receiver can move the
data to the own data hash. The basic check will use the amount of data
transferred. The sender uses a txend packet including the necessary
information.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
alfred: Import the linux kernel list implementation

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
alfred: Only apply changes after txend status was received

A transaction has to be handled in a atomic way. Either the complete data was
received or it wasn't. The simplest method is to use a buffer to hold all
unconfirmed data instead of using a redo/undo log. All data in this transaction
buffer will be written after the transaction was confirmed or in case of an
failure just dropped.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>