forked from I2P_Developers/i2p.i2p
javadoc fixes part 5 (ticket #1894)
This commit is contained in:
@ -62,7 +62,7 @@ import net.i2p.util.SystemVersion;
|
|||||||
* http://www.itl.nist.gov/div897/pubs/fip180-1.htm</a></li>
|
* http://www.itl.nist.gov/div897/pubs/fip180-1.htm</a></li>
|
||||||
* <li> Bruce Schneier, "Section 18.7 Secure Hash Algorithm (SHA)",
|
* <li> Bruce Schneier, "Section 18.7 Secure Hash Algorithm (SHA)",
|
||||||
* <cite>Applied Cryptography, 2nd edition</cite>, <br>
|
* <cite>Applied Cryptography, 2nd edition</cite>, <br>
|
||||||
* John Wiley & Sons, 1996</li>
|
* John Wiley & Sons, 1996</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
*/
|
*/
|
||||||
public final class SHA1 extends MessageDigest implements Cloneable {
|
public final class SHA1 extends MessageDigest implements Cloneable {
|
||||||
|
@ -34,7 +34,7 @@ import net.i2p.util.ConcurrentHashSet;
|
|||||||
* The keys are kept in a Set and are NOT sorted by last-seen.
|
* The keys are kept in a Set and are NOT sorted by last-seen.
|
||||||
* Per-key last-seen-time, failures, etc. must be tracked elsewhere.
|
* Per-key last-seen-time, failures, etc. must be tracked elsewhere.
|
||||||
*
|
*
|
||||||
* If this bucket is full (i.e. begin == end && size == max)
|
* If this bucket is full (i.e. begin == end && size == max)
|
||||||
* then add() will call KBucketTrimmer.trim() do
|
* then add() will call KBucketTrimmer.trim() do
|
||||||
* (possibly) remove older entries, and indicate whether
|
* (possibly) remove older entries, and indicate whether
|
||||||
* to add the new entry. If the trimmer returns true without
|
* to add the new entry. If the trimmer returns true without
|
||||||
|
@ -337,7 +337,7 @@ public class BlockFile implements Closeable {
|
|||||||
/**
|
/**
|
||||||
* Go to any page but the superblock.
|
* Go to any page but the superblock.
|
||||||
* Page 1 is the superblock, must use file.seek(0) to get there.
|
* Page 1 is the superblock, must use file.seek(0) to get there.
|
||||||
* @param page >= 2
|
* @param page >= 2
|
||||||
*/
|
*/
|
||||||
public static void pageSeek(RandomAccessInterface file, int page) throws IOException {
|
public static void pageSeek(RandomAccessInterface file, int page) throws IOException {
|
||||||
if (page < METAINDEX_PAGE)
|
if (page < METAINDEX_PAGE)
|
||||||
|
@ -221,6 +221,7 @@ public class BSkipList<K extends Comparable<? super K>, V> extends SkipList<K, V
|
|||||||
}
|
}
|
||||||
****/
|
****/
|
||||||
|
|
||||||
|
/** find */
|
||||||
@Override
|
@Override
|
||||||
public SkipIterator<K, V> find(K key) {
|
public SkipIterator<K, V> find(K key) {
|
||||||
if (!this.fileOnly)
|
if (!this.fileOnly)
|
||||||
|
@ -38,8 +38,8 @@ public interface I2NPMessage extends DataStructure {
|
|||||||
* Unused - All transports provide encapsulation and so we have byte arrays available.
|
* Unused - All transports provide encapsulation and so we have byte arrays available.
|
||||||
*
|
*
|
||||||
* @param in stream to read from
|
* @param in stream to read from
|
||||||
* starting at type if type is < 0 (16 byte header)
|
* starting at type if type is < 0 (16 byte header)
|
||||||
* starting at ID if type is >= 0 (15 byte header)
|
* starting at ID if type is >= 0 (15 byte header)
|
||||||
* @param type I2NP message type. If less than zero, read the type from data
|
* @param type I2NP message type. If less than zero, read the type from data
|
||||||
* @param buffer scratch buffer to be used when reading and parsing
|
* @param buffer scratch buffer to be used when reading and parsing
|
||||||
* @return size of the message read (including headers)
|
* @return size of the message read (including headers)
|
||||||
@ -58,8 +58,8 @@ public interface I2NPMessage extends DataStructure {
|
|||||||
* @param data the data
|
* @param data the data
|
||||||
* @param type I2NP message type. If less than zero, read the type from data
|
* @param type I2NP message type. If less than zero, read the type from data
|
||||||
* @param offset where to start
|
* @param offset where to start
|
||||||
* starting at type if type is < 0 (16 byte header)
|
* starting at type if type is < 0 (16 byte header)
|
||||||
* starting at ID if type is >= 0 (15 byte header)
|
* starting at ID if type is >= 0 (15 byte header)
|
||||||
* @return size of the message read (including headers)
|
* @return size of the message read (including headers)
|
||||||
* @throws I2NPMessageException if there is no valid message
|
* @throws I2NPMessageException if there is no valid message
|
||||||
* @throws IOException if there is a problem reading from the stream
|
* @throws IOException if there is a problem reading from the stream
|
||||||
@ -73,10 +73,10 @@ public interface I2NPMessage extends DataStructure {
|
|||||||
* @param data the data, may or may not include the type
|
* @param data the data, may or may not include the type
|
||||||
* @param type I2NP message type. If less than zero, read the type from data
|
* @param type I2NP message type. If less than zero, read the type from data
|
||||||
* @param offset where to start
|
* @param offset where to start
|
||||||
* starting at type if type is < 0 (16 byte header)
|
* starting at type if type is < 0 (16 byte header)
|
||||||
* starting at ID if type is >= 0 (15 byte header)
|
* starting at ID if type is >= 0 (15 byte header)
|
||||||
* @param maxLen read no more than this many bytes from data starting at offset, even if it is longer
|
* @param maxLen read no more than this many bytes from data starting at offset, even if it is longer
|
||||||
* This includes the type byte only if type < 0
|
* This includes the type byte only if type < 0
|
||||||
* @return size of the message read (including headers)
|
* @return size of the message read (including headers)
|
||||||
* @throws I2NPMessageException if there is no valid message
|
* @throws I2NPMessageException if there is no valid message
|
||||||
* @throws IOException if there is a problem reading from the stream
|
* @throws IOException if there is a problem reading from the stream
|
||||||
|
@ -166,7 +166,7 @@ public class TunnelPoolSettings {
|
|||||||
* If there are no tunnels to build with, will this pool allow 0 hop tunnels?
|
* If there are no tunnels to build with, will this pool allow 0 hop tunnels?
|
||||||
* Always true for exploratory.
|
* Always true for exploratory.
|
||||||
* Generally true for client, but should probably be ignored...
|
* Generally true for client, but should probably be ignored...
|
||||||
* use getLength() + getLengthVariance() > 0 instead.
|
* use getLength() + getLengthVariance() > 0 instead.
|
||||||
*/
|
*/
|
||||||
public boolean getAllowZeroHop() { return _allowZeroHop; }
|
public boolean getAllowZeroHop() { return _allowZeroHop; }
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ class LookupDestJob extends JobImpl {
|
|||||||
* For hash or b32 name, the dest will be returned if the LS can be found,
|
* For hash or b32 name, the dest will be returned if the LS can be found,
|
||||||
* even if the dest uses unsupported crypto.
|
* even if the dest uses unsupported crypto.
|
||||||
*
|
*
|
||||||
* @param reqID must be >= 0 if name != null
|
* @param reqID must be >= 0 if name != null
|
||||||
* @param sessID must non-null if reqID >= 0
|
* @param sessID must non-null if reqID >= 0
|
||||||
* @param fromLocalDest use these tunnels for the lookup, or null for exploratory
|
* @param fromLocalDest use these tunnels for the lookup, or null for exploratory
|
||||||
* @since 0.9.11
|
* @since 0.9.11
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +35,7 @@ public class GarlicMessageBuilder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param local non-null; do not use this method for the router's SessionKeyManager
|
* @param local non-null; do not use this method for the router's SessionKeyManager
|
||||||
* @param minTagOverride 0 for no override, > 0 to override SKM's settings
|
* @param minTagOverride 0 for no override, > 0 to override SKM's settings
|
||||||
*/
|
*/
|
||||||
static boolean needsTags(RouterContext ctx, PublicKey key, Hash local, int minTagOverride) {
|
static boolean needsTags(RouterContext ctx, PublicKey key, Hash local, int minTagOverride) {
|
||||||
SessionKeyManager skm = ctx.clientManager().getClientSessionKeyManager(local);
|
SessionKeyManager skm = ctx.clientManager().getClientSessionKeyManager(local);
|
||||||
|
@ -99,8 +99,8 @@ class OutboundClientMessageJobHelper {
|
|||||||
*
|
*
|
||||||
* This is called from OCMOSJ
|
* This is called from OCMOSJ
|
||||||
*
|
*
|
||||||
* @param tagsToSendOverride if > 0, use this instead of skm's default
|
* @param tagsToSendOverride if > 0, use this instead of skm's default
|
||||||
* @param lowTagsOverride if > 0, use this instead of skm's default
|
* @param lowTagsOverride if > 0, use this instead of skm's default
|
||||||
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
* @param wrappedKey output parameter that will be filled with the sessionKey used
|
||||||
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
* @param wrappedTags output parameter that will be filled with the sessionTags used
|
||||||
* @param replyTunnel non-null if requireAck is true or bundledReplyLeaseSet is non-null
|
* @param replyTunnel non-null if requireAck is true or bundledReplyLeaseSet is non-null
|
||||||
|
@ -151,7 +151,7 @@ class FloodfillPeerSelector extends PeerSelector {
|
|||||||
* @param maxNumRouters max to return
|
* @param maxNumRouters max to return
|
||||||
* @param kbuckets now unused
|
* @param kbuckets now unused
|
||||||
*
|
*
|
||||||
* Sorted by closest to the key if > maxNumRouters, otherwise not
|
* Sorted by closest to the key if > maxNumRouters, otherwise not
|
||||||
* The list is in 3 groups - sorted by routing key within each group.
|
* The list is in 3 groups - sorted by routing key within each group.
|
||||||
* Group 1: No store or lookup failure in a long time, and
|
* Group 1: No store or lookup failure in a long time, and
|
||||||
* lookup fail rate no more than 1.5 * average
|
* lookup fail rate no more than 1.5 * average
|
||||||
|
@ -278,7 +278,7 @@ class NtpMessage {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new NtpMessage in client -> server mode, and sets the
|
* Constructs a new NtpMessage in client -> server mode, and sets the
|
||||||
* transmit timestamp to the current time.
|
* transmit timestamp to the current time.
|
||||||
*/
|
*/
|
||||||
public NtpMessage() {
|
public NtpMessage() {
|
||||||
|
@ -833,7 +833,7 @@ public class FIFOBandwidthLimiter {
|
|||||||
/**
|
/**
|
||||||
* Only used by SSU.
|
* Only used by SSU.
|
||||||
* May return without allocating.
|
* May return without allocating.
|
||||||
* Check getPendingRequested() > 0 in a loop.
|
* Check getPendingRequested() > 0 in a loop.
|
||||||
*/
|
*/
|
||||||
public void waitForNextAllocation() {
|
public void waitForNextAllocation() {
|
||||||
boolean complete = false;
|
boolean complete = false;
|
||||||
@ -912,7 +912,7 @@ public class FIFOBandwidthLimiter {
|
|||||||
/**
|
/**
|
||||||
* Block until we are allocated some more bytes.
|
* Block until we are allocated some more bytes.
|
||||||
* May return without allocating.
|
* May return without allocating.
|
||||||
* Check getPendingRequested() > 0 in a loop.
|
* Check getPendingRequested() > 0 in a loop.
|
||||||
*/
|
*/
|
||||||
public void waitForNextAllocation();
|
public void waitForNextAllocation();
|
||||||
/** we no longer want the data requested (the connection closed) */
|
/** we no longer want the data requested (the connection closed) */
|
||||||
|
@ -51,7 +51,7 @@ public class FIFOBandwidthRefiller implements Runnable {
|
|||||||
// no longer allow unlimited bandwidth - the user must specify a value, else use defaults below (KBps)
|
// no longer allow unlimited bandwidth - the user must specify a value, else use defaults below (KBps)
|
||||||
public static final int DEFAULT_INBOUND_BANDWIDTH = 300;
|
public static final int DEFAULT_INBOUND_BANDWIDTH = 300;
|
||||||
/**
|
/**
|
||||||
* Caution, do not make DEFAULT_OUTBOUND_BANDWIDTH * DEFAULT_SHARE_PCT > 32
|
* Caution, do not make DEFAULT_OUTBOUND_BANDWIDTH * DEFAULT_SHARE_PCT > 32
|
||||||
* without thinking about the implications (default connection limits, for example)
|
* without thinking about the implications (default connection limits, for example)
|
||||||
* of moving the default bandwidth class from L to M, or maybe
|
* of moving the default bandwidth class from L to M, or maybe
|
||||||
* adjusting bandwidth class boundaries.
|
* adjusting bandwidth class boundaries.
|
||||||
|
@ -30,16 +30,16 @@ import net.i2p.util.SimpleByteCache;
|
|||||||
* =========================================================
|
* =========================================================
|
||||||
*
|
*
|
||||||
* Message 1 (Session Request):
|
* Message 1 (Session Request):
|
||||||
* X+(H(X) xor Bob.identHash)----------------------------->
|
* X+(H(X) xor Bob.identHash)----------------------------->
|
||||||
*
|
*
|
||||||
* Message 2 (Session Created):
|
* Message 2 (Session Created):
|
||||||
* <----------------------------------------Y+E(H(X+Y)+tsB, sk, Y[239:255])
|
* <----------------------------------------Y+E(H(X+Y)+tsB, sk, Y[239:255])
|
||||||
*
|
*
|
||||||
* Message 3 (Session Confirm A):
|
* Message 3 (Session Confirm A):
|
||||||
* E(sz+Alice.identity+tsA+padding+S(X+Y+Bob.identHash+tsA+tsB), sk, hX_xor_Bob.identHash[16:31])--->
|
* E(sz+Alice.identity+tsA+padding+S(X+Y+Bob.identHash+tsA+tsB), sk, hX_xor_Bob.identHash[16:31])--->
|
||||||
*
|
*
|
||||||
* Message 4 (Session Confirm B):
|
* Message 4 (Session Confirm B):
|
||||||
* <----------------------E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev)
|
* <----------------------E(S(X+Y+Alice.identHash+tsA+tsB)+padding, sk, prev)
|
||||||
*
|
*
|
||||||
* Key:
|
* Key:
|
||||||
*
|
*
|
||||||
|
@ -222,7 +222,7 @@ class PacketBuilder {
|
|||||||
*
|
*
|
||||||
* This doesn't leave anything for acks.
|
* This doesn't leave anything for acks.
|
||||||
*
|
*
|
||||||
* @param numFragments >= 1
|
* @param numFragments >= 1
|
||||||
* @since 0.9.16
|
* @since 0.9.16
|
||||||
*/
|
*/
|
||||||
public static int getMaxAdditionalFragmentSize(PeerState peer, int numFragments, int curDataSize) {
|
public static int getMaxAdditionalFragmentSize(PeerState peer, int numFragments, int curDataSize) {
|
||||||
|
@ -1626,7 +1626,7 @@ class PeerState {
|
|||||||
/**
|
/**
|
||||||
* Pick one or more messages we want to send and allocate them out of our window
|
* Pick one or more messages we want to send and allocate them out of our window
|
||||||
* High usage -
|
* High usage -
|
||||||
* OutboundMessageFragments.getNextVolley() calls this 2nd, if finishMessages() returned > 0.
|
* OutboundMessageFragments.getNextVolley() calls this 2nd, if finishMessages() returned > 0.
|
||||||
* TODO combine finishMessages(), allocateSend(), and getNextDelay() so we don't iterate 3 times.
|
* TODO combine finishMessages(), allocateSend(), and getNextDelay() so we don't iterate 3 times.
|
||||||
*
|
*
|
||||||
* @return allocated messages to send (never empty), or null if no messages or no resources
|
* @return allocated messages to send (never empty), or null if no messages or no resources
|
||||||
@ -1857,7 +1857,7 @@ class PeerState {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A full ACK was received.
|
* A full ACK was received.
|
||||||
* TODO if messages awaiting ack were a HashMap<Long, OutboundMessageState> this would be faster.
|
* TODO if messages awaiting ack were a HashMap<Long, OutboundMessageState> this would be faster.
|
||||||
*
|
*
|
||||||
* @return true if the message was acked for the first time
|
* @return true if the message was acked for the first time
|
||||||
*/
|
*/
|
||||||
|
@ -708,7 +708,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
/**
|
/**
|
||||||
* The current or configured internal IPv4 port.
|
* The current or configured internal IPv4 port.
|
||||||
* UDPEndpoint should always be instantiated (and a random port picked if not configured)
|
* UDPEndpoint should always be instantiated (and a random port picked if not configured)
|
||||||
* before this is called, so the returned value should be > 0
|
* before this is called, so the returned value should be > 0
|
||||||
* unless the endpoint failed to bind.
|
* unless the endpoint failed to bind.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -719,7 +719,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
/**
|
/**
|
||||||
* The current or configured internal port.
|
* The current or configured internal port.
|
||||||
* UDPEndpoint should always be instantiated (and a random port picked if not configured)
|
* UDPEndpoint should always be instantiated (and a random port picked if not configured)
|
||||||
* before this is called, so the returned value should be > 0
|
* before this is called, so the returned value should be > 0
|
||||||
* unless the endpoint failed to bind.
|
* unless the endpoint failed to bind.
|
||||||
*/
|
*/
|
||||||
private int getRequestedPort(boolean ipv6) {
|
private int getRequestedPort(boolean ipv6) {
|
||||||
@ -903,7 +903,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
*
|
*
|
||||||
* @param from Hash of inbound destination
|
* @param from Hash of inbound destination
|
||||||
* @param ourIP publicly routable IPv4 only
|
* @param ourIP publicly routable IPv4 only
|
||||||
* @param ourPort >= 1024
|
* @param ourPort >= 1024
|
||||||
*/
|
*/
|
||||||
void externalAddressReceived(Hash from, byte ourIP[], int ourPort) {
|
void externalAddressReceived(Hash from, byte ourIP[], int ourPort) {
|
||||||
boolean isValid = isValid(ourIP) &&
|
boolean isValid = isValid(ourIP) &&
|
||||||
@ -976,7 +976,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
|||||||
*
|
*
|
||||||
* @param ourIP MUST have been previously validated with isValid()
|
* @param ourIP MUST have been previously validated with isValid()
|
||||||
* IPv4 or IPv6 OK
|
* IPv4 or IPv6 OK
|
||||||
* @param ourPort >= 1024 or 0 for no change
|
* @param ourPort >= 1024 or 0 for no change
|
||||||
*/
|
*/
|
||||||
private boolean changeAddress(byte ourIP[], int ourPort) {
|
private boolean changeAddress(byte ourIP[], int ourPort) {
|
||||||
// this defaults to true when we are firewalled and false otherwise.
|
// this defaults to true when we are firewalled and false otherwise.
|
||||||
|
@ -35,8 +35,8 @@ import net.i2p.util.Log;
|
|||||||
* and this one won't fit,
|
* and this one won't fit,
|
||||||
* let's look to see if we have somthing that would fit instead
|
* let's look to see if we have somthing that would fit instead
|
||||||
* by reordering:
|
* by reordering:
|
||||||
* if (allocated > 0 && msg.getFragment == 0) {
|
* if (allocated > 0 && msg.getFragment == 0) {
|
||||||
* for (j = i+1, j < pending.size(); j++) {
|
* for (j = i+1, j < pending.size(); j++) {
|
||||||
* if it will fit and it is fragment 0 {
|
* if it will fit and it is fragment 0 {
|
||||||
* msg = pending.remove(j)
|
* msg = pending.remove(j)
|
||||||
* pending.add(0, msg)
|
* pending.add(0, msg)
|
||||||
|
@ -33,36 +33,36 @@ import net.i2p.util.Log;
|
|||||||
*
|
*
|
||||||
* Following tunnels are created by us:
|
* Following tunnels are created by us:
|
||||||
*
|
*
|
||||||
* Outbound Gateway > 0 hops:
|
* Outbound Gateway > 0 hops:
|
||||||
* PumpedTunnelGateway
|
* PumpedTunnelGateway
|
||||||
* BatchedRouterPreprocessor -> OutboundSender -> OutboundReceiver -> OutNetMessagePool
|
* BatchedRouterPreprocessor -> OutboundSender -> OutboundReceiver -> OutNetMessagePool
|
||||||
*
|
*
|
||||||
* Outbound zero-hop Gateway+Endpoint:
|
* Outbound zero-hop Gateway+Endpoint:
|
||||||
* TunnelGatewayZeroHop
|
* TunnelGatewayZeroHop
|
||||||
* OutboundMessageDistributor -> OutNetMessagePool
|
* OutboundMessageDistributor -> OutNetMessagePool
|
||||||
*
|
*
|
||||||
* Inbound Endpoint > 0 hops:
|
* Inbound Endpoint > 0 hops:
|
||||||
* TunnelParticipant
|
* TunnelParticipant
|
||||||
* RouterFragmentHandler -> InboundEndpointProcessor -> InboundMessageDistributor -> InNetMessagePool
|
* RouterFragmentHandler -> InboundEndpointProcessor -> InboundMessageDistributor -> InNetMessagePool
|
||||||
*
|
*
|
||||||
* Inbound zero-hop Gateway+Endpoint:
|
* Inbound zero-hop Gateway+Endpoint:
|
||||||
* TunnelGatewayZeroHop
|
* TunnelGatewayZeroHop
|
||||||
* InboundMessageDistributor -> InNetMessagePool
|
* InboundMessageDistributor -> InNetMessagePool
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Following tunnels are NOT created by us:
|
* Following tunnels are NOT created by us:
|
||||||
*
|
*
|
||||||
* Participant (not gateway or endpoint)
|
* Participant (not gateway or endpoint)
|
||||||
* TunnelParticipant
|
* TunnelParticipant
|
||||||
* HopProcessor -> OutNetMessagePool
|
* HopProcessor -> OutNetMessagePool
|
||||||
*
|
*
|
||||||
* Outbound Endpoint > 0 hops:
|
* Outbound Endpoint > 0 hops:
|
||||||
* OutboundTunnelEndpoint
|
* OutboundTunnelEndpoint
|
||||||
* RouterFragmentHandler -> HopProcessor -> OutboundMessageDistributor -> OutNetMessagePool
|
* RouterFragmentHandler -> HopProcessor -> OutboundMessageDistributor -> OutNetMessagePool
|
||||||
*
|
*
|
||||||
* Inbound Gateway > 0 hops:
|
* Inbound Gateway > 0 hops:
|
||||||
* ThrottledPumpedTunnelGateway
|
* ThrottledPumpedTunnelGateway
|
||||||
* BatchedRouterPreprocessor -> InboundSender -> InboundGatewayReceiver -> OutNetMessagePool
|
* BatchedRouterPreprocessor -> InboundSender -> InboundGatewayReceiver -> OutNetMessagePool
|
||||||
*
|
*
|
||||||
*</pre>
|
*</pre>
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user