avoid type confusion between protocol.PacketType and logging.PacketType

The enums have completely different meanings. protocol.PacketType only
defines long header types, whereas logging.PacketType defines all
different types of QUIC packets (including short header packets).
This commit is contained in:
Marten Seemann 2021-03-21 12:51:18 +08:00
parent 81d16a9903
commit e9b4f9ba07
5 changed files with 7 additions and 9 deletions

View file

@ -40,7 +40,7 @@ func (m *MockConnectionTracer) EXPECT() *MockConnectionTracerMockRecorder {
}
// BufferedPacket mocks base method.
func (m *MockConnectionTracer) BufferedPacket(arg0 protocol.PacketType) {
func (m *MockConnectionTracer) BufferedPacket(arg0 logging.PacketType) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "BufferedPacket", arg0)
}
@ -112,7 +112,7 @@ func (mr *MockConnectionTracerMockRecorder) DroppedKey(arg0 interface{}) *gomock
}
// DroppedPacket mocks base method.
func (m *MockConnectionTracer) DroppedPacket(arg0 protocol.PacketType, arg1 protocol.ByteCount, arg2 logging.PacketDropReason) {
func (m *MockConnectionTracer) DroppedPacket(arg0 logging.PacketType, arg1 protocol.ByteCount, arg2 logging.PacketDropReason) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "DroppedPacket", arg0, arg1, arg2)
}

View file

@ -38,7 +38,7 @@ func (m *MockTracer) EXPECT() *MockTracerMockRecorder {
}
// DroppedPacket mocks base method.
func (m *MockTracer) DroppedPacket(arg0 net.Addr, arg1 protocol.PacketType, arg2 protocol.ByteCount, arg3 logging.PacketDropReason) {
func (m *MockTracer) DroppedPacket(arg0 net.Addr, arg1 logging.PacketType, arg2 protocol.ByteCount, arg3 logging.PacketDropReason) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "DroppedPacket", arg0, arg1, arg2, arg3)
}

View file

@ -39,7 +39,7 @@ func (m *MockConnectionTracer) EXPECT() *MockConnectionTracerMockRecorder {
}
// BufferedPacket mocks base method.
func (m *MockConnectionTracer) BufferedPacket(arg0 protocol.PacketType) {
func (m *MockConnectionTracer) BufferedPacket(arg0 PacketType) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "BufferedPacket", arg0)
}
@ -111,7 +111,7 @@ func (mr *MockConnectionTracerMockRecorder) DroppedKey(arg0 interface{}) *gomock
}
// DroppedPacket mocks base method.
func (m *MockConnectionTracer) DroppedPacket(arg0 protocol.PacketType, arg1 protocol.ByteCount, arg2 PacketDropReason) {
func (m *MockConnectionTracer) DroppedPacket(arg0 PacketType, arg1 protocol.ByteCount, arg2 PacketDropReason) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "DroppedPacket", arg0, arg1, arg2)
}

View file

@ -37,7 +37,7 @@ func (m *MockTracer) EXPECT() *MockTracerMockRecorder {
}
// DroppedPacket mocks base method.
func (m *MockTracer) DroppedPacket(arg0 net.Addr, arg1 protocol.PacketType, arg2 protocol.ByteCount, arg3 PacketDropReason) {
func (m *MockTracer) DroppedPacket(arg0 net.Addr, arg1 PacketType, arg2 protocol.ByteCount, arg3 PacketDropReason) {
m.ctrl.T.Helper()
m.ctrl.Call(m, "DroppedPacket", arg0, arg1, arg2, arg3)
}

View file

@ -1,9 +1,7 @@
package logging
import "github.com/lucas-clemente/quic-go/internal/protocol"
// PacketType is the packet type of a QUIC packet
type PacketType = protocol.PacketType
type PacketType uint8
const (
// PacketTypeInitial is the packet type of an Initial packet