From b57d9f2f7e694482749dfd3e8674d3af79d10773 Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 23 Feb 2022 11:57:03 -0500 Subject: [PATCH] SSU: More prep of classes for SSU2 extension --- .../transport/udp/InboundEstablishState.java | 30 +++++++++---------- .../transport/udp/OutboundEstablishState.java | 20 ++++++------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java b/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java index 94fdea2d4..afc9b78d8 100644 --- a/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java +++ b/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java @@ -28,8 +28,8 @@ import net.i2p.util.Log; * TODO do all these methods need to be synchronized? */ class InboundEstablishState { - private final RouterContext _context; - private final Log _log; + protected final RouterContext _context; + protected final Log _log; // SessionRequest message private byte _receivedX[]; private byte _bobIP[]; @@ -37,9 +37,9 @@ class InboundEstablishState { private final DHSessionKeyBuilder _keyBuilder; // SessionCreated message private byte _sentY[]; - private final byte _aliceIP[]; - private final int _alicePort; - private long _sentRelayTag; + protected final byte _aliceIP[]; + protected final int _alicePort; + protected long _sentRelayTag; private long _sentSignedOnTime; private SessionKey _sessionKey; private SessionKey _macKey; @@ -56,17 +56,17 @@ class InboundEstablishState { // general status private final long _establishBegin; //private long _lastReceive; - private long _lastSend; - private long _nextSend; + protected long _lastSend; + protected long _nextSend; private final RemoteHostId _remoteHostId; - private InboundState _currentState; + protected InboundState _currentState; private final Queue _queuedMessages; // count for backoff - private int _createdSentCount; + protected int _createdSentCount; // default true - private boolean _introductionRequested = true; + protected boolean _introductionRequested = true; - private int _rtt; + protected int _rtt; public enum InboundState { /** nothin known yet */ @@ -106,10 +106,10 @@ class InboundEstablishState { * Transmissions at 0, 3, 9 sec * Previously: 1500 (0, 1.5, 4.5, 10.5) */ - private static final long RETRANSMIT_DELAY = 3000; + protected static final long RETRANSMIT_DELAY = 3000; /** max delay including backoff */ - private static final long MAX_DELAY = 15*1000; + protected static final long MAX_DELAY = 15*1000; /** * @param localPort Must be our external port, otherwise the signature of the @@ -411,7 +411,7 @@ class InboundEstablishState { * Have we fully received the SessionConfirmed messages from Alice? * Caller must synch on this. */ - private boolean confirmedFullyReceived() { + protected boolean confirmedFullyReceived() { if (_receivedIdentity != null) { for (int i = 0; i < _receivedIdentity.length; i++) { if (_receivedIdentity[i] == null) @@ -535,7 +535,7 @@ class InboundEstablishState { /** * Call from synchronized method only */ - private void packetReceived() { + protected void packetReceived() { _nextSend = _context.clock().now(); } diff --git a/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java b/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java index 7324ffbee..698e5b88d 100644 --- a/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java +++ b/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java @@ -25,12 +25,12 @@ import net.i2p.util.Log; * */ class OutboundEstablishState { - private final RouterContext _context; - private final Log _log; + protected final RouterContext _context; + protected final Log _log; // SessionRequest message private byte _sentX[]; - private byte _bobIP[]; - private int _bobPort; + protected byte _bobIP[]; + protected int _bobPort; private final DHSessionKeyBuilder.Factory _keyFactory; private DHSessionKeyBuilder _keyBuilder; // SessionCreated message @@ -53,14 +53,14 @@ class OutboundEstablishState { //private long _lastReceive; private long _lastSend; private long _nextSend; - private RemoteHostId _remoteHostId; + protected RemoteHostId _remoteHostId; private final RemoteHostId _claimedAddress; private final RouterIdentity _remotePeer; private final boolean _allowExtendedOptions; private final boolean _needIntroduction; private final SessionKey _introKey; private final Queue _queuedMessages; - private OutboundState _currentState; + protected OutboundState _currentState; private long _introductionNonce; private boolean _isFirstMessageOurDSM; // intro @@ -68,13 +68,13 @@ class OutboundEstablishState { private boolean _complete; // counts for backoff private int _confirmedSentCount; - private int _requestSentCount; + protected int _requestSentCount; private int _introSentCount; // Times for timeout private long _confirmedSentTime; - private long _requestSentTime; + protected long _requestSentTime; private long _introSentTime; - private int _rtt; + protected int _rtt; public enum OutboundState { /** nothin sent yet */ @@ -754,7 +754,7 @@ class OutboundEstablishState { /** * Call from synchronized method only */ - private void packetReceived() { + protected void packetReceived() { _nextSend = _context.clock().now(); //if (_log.shouldLog(Log.DEBUG)) // _log.debug("Got a packet, nextSend == now");