github.com/tumi8/quic-go@v0.37.4-tum/noninternal/wire/retire_connection_id_frame.go (about) 1 package wire 2 3 import ( 4 "bytes" 5 6 "github.com/tumi8/quic-go/noninternal/protocol" 7 "github.com/tumi8/quic-go/quicvarint" 8 ) 9 10 // A RetireConnectionIDFrame is a RETIRE_CONNECTION_ID frame 11 type RetireConnectionIDFrame struct { 12 SequenceNumber uint64 13 } 14 15 func parseRetireConnectionIDFrame(r *bytes.Reader, _ protocol.VersionNumber) (*RetireConnectionIDFrame, error) { 16 seq, err := quicvarint.Read(r) 17 if err != nil { 18 return nil, err 19 } 20 return &RetireConnectionIDFrame{SequenceNumber: seq}, nil 21 } 22 23 func (f *RetireConnectionIDFrame) Append(b []byte, _ protocol.VersionNumber) ([]byte, error) { 24 b = append(b, retireConnectionIDFrameType) 25 b = quicvarint.Append(b, f.SequenceNumber) 26 return b, nil 27 } 28 29 // Length of a written frame 30 func (f *RetireConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount { 31 return 1 + quicvarint.Len(f.SequenceNumber) 32 }