java.lang.Object
net.i2p.router.tunnel.pool.BuildMessageProcessor
Receive the build message at a certain hop, decrypt its encrypted record, read the enclosed tunnel request, decide how to reply, write the reply, encrypt the reply record, and return a TunnelBuildMessage to forward on to the next hop.
There is only one of these. Instantiated by BuildHandler.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DecayingBloomFilterBuild ids already seen, to drop duplicates.private final RouterContextThe router context the builds happen in.private final LogLogger for this class.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptiondecrypt(TunnelBuildMessage msg, Hash ourHash, PrivateKey privKey) Decrypt the record targeting us, encrypting all of the other records with the included reply key and IV.private DecayingBloomFilterFor N typical part tunnels and rejecting 50%, that's 12N requests per hour.
Field Details
ctx
The router context the builds happen in.log
Logger for this class._filter
Build ids already seen, to drop duplicates.
Constructor Details
BuildMessageProcessor
Creates a new BuildMessageProcessor.- Parameters:
ctx- the router context
Method Details
selectFilter
For N typical part tunnels and rejecting 50%, that's 12N requests per hour. This is the equivalent of (12N/600) KBps through the IVValidator filter.Target false positive rate is 1E-5 or lower.
- Returns:
- the IV filter sized for this router's memory and tunnel count
decrypt
Decrypt the record targeting us, encrypting all of the other records with the included reply key and IV. The original, encrypted record targeting us is removed from the request message (so that the reply can be placed in that position after going through the decrypted request record).Note that this layer-decrypts the build records in-place. Do not call this more than once for a given message.
- Parameters:
msg- the tunnel build messageourHash- our router hashprivKey- our private key- Returns:
- the current hop's decrypted record or null on failure