1
0
Protocol/packets/types.go

43 lines
794 B
Go

package packets
// PacketSerializer interface for common packet operations
type PacketSerializer interface {
Serialize(dest []byte) uint32
Size() uint32
Copy() PacketSerializer
}
// OpcodeManager interface for opcode translation
type OpcodeManager interface {
EmuToEQ(emu EmuOpcode) uint16
EQToEmu(eq uint16) EmuOpcode
EmuToName(emu EmuOpcode) string
EQToName(eq uint16) string
}
// Stream states
type StreamState uint8
const (
StateDisconnected StreamState = iota
StateConnecting
StateEstablished
StateClosing
StateClosed
)
// Packet priority levels
const (
PriorityLow uint32 = 0
PriorityNormal uint32 = 5
PriorityHigh uint32 = 10
)
// Max packet sizes
const (
MaxPacketSize = 0xFFFF
DefaultMTU = 1450
MaxCombinedSize = 512
MaxFragmentChunk = 0xFFFF
)