Source File
renegotiation_info.go
Belonging Package
github.com/pion/dtls/v2/pkg/protocol/extension
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage extensionimportconst (renegotiationInfoHeaderSize = 5)// RenegotiationInfo allows a Client/Server to// communicate their renegotation support//// https://tools.ietf.org/html/rfc5746type RenegotiationInfo struct {RenegotiatedConnection uint8}// TypeValue returns the extension TypeValuefunc ( RenegotiationInfo) () TypeValue {return RenegotiationInfoTypeValue}// Marshal encodes the extensionfunc ( *RenegotiationInfo) () ([]byte, error) {:= make([]byte, renegotiationInfoHeaderSize)binary.BigEndian.PutUint16(, uint16(.TypeValue()))binary.BigEndian.PutUint16([2:], uint16(1)) // length[4] = .RenegotiatedConnectionreturn , nil}// Unmarshal populates the extension from encoded datafunc ( *RenegotiationInfo) ( []byte) error {if len() < renegotiationInfoHeaderSize {return errBufferTooSmall} else if TypeValue(binary.BigEndian.Uint16()) != .TypeValue() {return errInvalidExtensionType}.RenegotiatedConnection = [4]return nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |