Documentation ¶
Index ¶
- func HasAckElicitingFrames(fs []Frame) bool
- func IsFrameAckEliciting(f wire.Frame) bool
- func NewAckHandler(initialPacketNumber protocol.PacketNumber, rttStats *utils.RTTStats, ...) (SentPacketHandler, ReceivedPacketHandler)
- type Frame
- type Packet
- type PacketElement
- type PacketList
- func (l *PacketList) Back() *PacketElement
- func (l *PacketList) Front() *PacketElement
- func (l *PacketList) Init() *PacketList
- func (l *PacketList) InsertAfter(v Packet, mark *PacketElement) *PacketElement
- func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement
- func (l *PacketList) Len() int
- func (l *PacketList) MoveAfter(e, mark *PacketElement)
- func (l *PacketList) MoveBefore(e, mark *PacketElement)
- func (l *PacketList) MoveToBack(e *PacketElement)
- func (l *PacketList) MoveToFront(e *PacketElement)
- func (l *PacketList) PushBack(v Packet) *PacketElement
- func (l *PacketList) PushBackList(other *PacketList)
- func (l *PacketList) PushFront(v Packet) *PacketElement
- func (l *PacketList) PushFrontList(other *PacketList)
- func (l *PacketList) Remove(e *PacketElement) Packet
- type ReceivedPacketHandler
- type SendMode
- type SentPacketHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasAckElicitingFrames ¶
HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
func IsFrameAckEliciting ¶
IsFrameAckEliciting returns true if the frame is ack-eliciting.
func NewAckHandler ¶
func NewAckHandler( initialPacketNumber protocol.PacketNumber, rttStats *utils.RTTStats, pers protocol.Perspective, tracer logging.ConnectionTracer, logger utils.Logger, version protocol.VersionNumber, ) (SentPacketHandler, ReceivedPacketHandler)
NewAckHandler creates a new SentPacketHandler and a new ReceivedPacketHandler
Types ¶
type Packet ¶
type Packet struct { PacketNumber protocol.PacketNumber Frames []Frame LargestAcked protocol.PacketNumber // InvalidPacketNumber if the packet doesn't contain an ACK Length protocol.ByteCount EncryptionLevel protocol.EncryptionLevel SendTime time.Time IsPathMTUProbePacket bool // We don't report the loss of Path MTU probe packets to the congestion controller. // contains filtered or unexported fields }
A Packet is a packet
type PacketElement ¶
type PacketElement struct { // The value stored with this element. Value Packet // contains filtered or unexported fields }
PacketElement is an element of a linked list.
func (*PacketElement) Next ¶
func (e *PacketElement) Next() *PacketElement
Next returns the next list element or nil.
func (*PacketElement) Prev ¶
func (e *PacketElement) Prev() *PacketElement
Prev returns the previous list element or nil.
type PacketList ¶
type PacketList struct {
// contains filtered or unexported fields
}
PacketList is a linked list of Packets.
func (*PacketList) Back ¶
func (l *PacketList) Back() *PacketElement
Back returns the last element of list l or nil if the list is empty.
func (*PacketList) Front ¶
func (l *PacketList) Front() *PacketElement
Front returns the first element of list l or nil if the list is empty.
func (*PacketList) Init ¶
func (l *PacketList) Init() *PacketList
Init initializes or clears list l.
func (*PacketList) InsertAfter ¶
func (l *PacketList) InsertAfter(v Packet, mark *PacketElement) *PacketElement
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*PacketList) InsertBefore ¶
func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified. The mark must not be nil.
func (*PacketList) Len ¶
func (l *PacketList) Len() int
Len returns the number of elements of list l. The complexity is O(1).
func (*PacketList) MoveAfter ¶
func (l *PacketList) MoveAfter(e, mark *PacketElement)
MoveAfter moves element e to its new position after mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*PacketList) MoveBefore ¶
func (l *PacketList) MoveBefore(e, mark *PacketElement)
MoveBefore moves element e to its new position before mark. If e or mark is not an element of l, or e == mark, the list is not modified. The element and mark must not be nil.
func (*PacketList) MoveToBack ¶
func (l *PacketList) MoveToBack(e *PacketElement)
MoveToBack moves element e to the back of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*PacketList) MoveToFront ¶
func (l *PacketList) MoveToFront(e *PacketElement)
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
func (*PacketList) PushBack ¶
func (l *PacketList) PushBack(v Packet) *PacketElement
PushBack inserts a new element e with value v at the back of list l and returns e.
func (*PacketList) PushBackList ¶
func (l *PacketList) PushBackList(other *PacketList)
PushBackList inserts a copy of an other list at the back of list l. The lists l and other may be the same. They must not be nil.
func (*PacketList) PushFront ¶
func (l *PacketList) PushFront(v Packet) *PacketElement
PushFront inserts a new element e with value v at the front of list l and returns e.
func (*PacketList) PushFrontList ¶
func (l *PacketList) PushFrontList(other *PacketList)
PushFrontList inserts a copy of an other list at the front of list l. The lists l and other may be the same. They must not be nil.
func (*PacketList) Remove ¶
func (l *PacketList) Remove(e *PacketElement) Packet
Remove removes e from l if e is an element of list l. It returns the element value e.Value. The element must not be nil.
type ReceivedPacketHandler ¶
type ReceivedPacketHandler interface { IsPotentiallyDuplicate(protocol.PacketNumber, protocol.EncryptionLevel) bool ReceivedPacket(pn protocol.PacketNumber, ecn protocol.ECN, encLevel protocol.EncryptionLevel, rcvTime time.Time, shouldInstigateAck bool) error DropPackets(protocol.EncryptionLevel) GetAlarmTimeout() time.Time GetAckFrame(encLevel protocol.EncryptionLevel, onlyIfQueued bool) *wire.AckFrame }
ReceivedPacketHandler handles ACKs needed to send for incoming packets
type SendMode ¶
type SendMode uint8
The SendMode says what kind of packets can be sent.
const ( // SendNone means that no packets should be sent SendNone SendMode = iota // SendAck means an ACK-only packet should be sent SendAck // SendPTOInitial means that an Initial probe packet should be sent SendPTOInitial // SendPTOHandshake means that a Handshake probe packet should be sent SendPTOHandshake // SendPTOAppData means that an Application data probe packet should be sent SendPTOAppData // SendAny means that any packet should be sent SendAny )
type SentPacketHandler ¶
type SentPacketHandler interface { // SentPacket may modify the packet SentPacket(packet *Packet) ReceivedAck(ackFrame *wire.AckFrame, encLevel protocol.EncryptionLevel, recvTime time.Time) error ReceivedBytes(protocol.ByteCount) DropPackets(protocol.EncryptionLevel) ResetForRetry() error SetHandshakeConfirmed() // The SendMode determines if and what kind of packets can be sent. SendMode() SendMode // TimeUntilSend is the time when the next packet should be sent. // It is used for pacing packets. TimeUntilSend() time.Time // HasPacingBudget says if the pacer allows sending of a (full size) packet at this moment. HasPacingBudget() bool SetMaxDatagramSize(count protocol.ByteCount) // only to be called once the handshake is complete QueueProbePacket(protocol.EncryptionLevel) bool /* was a packet queued */ PeekPacketNumber(protocol.EncryptionLevel) (protocol.PacketNumber, protocol.PacketNumberLen) PopPacketNumber(protocol.EncryptionLevel) protocol.PacketNumber GetLossDetectionTimeout() time.Time OnLossDetectionTimeout() error }
SentPacketHandler handles ACKs received for outgoing packets