github.com/danielpfeifer02/quic-go-prio-packs@v0.41.0-28/internal/ackhandler/interfaces.go (about) 1 package ackhandler 2 3 import ( 4 "time" 5 6 "github.com/danielpfeifer02/quic-go-prio-packs/internal/protocol" 7 "github.com/danielpfeifer02/quic-go-prio-packs/internal/wire" 8 ) 9 10 // SentPacketHandler handles ACKs received for outgoing packets 11 type SentPacketHandler interface { 12 // SentPacket may modify the packet 13 SentPacket(t time.Time, pn, largestAcked protocol.PacketNumber, streamFrames []StreamFrame, frames []Frame, encLevel protocol.EncryptionLevel, ecn protocol.ECN, size protocol.ByteCount, isPathMTUProbePacket bool) 14 // ReceivedAck processes an ACK frame. 15 // It does not store a copy of the frame. 16 ReceivedAck(f *wire.AckFrame, encLevel protocol.EncryptionLevel, rcvTime time.Time) (bool /* 1-RTT packet acked */, error) 17 ReceivedBytes(protocol.ByteCount) 18 DropPackets(protocol.EncryptionLevel) 19 ResetForRetry(rcvTime time.Time) error 20 SetHandshakeConfirmed() 21 22 // The SendMode determines if and what kind of packets can be sent. 23 SendMode(now time.Time) SendMode 24 // TimeUntilSend is the time when the next packet should be sent. 25 // It is used for pacing packets. 26 TimeUntilSend() time.Time 27 SetMaxDatagramSize(count protocol.ByteCount) 28 29 // only to be called once the handshake is complete 30 QueueProbePacket(protocol.EncryptionLevel) bool /* was a packet queued */ 31 32 ECNMode(isShortHeaderPacket bool) protocol.ECN // isShortHeaderPacket should only be true for non-coalesced 1-RTT packets 33 PeekPacketNumber(protocol.EncryptionLevel) (protocol.PacketNumber, protocol.PacketNumberLen) 34 PopPacketNumber(protocol.EncryptionLevel) protocol.PacketNumber 35 36 GetLossDetectionTimeout() time.Time 37 OnLossDetectionTimeout() error 38 39 // PACKET_NUMBER_TAG 40 SetPacketNumber(protocol.PacketNumber) 41 SetHighestSentPacketNumber(protocol.PacketNumber) 42 } 43 44 type sentPacketTracker interface { 45 GetLowestPacketNotConfirmedAcked() protocol.PacketNumber 46 ReceivedPacket(protocol.EncryptionLevel) 47 } 48 49 // ReceivedPacketHandler handles ACKs needed to send for incoming packets 50 type ReceivedPacketHandler interface { 51 IsPotentiallyDuplicate(protocol.PacketNumber, protocol.EncryptionLevel) bool 52 ReceivedPacket(pn protocol.PacketNumber, ecn protocol.ECN, encLevel protocol.EncryptionLevel, rcvTime time.Time, ackEliciting bool) error 53 DropPackets(protocol.EncryptionLevel) 54 55 GetAlarmTimeout() time.Time 56 GetAckFrame(encLevel protocol.EncryptionLevel, onlyIfQueued bool) *wire.AckFrame 57 }