mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:14:01 +03:00
FILE / ScuroNeko/mtg
conntypes/type.go
Исходный файл и его история в репозитории.
30 lines
660 B
Go
30 lines
660 B
Go
package conntypes
|
|
|
|
type ConnectionType uint8
|
|
|
|
const (
|
|
ConnectionTypeUnknown ConnectionType = iota
|
|
ConnectionTypeAbridged
|
|
ConnectionTypeIntermediate
|
|
ConnectionTypeSecure
|
|
)
|
|
|
|
var (
|
|
ConnectionTagAbridged = []byte{0xef, 0xef, 0xef, 0xef}
|
|
ConnectionTagIntermediate = []byte{0xee, 0xee, 0xee, 0xee}
|
|
ConnectionTagSecure = []byte{0xdd, 0xdd, 0xdd, 0xdd}
|
|
)
|
|
|
|
func (t ConnectionType) Tag() []byte {
|
|
switch t {
|
|
case ConnectionTypeAbridged:
|
|
return ConnectionTagAbridged
|
|
case ConnectionTypeIntermediate:
|
|
return ConnectionTagIntermediate
|
|
case ConnectionTypeSecure, ConnectionTypeUnknown:
|
|
return ConnectionTagSecure
|
|
}
|
|
|
|
return ConnectionTagSecure
|
|
}
|