2017-05-27 14:30:11 -05:00
|
|
|
package ackhandler
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2018-02-17 00:29:53 -05:00
|
|
|
"github.com/lucas-clemente/quic-go/internal/protocol"
|
|
|
|
"github.com/lucas-clemente/quic-go/internal/wire"
|
2017-05-27 14:30:11 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// A Packet is a packet
|
|
|
|
type Packet struct {
|
|
|
|
PacketNumber protocol.PacketNumber
|
2018-03-25 23:37:41 -05:00
|
|
|
PacketType protocol.PacketType
|
2018-02-17 00:29:53 -05:00
|
|
|
Frames []wire.Frame
|
2017-05-27 14:30:11 -05:00
|
|
|
Length protocol.ByteCount
|
|
|
|
EncryptionLevel protocol.EncryptionLevel
|
2018-04-18 16:48:08 -05:00
|
|
|
SendTime time.Time
|
2017-05-27 14:30:11 -05:00
|
|
|
|
2018-02-17 00:29:53 -05:00
|
|
|
largestAcked protocol.PacketNumber // if the packet contains an ACK, the LargestAcked value of that ACK
|
2018-03-25 23:37:41 -05:00
|
|
|
|
2018-04-18 16:48:08 -05:00
|
|
|
// There are two reasons why a packet cannot be retransmitted:
|
|
|
|
// * it was already retransmitted
|
|
|
|
// * this packet is a retransmission, and we already received an ACK for the original packet
|
|
|
|
canBeRetransmitted bool
|
2018-03-25 23:37:41 -05:00
|
|
|
includedInBytesInFlight bool
|
|
|
|
retransmittedAs []protocol.PacketNumber
|
|
|
|
isRetransmission bool // we need a separate bool here because 0 is a valid packet number
|
|
|
|
retransmissionOf protocol.PacketNumber
|
2017-05-27 14:30:11 -05:00
|
|
|
}
|