Updated transport constants and renamed some test classes.

This commit is contained in:
akwizgran
2012-01-17 14:56:30 +00:00
parent 9bd0b60dec
commit 8c0020873c
24 changed files with 181 additions and 178 deletions

View File

@@ -8,9 +8,9 @@ public interface Segment {
int getLength();
long getTransmissionNumber();
long getSegmentNumber();
void setLength(int length);
void setTransmissionNumber(int transmission);
void setSegmentNumber(long segmentNumber);
}

View File

@@ -2,19 +2,20 @@ package net.sf.briar.api.transport;
public interface TransportConstants {
/**
* The maximum length of a frame in bytes, including the header and footer.
*/
static final int MAX_FRAME_LENGTH = 65536; // 2^16, 64 KiB
/** The maximum length of a segment in bytes, including the tag. */
static final int MAX_SEGMENT_LENGTH = 65536; // 2^16, 64 KiB
/** The length of the segment tag in bytes. */
static final int TAG_LENGTH = 16;
/** The maximum length of a frame in bytes, including the header and MAC. */
static final int MAX_FRAME_LENGTH = MAX_SEGMENT_LENGTH - TAG_LENGTH;
/** The length of the frame header in bytes. */
static final int FRAME_HEADER_LENGTH = 8;
/**
* The length in bytes of the pseudo-random tag that uniquely identifies a
* connection.
*/
static final int TAG_LENGTH = 16;
/** The length of the MAC in bytes. */
static final int MAC_LENGTH = 32;
/**
* The minimum connection length in bytes that all transport plugins must