## Uses of Class
net.i2p.router.transport.udp.PeerState2

- Packages that use PeerState2
  Package | Description
  --- | ---
  net.i2p.router.transport.udp | The UDP transport (also known as 'SSU' or Secure Semi-reliable UDP transport) for I2P, allowing I2P messages to be passed over UDP connections.

- - ### Uses of PeerState2 in net.i2p.router.transport.udp

    Methods in net.i2p.router.transport.udp that return PeerState2
    Modifier and Type | Method and Description
    --- | ---
    `PeerState2` | OutboundEstablishState2.`confirmedPacketsSent(UDPPacket[] packets)` note that we just sent the SessionConfirmed packets and save them for retransmission
    `PeerState2` | PeerTestState.`getAlice()` SSU2 only
    `PeerState2` | OutboundEstablishState2.`getPeerState()`
    `PeerState2` | InboundEstablishState2.`getPeerState()`
    `(package private) PeerState2` | UDPTransport.`getPeerState(long rcvConnID)` Get the state by SSU2 connection ID
    `PeerState2` | InboundEstablishState2.`receiveSessionConfirmed(UDPPacket packet)` Receive the last messages in the handshake, and create the PeerState.

    Methods in net.i2p.router.transport.udp with parameters of type PeerState2
    Modifier and Type | Method and Description
    --- | ---
    `UDPPacket` | PacketBuilder2.`buildACK(PeerState2 peer)` Build the ack packet.
    `UDPPacket` | PacketBuilder2.`buildPacket(List<PacketBuilder.Fragment> fragments, PeerState2 peer)`
    `UDPPacket` | PacketBuilder2.`buildPacket(OutboundMessageState state, int fragment, PeerState2 peer)` This builds a data packet (PAYLOAD_TYPE_DATA).
    `UDPPacket` | PacketBuilder2.`buildPeerTestFromAlice(byte[] signedData, PeerState2 bob)` Build a packet as Alice, to Bob to begin a peer test.
    `UDPPacket` | 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.
    `UDPPacket` | 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.
    `UDPPacket` | PacketBuilder2.`buildPeerTestToBob(int code, byte[] signedData, PeerState2 bob)` Build a packet as Charlie to Bob verifying that we will help test Alice.
    `UDPPacket` | PacketBuilder2.`buildPeerTestToCharlie(Hash aliceHash, byte[] signedData, SSU2Payload.Block riBlock, PeerState2 charlie)` Build a packet as Bob to Charlie to help test Alice.
    `UDPPacket` | PacketBuilder2.`buildPing(PeerState2 peer)` A DATA packet with padding only.
    `(package private) UDPPacket` | PacketBuilder2.`buildRelayIntro(byte[] signedData, SSU2Payload.Block riBlock, PeerState2 charlie)` From Bob to Charlie.
    `(package private) UDPPacket` | PacketBuilder2.`buildRelayRequest(byte[] signedData, PeerState2 bob)` From Alice to Bob.
    `(package private) UDPPacket` | PacketBuilder2.`buildRelayResponse(byte[] signedData, PeerState2 state)` From Charlie to Bob or Bob to Alice.
    `(package private) void` | UDPTransport.`changePeerAddress(PeerState2 peer, RemoteHostId newAddress)` Remove and add to peersByRemoteHost map
    `(package private) void` | IntroductionManager.`receiveRelayIntro(PeerState2 bob, Hash alice, byte[] data)` Processes a relay introduction message received from another peer.
    `(package private) void` | IntroductionManager.`receiveRelayRequest(PeerState2 alice, byte[] data)` We are Bob and we got this from Alice.
    `(package private) void` | IntroductionManager.`receiveRelayResponse(PeerState2 peer, int status, byte[] data)` We are Bob and we got this from Charlie, OR we are Alice and we got this from Bob.
    `(package private) void` | EstablishmentManager.`receiveRelayResponse(PeerState2 bob, long nonce, int code, byte[] data)` We are Alice, we sent a RelayRequest to Bob and got a RelayResponse back.
    `void` | PeerTestManager.`receiveTest(RemoteHostId from, PeerState2 fromPeer, int msg, int status, Hash h, byte[] data)` Entry point for all in-session incoming packets.
    `void` | PeerTestState.`setAlice(PeerState2 alice)` SSU2 only

    Constructors in net.i2p.router.transport.udp with parameters of type PeerState2
    Constructor and Description
    `PeerStateDestroyed(RouterContext ctx, UDPTransport transport, PeerState2 peer)` This must be called after the first termination or termination ack was sent from PeerState2, so the next packet number is correct.