Packages that use UDPPacket
Package
Description
SSU2, the UDP transport: datagram sessions with Holepunch peer discovery, plus the older SSU compatibility code.
Uses of UDPPacket in net.i2p.router.transport.udp
Classes in net.i2p.router.transport.udp that implement interfaces with type arguments of type UDPPacketModifier and TypeClassDescriptionprivate static classFactory for UDP packet caching.Fields in net.i2p.router.transport.udp declared as UDPPacketModifier and TypeFieldDescriptionprivate final UDPPacketIntroductionManager.DelaySend.pktThe packet to send late.private final UDPPacketPeerTestManager.DelaySend.pktThe packet to send late.Fields in net.i2p.router.transport.udp with type parameters of type UDPPacketModifier and TypeFieldDescriptionprivate final BlockingQueue<UDPPacket> PacketHandler._inboundQueuePackets waiting to be processed.private final BlockingQueue<UDPPacket> UDPSender._outboundQueueThe packets waiting to be sent.UDPPacket._packetCachePool of the reusable packets.private static final TryCache.ObjectFactory<UDPPacket> UDPPacket._packetFactoryFactory creating the cached packets.InboundEstablishState2._queuedDataPacketsData packets queued before the handshake finished.Methods in net.i2p.router.transport.udp that return UDPPacketModifier and TypeMethodDescriptionstatic UDPPacketUDPPacket.acquire(RouterContext ctx, boolean inbound) Inbound flag.PacketBuilder2.buildACK(PeerState2 peer) Build the ack packet.PacketBuilder2.buildHolePunch(InetAddress to, int port, SessionKey introKey, long sendID, long rcvID, byte[] signedData) Out-of-session, containing a RelayResponse block.private UDPPacketPacketBuilder2.buildLongPacketHeader(long destID, long pktNum, byte type, long srcID, long token, int version) Build the header block of a long SSU2 packet.PacketBuilder2.buildPacket(List<PacketBuilder2.Fragment> fragments, List<SSU2Payload.Block> otherBlocks, SSU2Sender peer) Build a packet from multiple fragments and optional other blocks.PacketBuilder2.buildPacket(List<PacketBuilder2.Fragment> fragments, PeerState2 peer) Build a packet from multiple fragments.PacketBuilder2.buildPacket(OutboundMessageState state, int fragment, PeerState2 peer) This builds a data packet (PAYLOAD_TYPE_DATA).PacketBuilder2.buildPeerTestFromAlice(byte[] signedData, PeerState2 bob) Build a packet as Alice, to Bob to begin a peer test.PacketBuilder2.buildPeerTestFromAlice(InetAddress toIP, int toPort, SessionKey introKey, long sendID, long rcvID, byte[] signedData) Build a packet as Alice to Charlie.PacketBuilder2.buildPeerTestToAlice(int code, Hash charlieHash, byte[] signedData, PeerState2 alice) Build a packet as Bob to Alice, with the response from Charlie, or a rejection by Bob.PacketBuilder2.buildPeerTestToAlice(int code, Hash charlieHash, byte[] signedData, SSU2Payload.Block riBlock, PeerState2 alice) Build a packet as Bob to Alice, with the response from Charlie, or a rejection by Bob.PacketBuilder2.buildPeerTestToAlice(InetAddress aliceIP, int alicePort, SessionKey introKey, boolean firstSend, long sendID, long rcvID, byte[] signedData) Build a packet as Charlie to Alice.PacketBuilder2.buildPeerTestToBob(int code, byte[] signedData, PeerState2 bob) Build a packet as Charlie to Bob verifying that we will help test Alice.PacketBuilder2.buildPeerTestToCharlie(Hash aliceHash, byte[] signedData, SSU2Payload.Block riBlock, PeerState2 charlie) Build a packet as Bob to Charlie to help test Alice.PacketBuilder2.buildPing(PeerState2 peer) A DATA packet with padding only.(package private) UDPPacketPacketBuilder2.buildRelayIntro(byte[] signedData, SSU2Payload.Block riBlock, PeerState2 charlie) From Bob to Charlie.(package private) UDPPacketPacketBuilder2.buildRelayRequest(byte[] signedData, PeerState2 bob) From Alice to Bob.(package private) UDPPacketPacketBuilder2.buildRelayResponse(byte[] signedData, PeerState2 state) From Charlie to Bob or Bob to Alice.PacketBuilder2.buildRetryPacket(InboundEstablishState2 state, int terminationCode) Build a new Retry packet for the given peer, encrypting it as necessary.PacketBuilder2.buildRetryPacket(RemoteHostId to, SocketAddress toAddr, long destID, long srcID, int version, int terminationCode) Build a new Retry packet with a termination code, for a rejection direct from the EstablishmentManager.private UDPPacketPacketBuilder2.buildSessionConfirmedPacket(OutboundEstablishState2 state, SSU2Payload.RIBlock block) Build a single new SessionConfirmed packet for the given peer, unfragmented.PacketBuilder2.buildSessionConfirmedPackets(OutboundEstablishState2 state, RouterInfo ourInfo) Build a new series of SessionConfirmed packets for the given peer, encrypting it as necessary.private UDPPacket[]PacketBuilder2.buildSessionConfirmedPackets(OutboundEstablishState2 state, SSU2Payload.RIBlock block) Build all the fragmented SessionConfirmed packets.PacketBuilder2.buildSessionCreatedPacket(InboundEstablishState2 state) Build a new SessionCreated packet for the given peer, encrypting it as necessary.PacketBuilder2.buildSessionDestroyPacket(int reason, SSU2Sender peer) Build a data packet with a termination block.PacketBuilder2.buildSessionRequestPacket(OutboundEstablishState2 state) Build a new SessionRequest packet for the given peer, encrypting it as necessary.private UDPPacketPacketBuilder2.buildShortPacketHeader(long destID, long pktNum, byte type) Build the header block of a short SSU2 packet.PacketBuilder2.buildTokenRequestPacket(OutboundEstablishState2 state) Build a new SessionRequest packet for the given peer, encrypting it as necessary.private UDPPacketUDPSender.Runner.getNextPacket()Retrieves the next UDP packet from the outbound queue for sending.private UDPPacket[]PeerState2.getRetransmitSessionConfirmedPackets()The saved SessionConfirmed packets for retransmission.InboundEstablishState2.getRetransmitSessionCreatedPacket()The retransmitted SessionCreated packet, or null if not sent or already got the session confirmed.OutboundEstablishState2.getRetransmitSessionRequestPacket()A packet to retransmit the SessionRequest.UDPPacket.PacketFactory.newInstance()New instance.UDPEndpoint.receive()Blocking call to receive the next inbound UDP packet from any peer.PacketHandler.receiveNext()Blocking call to retrieve the next inbound packet, or null if we have shut down.Methods in net.i2p.router.transport.udp that return types with arguments of type UDPPacketModifier and TypeMethodDescriptionOutboundMessageFragments.getNextVolley()Fetch all the packets for a message volley.OutboundMessageFragments.preparePackets(List<OutboundMessageState> states, PeerState peer) Build the packets for one volley.Methods in net.i2p.router.transport.udp with parameters of type UDPPacketModifier and TypeMethodDescriptionstatic voidSSU2Header.acceptTrialDecrypt(UDPPacket packet, SSU2Header.Header header) Copy the header back to the packet.voidAdds a UDP packet to the send queue.OutboundEstablishState2.confirmedPacketsSent(UDPPacket[] packets) Note that we just sent the SessionConfirmed packets and save them for retransmission.private final intBLOCKING if queue between here and PacketHandler is full.private voidPacketBuilder2.encryptDataPacket(UDPPacket packet, CipherState chacha, long n, byte[] hdrKey1, byte[] hdrKey2) Encrypts the payload of one data packet and appends the MAC.static voidSSU2Header.encryptHandshakeHeader(UDPPacket packet, byte[] key1, byte[] key2) Encryption - first 64 bytes.static voidSSU2Header.encryptLongHeader(UDPPacket packet, byte[] key1, byte[] key2) First 32 bytes.private voidPacketBuilder2.encryptPeerTest(UDPPacket packet, byte[] chachaKey, long n, byte[] hdrKey1, byte[] hdrKey2, byte[] ip, int port, SSU2Payload.Block ptBlock) Also used for hole punch with a relay request block.private voidPacketBuilder2.encryptRetry(UDPPacket packet, byte[] chachaKey, long n, byte[] hdrKey1, byte[] hdrKey2, byte[] ip, int port, int terminationCode) Encrypt and write out the body of a Retry packet.private voidPacketBuilder2.encryptSessionConfirmed(UDPPacket packet, HandshakeState state, int mtu, int numFragments, int addPadding, boolean isIPv6, byte[] hdrKey1, byte[] hdrKey2, SSU2Payload.RIBlock riblock, EstablishmentManager.Token token) If numFragments larger than 1, we do NOT encrypt the header here, that's caller's responsibility.private voidPacketBuilder2.encryptSessionCreated(UDPPacket packet, HandshakeState state, int mtu, byte[] hdrKey1, byte[] hdrKey2, long relayTag, EstablishmentManager.Token token, byte[] ip, int port, int version) Encrypt and write out message 2 of the handshake, the SessionCreated.private voidPacketBuilder2.encryptSessionRequest(UDPPacket packet, HandshakeState state, boolean isIPv6, int mtu, byte[] hdrKey1, byte[] hdrKey2, boolean needIntro, int version, Hash bob) Encrypt and write out message 1 of the handshake, the SessionRequest.static voidSSU2Header.encryptShortHeader(UDPPacket packet, byte[] key1, byte[] key2) First 16 bytes.private voidPacketBuilder2.encryptTokenRequest(UDPPacket packet, byte[] chachaKey, long n, byte[] hdrKey1, byte[] hdrKey2) Encrypt and write out the body of a Token Request packet.private booleanPeerState2.handleMigrationNone(RemoteHostId from, long n, UDPPacket packet) Connection migration attempt while in MIGRATION_STATE_NONE.private booleanPeerState2.handleMigrationPending(RemoteHostId from, UDPPacket packet) Connection migration attempt while in MIGRATION_STATE_PENDING.private voidPacketHandler.Handler.handlePacket(UDPPacket packet) Initial handling, called for every packet.private voidOutboundEstablishState2.locked_receiveRetry(UDPPacket packet) Process a Retry packet, with the lock held.private PeerState2InboundEstablishState2.locked_receiveSessionConfirmed(UDPPacket packet) Process SessionConfirmed and create the peer state, with the lock held.private voidOutboundEstablishState2.locked_receiveSessionCreated(UDPPacket packet) Process SessionCreated, with the lock held.private voidInboundEstablishState2.locked_receiveSessionOrTokenRequestAfterRetry(UDPPacket packet) Process a session or token request after a retry, with the lock held.voidInboundEstablishState2.queuePossibleDataPacket(UDPPacket packet) Queue a data packet received before the session completed.voidPacketHandler.queueReceived(UDPPacket packet) Queue a received packet for processing.private intReceive a UDP packet.(package private) voidEstablishmentManager.receiveHolePunch(RemoteHostId id, UDPPacket packet) Called from PacketHandler.(package private) voidPeerState2.receivePacket(RemoteHostId from, UDPPacket packet) From different than expected source IP/port.(package private) voidPeerState2.receivePacket(UDPPacket packet) Receives and decrypts the given packet.(package private) voidPeerStateDestroyed.receivePacket(RemoteHostId from, UDPPacket packet) Handle one packet received from the given source address.(package private) voidPeerStateDestroyed.receivePacket(UDPPacket packet) Handle one packet received from the peer.(package private) voidEstablishmentManager.receiveRetry(OutboundEstablishState2 state, UDPPacket packet) Got a Retry (in response to our outbound SessionRequest or TokenRequest)voidOutboundEstablishState2.receiveRetry(UDPPacket packet) Receive a retry packet.(package private) voidEstablishmentManager.receiveSessionConfirmed(InboundEstablishState2 state, UDPPacket packet) Got a SessionConfirmed, should only happen as part of an inbound establishment.InboundEstablishState2.receiveSessionConfirmed(UDPPacket packet) Receive the last messages in the handshake, and create the PeerState.(package private) voidEstablishmentManager.receiveSessionCreated(OutboundEstablishState2 state, UDPPacket packet) Got a SessionCreated (in response to our outbound SessionRequest)voidOutboundEstablishState2.receiveSessionCreated(UDPPacket packet) Receive a SessionCreated packet.(package private) voidEstablishmentManager.receiveSessionOrTokenRequest(RemoteHostId from, InboundEstablishState2 state, UDPPacket packet) Got a SessionRequest OR a TokenRequest (initiates an inbound establishment)voidInboundEstablishState2.receiveSessionOrTokenRequestAfterRetry(UDPPacket packet) All exceptions thrown from here will be fatal.private booleanPacketHandler.receiveSSU2Packet(RemoteHostId from, UDPPacket packet, InboundEstablishState2 state) Decrypt the header and hand off to the state for processing.private booleanPacketHandler.receiveSSU2Packet(UDPPacket packet, OutboundEstablishState2 state) Decrypt the header and hand off to the state for processing.voidPeerTestManager.receiveTest(RemoteHostId from, UDPPacket packet) Entry point for all out-of-session packets, messages 5-7 only.voidSends a single UDP packet directly out by selecting an appropriate UDPEndpoint.voidAdd the packet to the outbound queue to be sent ASAP (as allowed by the bandwidth limiter) BLOCKING if queue is full.(package private) voidThis sends it directly out, bypassing OutboundMessageFragments.private voidEstablishmentManager.sendTerminationPacket(RemoteHostId to, UDPPacket fromPacket, int terminationCode) Send a Retry packet with a termination code, for a rejection of a session/token request.private static voidPacketBuilder2.setTo(UDPPacket packet, InetAddress ip, int port) Sets the destination address of the packet.static SSU2Header.HeaderSSU2Header.trialDecryptHandshakeHeader(UDPPacket packet, byte[] key1, byte[] key2) Session Request and Session Created only.static SSU2Header.HeaderSSU2Header.trialDecryptLongHeader(UDPPacket packet, byte[] key1, byte[] key2) Retry, Token Request, Peer Test only.static SSU2Header.HeaderSSU2Header.trialDecryptShortHeader(UDPPacket packet, byte[] key1, byte[] key2) Session Confirmed and data phase.Constructors in net.i2p.router.transport.udp with parameters of type UDPPacketModifierConstructorDescriptionSchedules a delayed packet send.Schedules a delayed packet send.InboundEstablishState2(RouterContext ctx, UDPTransport transport, UDPPacket packet) Start a new handshake with the given incoming packet, which must be a Session Request or Token Request.