github.com/pion/dtls/v2@v2.2.12/pkg/protocol/version.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 // Package protocol provides the DTLS wire format 5 package protocol 6 7 // Version enums 8 var ( 9 Version1_0 = Version{Major: 0xfe, Minor: 0xff} //nolint:gochecknoglobals 10 Version1_2 = Version{Major: 0xfe, Minor: 0xfd} //nolint:gochecknoglobals 11 ) 12 13 // Version is the minor/major value in the RecordLayer 14 // and ClientHello/ServerHello 15 // 16 // https://tools.ietf.org/html/rfc4346#section-6.2.1 17 type Version struct { 18 Major, Minor uint8 19 } 20 21 // Equal determines if two protocol versions are equal 22 func (v Version) Equal(x Version) bool { 23 return v.Major == x.Major && v.Minor == x.Minor 24 }