github.com/pion/dtls/v2@v2.2.12/pkg/protocol/content.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 package protocol 5 6 // ContentType represents the IANA Registered ContentTypes 7 // 8 // https://tools.ietf.org/html/rfc4346#section-6.2.1 9 type ContentType uint8 10 11 // ContentType enums 12 const ( 13 ContentTypeChangeCipherSpec ContentType = 20 14 ContentTypeAlert ContentType = 21 15 ContentTypeHandshake ContentType = 22 16 ContentTypeApplicationData ContentType = 23 17 ) 18 19 // Content is the top level distinguisher for a DTLS Datagram 20 type Content interface { 21 ContentType() ContentType 22 Marshal() ([]byte, error) 23 Unmarshal(data []byte) error 24 }