Package net.i2p.router.transport.udp
Class PeerTestState
- java.lang.Object
-
- net.i2p.router.transport.udp.PeerTestState
-
class PeerTestState extends Object
Track the state of a peer test. Used only by PeerTestManager.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PeerTestState.Role
-
Constructor Summary
Constructors Constructor Description PeerTestState(PeerTestState.Role role, PeerState bob, boolean isIPv6, long nonce, long now)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PeerState2
getAlice()
SSU2 onlySessionKey
getAliceCipherKey()
SessionKey
getAliceIntroKey()
InetAddress
getAliceIP()
If we are Alice, this will contain the IP that Bob says we can be reached at - the IP Charlie says we can be reached at is _aliceIPFromCharlieInetAddress
getAliceIPFromCharlie()
SessionKey
getAliceMACKey()
int
getAlicePort()
If we are Alice, this will contain the port that Bob says we can be reached at - the port Charlie says we can be reached at is _alicePortFromCharlieint
getAlicePortFromCharlie()
long
getBeginTime()
when did this test begin?PeerState
getBob()
SessionKey
getBobCipherKey()
InetAddress
getBobIP()
SessionKey
getBobMACKey()
int
getBobPort()
Hash
getCharlieHash()
SSU2 only, null for SSU1.SessionKey
getCharlieIntroKey()
InetAddress
getCharlieIP()
int
getCharliePort()
long
getLastSendTime()
when did we last send out a packet?long
getNonce()
PeerTestState.Role
getOurRole()
Are we Alice, bob, or Charlie.List<Hash>
getPreviousCharlies()
SSU2 only, BOB only, else returns null.long
getReceiveAliceTime()
when did we last hear from alice?long
getReceiveBobTime()
when did we last hear from bob?long
getReceiveCharlieTime()
when did we last hear from charlie?long
getSendAliceTime()
when did we send to alice, SSU2 Bob onlylong
getSendCharlieTime()
when did we send to Charlie, SSU2 Alice onlyint
getStatus()
what code did we send to alice, SSU2 Bob onlybyte[]
getTestData()
Get for retransmission.int
incrementPacketsRelayed()
boolean
isIPv6()
Is this an IPv6 test?void
setAlice(InetAddress ip, int port, Hash hash)
void
setAlice(PeerState2 alice)
SSU2 onlyvoid
setAliceIntroKey(SessionKey key)
void
setAliceIPFromCharlie(InetAddress ip)
void
setAliceKeys(SessionKey ck, SessionKey mk)
void
setAlicePortFromCharlie(int alicePortFromCharlie)
void
setCharlie(InetAddress ip, int port, Hash hash)
void
setCharlieIntroKey(SessionKey key)
void
setCharliePort(int charliePort)
void
setLastSendTime(long when)
void
setReceiveAliceTime(long when)
void
setReceiveBobTime(long when)
void
setReceiveCharlieTime(long when)
void
setSendAliceTime(long when)
when did we send to alice, SSU2 Bob onlyvoid
setSendCharlieTime(long when)
when did we send to Charlie, SSU2 Alice onlyvoid
setStatus(int status)
what code did we send to alice, SSU2 Bob onlyvoid
setTestData(byte[] data)
Save for retransmission.String
toString()
-
-
-
Constructor Detail
-
PeerTestState
public PeerTestState(PeerTestState.Role role, PeerState bob, boolean isIPv6, long nonce, long now)
- Parameters:
bob
- null if role is BOB
-
-
Method Detail
-
getNonce
public long getNonce()
-
getOurRole
public PeerTestState.Role getOurRole()
Are we Alice, bob, or Charlie.
-
getBob
public PeerState getBob()
- Returns:
- null if we are bob
- Since:
- 0.9.54
-
isIPv6
public boolean isIPv6()
Is this an IPv6 test?- Since:
- 0.9.27
-
getAliceIP
public InetAddress getAliceIP()
If we are Alice, this will contain the IP that Bob says we can be reached at - the IP Charlie says we can be reached at is _aliceIPFromCharlie
-
getAlice
public PeerState2 getAlice()
SSU2 only- Since:
- 0.9.54
-
setAlice
public void setAlice(PeerState2 alice)
SSU2 only- Since:
- 0.9.54
-
setAlice
public void setAlice(InetAddress ip, int port, Hash hash)
- Parameters:
hash
- SSU2 only, null for SSU1- Since:
- 0.9.54
-
getBobIP
public InetAddress getBobIP()
-
getCharlieIP
public InetAddress getCharlieIP()
-
getCharlieHash
public Hash getCharlieHash()
SSU2 only, null for SSU1.- Since:
- 0.9.57
-
setCharlie
public void setCharlie(InetAddress ip, int port, Hash hash)
- Parameters:
hash
- SSU2 only, null for SSU1- Since:
- 0.9.54
-
getPreviousCharlies
public List<Hash> getPreviousCharlies()
SSU2 only, BOB only, else returns null. Does not include current charlie.- Since:
- 0.9.57
-
getAliceIPFromCharlie
public InetAddress getAliceIPFromCharlie()
-
setAliceIPFromCharlie
public void setAliceIPFromCharlie(InetAddress ip)
-
getAlicePort
public int getAlicePort()
If we are Alice, this will contain the port that Bob says we can be reached at - the port Charlie says we can be reached at is _alicePortFromCharlie
-
getBobPort
public int getBobPort()
-
getCharliePort
public int getCharliePort()
-
setCharliePort
public void setCharliePort(int charliePort)
-
getAlicePortFromCharlie
public int getAlicePortFromCharlie()
-
setAlicePortFromCharlie
public void setAlicePortFromCharlie(int alicePortFromCharlie)
-
getAliceIntroKey
public SessionKey getAliceIntroKey()
-
setAliceIntroKey
public void setAliceIntroKey(SessionKey key)
-
getAliceCipherKey
public SessionKey getAliceCipherKey()
- Since:
- 0.9.52
-
getAliceMACKey
public SessionKey getAliceMACKey()
- Since:
- 0.9.52
-
setAliceKeys
public void setAliceKeys(SessionKey ck, SessionKey mk)
- Parameters:
ck
- cipher keymk
- MAC key- Since:
- 0.9.52
-
getCharlieIntroKey
public SessionKey getCharlieIntroKey()
-
setCharlieIntroKey
public void setCharlieIntroKey(SessionKey key)
-
getBobCipherKey
public SessionKey getBobCipherKey()
-
getBobMACKey
public SessionKey getBobMACKey()
-
getBeginTime
public long getBeginTime()
when did this test begin?
-
getLastSendTime
public long getLastSendTime()
when did we last send out a packet?
-
setLastSendTime
public void setLastSendTime(long when)
-
getReceiveAliceTime
public long getReceiveAliceTime()
when did we last hear from alice?
-
setReceiveAliceTime
public void setReceiveAliceTime(long when)
-
getReceiveBobTime
public long getReceiveBobTime()
when did we last hear from bob?
-
setReceiveBobTime
public void setReceiveBobTime(long when)
-
getReceiveCharlieTime
public long getReceiveCharlieTime()
when did we last hear from charlie?
-
setReceiveCharlieTime
public void setReceiveCharlieTime(long when)
-
getSendAliceTime
public long getSendAliceTime()
when did we send to alice, SSU2 Bob only- Since:
- 0.9.57
-
setSendAliceTime
public void setSendAliceTime(long when)
when did we send to alice, SSU2 Bob only- Since:
- 0.9.57
-
getSendCharlieTime
public long getSendCharlieTime()
when did we send to Charlie, SSU2 Alice only- Since:
- 0.9.57
-
setSendCharlieTime
public void setSendCharlieTime(long when)
when did we send to Charlie, SSU2 Alice only- Since:
- 0.9.57
-
getStatus
public int getStatus()
what code did we send to alice, SSU2 Bob only- Since:
- 0.9.57
-
setStatus
public void setStatus(int status)
what code did we send to alice, SSU2 Bob only- Since:
- 0.9.57
-
getTestData
public byte[] getTestData()
Get for retransmission. SSU2 only, we are Alice, Bob or Charlie- Since:
- 0.9.57
-
setTestData
public void setTestData(byte[] data)
Save for retransmission. SSU2 only, we are Alice, Bob or Charlie- Since:
- 0.9.57
-
incrementPacketsRelayed
public int incrementPacketsRelayed()
- Returns:
- new value
-
-