FILE / ScuroNeko/mtg

newprotocol/connection_type.go

Исходный файл и его история в репозитории.
FILE 07985cf418c3b6d7e0b59de2d29e7e927bedf401
Files
mtg/newprotocol/connection_type.go
T
2019-08-29 13:16:08 +03:00

28 lines
592 B
Go

package newprotocol
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
default:
return ConnectionTagSecure
}
}