Package net.i2p.router.transport.udp
Class PeerTestState
java.lang.Object
net.i2p.router.transport.udp.PeerTestState
Track the state of a peer test.
Used only by PeerTestManager.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPeerTestState
(PeerTestState.Role role, PeerState bob, boolean isIPv6, long nonce, long now) -
Method Summary
Modifier and TypeMethodDescriptiongetAlice()
SSU2 onlyIf 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 _aliceIPFromCharlieint
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
long
when did this test begin?getBob()
getBobIP()
int
int
long
when did we last send out a packet?long
getNonce()
Are we Alice, bob, or Charlie.long
when did we last hear from alice?long
when did we last hear from bob?long
when did we last hear from charlie?int
boolean
isIPv6()
Is this an IPv6 test?void
setAlice
(InetAddress ip, int port, Hash hash) void
setAlice
(PeerState2 alice) SSU2 onlyvoid
void
void
setAliceKeys
(SessionKey ck, SessionKey mk) void
setAlicePortFromCharlie
(int alicePortFromCharlie) void
setCharlie
(InetAddress ip, int port, Hash hash) void
void
setCharliePort
(int charliePort) void
setLastSendTime
(long when) void
setReceiveAliceTime
(long when) void
setReceiveBobTime
(long when) void
setReceiveCharlieTime
(long when) toString()
-
Constructor Details
-
PeerTestState
- Parameters:
bob
- null if role is BOB
-
-
Method Details
-
getNonce
public long getNonce() -
getOurRole
Are we Alice, bob, or Charlie. -
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
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
SSU2 only- Since:
- 0.9.54
-
setAlice
SSU2 only- Since:
- 0.9.54
-
setAlice
- Parameters:
hash
- SSU2 only, null for SSU1- Since:
- 0.9.54
-
getBobIP
-
getCharlieIP
-
setCharlie
- Parameters:
hash
- SSU2 only, null for SSU1- Since:
- 0.9.54
-
getAliceIPFromCharlie
-
setAliceIPFromCharlie
-
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
-
setAliceIntroKey
-
getAliceCipherKey
- Since:
- 0.9.52
-
getAliceMACKey
- Since:
- 0.9.52
-
setAliceKeys
- Parameters:
ck
- cipher keymk
- MAC key- Since:
- 0.9.52
-
getCharlieIntroKey
-
setCharlieIntroKey
-
getBobCipherKey
-
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) -
incrementPacketsRelayed
public int incrementPacketsRelayed()- Returns:
- new value
-
toString
-