java.lang.Object
net.i2p.router.tunnel.InboundMessageDistributor
- All Implemented Interfaces:
GarlicMessageReceiver.CloveReceiver
When a message arrives at the inbound tunnel endpoint, this distributor honors the instructions (safely).
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashThe client at the end of the tunnel.private final StringClient name shown in the logs.private final RouterContextThe router the tunnel terminates on.private final LogLogger for this class.private final longXor mask for this tunnel's message ids.private final GarlicMessageReceiverWhere garlic messages are handed on.Constructor Summary
ConstructorsConstructorDescriptionInboundMessageDistributor(RouterContext ctx, Hash client) Create a new inbound message distributor.Method Summary
All MethodsModifier and TypeMethodDescriptionvoiddistribute(I2NPMessage msg, Hash target) Distribute the message to the target, with no tunnel ID.voiddistribute(I2NPMessage msg, Hash target, TunnelId tunnel) Distribute the message to the target, giving the tunnel ID for remote delivery.voidhandleClove(DeliveryInstructions instructions, I2NPMessage data) Handle a clove removed from the garlic message.
Field Details
_context
The router the tunnel terminates on._log
Logger for this class._client
The client at the end of the tunnel._receiver
Where garlic messages are handed on._clientNickname
Client name shown in the logs._msgIDBloomXor
private final long _msgIDBloomXorXor mask for this tunnel's message ids.
Constructor Details
InboundMessageDistributor
Create a new inbound message distributor.- Parameters:
ctx- the router contextclient- null for router tunnel
Method Details
distribute
Distribute the message to the target, with no tunnel ID.- Parameters:
msg- the message unwrapped from the garlic clovetarget- the router or client destination hash named by the delivery instructions
distribute
Distribute the message to the target, giving the tunnel ID for remote delivery.- Parameters:
msg- the message unwrapped from the garlic clovetarget- the router or client destination hash named by the delivery instructionstunnel- the tunnel to deliver down, or null for local delivery at this router
handleClove
Handle a clove removed from the garlic message.- Specified by:
handleClovein interfaceGarlicMessageReceiver.CloveReceiver- Parameters:
instructions- Delivery instructions associated with the clove.data- The I2NPMessage data carried by the clove.