route/vendor/github.com/bifurcation/mint/dtls.go

29 lines
531 B
Go
Raw Normal View History

2018-01-03 19:19:49 +00:00
package mint
2018-01-17 04:32:31 +00:00
import (
"fmt"
)
2018-01-03 19:19:49 +00:00
// This file is a placeholder. DTLS-specific stuff (timer management,
// ACKs, retransmits, etc. will eventually go here.
const (
initialMtu = 1200
)
2018-01-17 04:32:31 +00:00
func wireVersion(h *HandshakeLayer) uint16 {
if h.datagram {
return dtls12WireVersion
}
return tls12Version
}
func dtlsConvertVersion(version uint16) uint16 {
if version == tls12Version {
return dtls12WireVersion
}
if version == tls10Version {
return 0xfeff
}
panic(fmt.Sprintf("Internal error, unexpected version=%d", version))
}