class PeerTestState extends Object
| Modifier and Type | Class and Description |
|---|---|
static class | PeerTestState.RoleRoles for peer testing scenarios. |
| Constructor and Description |
|---|
PeerTestState(PeerTestState.Role role,
PeerState bob,
boolean isIPv6,
long nonce,
long now)Create a new peer test state for the given role. |
| Modifier and Type | Method and Description |
|---|---|
PeerState2 | getAlice()Return Alice's PeerState2 (SSU2 only). |
SessionKey | getAliceCipherKey()Return Alice's cipher key. |
SessionKey | getAliceIntroKey()Return Alice's intro key. |
InetAddress | getAliceIP()If we are Alice, return the IP that Bob says we can be reached at. |
InetAddress | getAliceIPFromCharlie()Return Alice's IP as reported by Charlie. |
SessionKey | getAliceMACKey()Return Alice's MAC key. |
int | getAlicePort()If we are Alice, return the port that Bob says we can be reached at. |
int | getAlicePortFromCharlie()Return Alice's port as reported by Charlie. |
long | getBeginTime()Return the time when this test began. |
PeerState | getBob()Return Bob's PeerState. |
InetAddress | getBobIP()Return Bob's IP address. |
int | getBobPort()Return Bob's port. |
Hash | getCharlieHash()Return Charlie's Hash (SSU2 only). |
SessionKey | getCharlieIntroKey()Return Charlie's intro key. |
InetAddress | getCharlieIP()Return Charlie's IP address. |
int | getCharliePort()Return Charlie's port. |
long | getLastSendTime()Return the time we last sent a packet. |
long | getNonce()Return the test nonce identifier. |
PeerTestState.Role | getOurRole()Return our role in the peer test. |
List<Hash> | getPreviousCharlies()Return previous Charlie hashes (SSU2 only, Bob only). |
long | getReceiveAliceTime()Return the time we last received from Alice. |
long | getReceiveBobTime()Return the time we last received from Bob. |
long | getReceiveCharlieTime()Return the time we last received from Charlie. |
long | getSendAliceTime()Return when we last sent to Alice (SSU2 Bob only). |
long | getSendCharlieTime()Return when we last sent to Charlie (SSU2 Alice only). |
int | getStatus()Return the status code sent to Alice (SSU2 Bob only). |
byte[] | getTestData()Get the test data for retransmission. |
int | incrementPacketsRelayed()Increment and return the packets relayed count. |
boolean | isIPv6()Whether this is an IPv6 test. |
void | setAlice(InetAddress ip,
int port,
Hash hash)Set Alice's IP, port, and hash. |
void | setAlice(PeerState2 alice)Set Alice's PeerState2 (SSU2 only). |
void | setAliceIntroKey(SessionKey key)Set Alice's intro key. |
void | setAliceIPFromCharlie(InetAddress ip)Set Alice's IP as reported by Charlie. |
void | setAliceKeys(SessionKey ck,
SessionKey mk)Set Alice's cipher and MAC keys. |
void | setAlicePortFromCharlie(int alicePortFromCharlie)Set Alice's port as reported by Charlie. |
void | setCharlie(InetAddress ip,
int port,
Hash hash)Set Charlie's IP, port, and hash. |
void | setCharlieIntroKey(SessionKey key)Set Charlie's intro key. |
void | setCharliePort(int charliePort)Set Charlie's port. |
void | setLastSendTime(long when)Set the time we last sent a packet. |
void | setReceiveAliceTime(long when)Set the time we last received from Alice. |
void | setReceiveBobTime(long when)Set the time we last received from Bob. |
void | setReceiveCharlieTime(long when)Set the time we last received from Charlie. |
void | setSendAliceTime(long when)Set when we last sent to Alice (SSU2 Bob only). |
void | setSendCharlieTime(long when)Set when we last sent to Charlie (SSU2 Alice only). |
void | setStatus(int status)Set the status code sent to Alice (SSU2 Bob only). |
void | setTestData(byte[] data)Save the test data for retransmission. |
String | toString()toString. |
public PeerTestState(PeerTestState.Role role, PeerState bob, boolean isIPv6, long nonce, long now)
role - our role in the peer testbob - Bob's PeerState, or null if we are BobisIPv6 - whether this is an IPv6 testnonce - the test nonce identifiernow - the time when the test beginspublic PeerState2 getAlice()
public SessionKey getAliceCipherKey()
public SessionKey getAliceIntroKey()
public InetAddress getAliceIP()
public InetAddress getAliceIPFromCharlie()
public SessionKey getAliceMACKey()
public int getAlicePort()
public int getAlicePortFromCharlie()
public long getBeginTime()
public PeerState getBob()
public InetAddress getBobIP()
public int getBobPort()
public Hash getCharlieHash()
public SessionKey getCharlieIntroKey()
public InetAddress getCharlieIP()
public int getCharliePort()
public long getLastSendTime()
public long getNonce()
public PeerTestState.Role getOurRole()
public List<Hash> getPreviousCharlies()
public long getReceiveAliceTime()
public long getReceiveBobTime()
public long getReceiveCharlieTime()
public long getSendAliceTime()
public long getSendCharlieTime()
public int getStatus()
public byte[] getTestData()
public int incrementPacketsRelayed()
public boolean isIPv6()
public void setAlice(InetAddress ip, int port, Hash hash)
ip - Alice's IP addressport - Alice's porthash - Alice's Hash (SSU2 only), null for SSU1public void setAlice(PeerState2 alice)
alice - Alice's SSU2 statepublic void setAliceIntroKey(SessionKey key)
key - Alice's intro keypublic void setAliceIPFromCharlie(InetAddress ip)
ip - Alice's IP from Charlie's perspectivepublic void setAliceKeys(SessionKey ck, SessionKey mk)
ck - cipher keymk - MAC keypublic void setAlicePortFromCharlie(int alicePortFromCharlie)
alicePortFromCharlie - Alice's port from Charlie's perspectivepublic void setCharlie(InetAddress ip, int port, Hash hash)
ip - Charlie's IP addressport - Charlie's porthash - Charlie's Hash (SSU2 only), null for SSU1public void setCharlieIntroKey(SessionKey key)
key - Charlie's intro keypublic void setCharliePort(int charliePort)
charliePort - Charlie's port numberpublic void setLastSendTime(long when)
when - the last send timestamppublic void setReceiveAliceTime(long when)
when - the receive timestamppublic void setReceiveBobTime(long when)
when - the receive timestamppublic void setReceiveCharlieTime(long when)
when - the receive timestamppublic void setSendAliceTime(long when)
when - the send timestamppublic void setSendCharlieTime(long when)
when - the send timestamppublic void setStatus(int status)
status - the statuspublic void setTestData(byte[] data)
data - the test data