Source File
checks.go
Belonging Package
github.com/pion/stun
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MIT//go:build !debug// +build !debugpackage stunimport ()// CheckSize returns ErrAttrSizeInvalid if got is not equal to expected.func ( AttrType, , int) error {if == {return nil}return ErrAttributeSizeInvalid}func checkHMAC(, []byte) error {if hmac.Equal(, ) {return nil}return ErrIntegrityMismatch}func checkFingerprint(, uint32) error {if == {return nil}return ErrFingerprintMismatch}// IsAttrSizeInvalid returns true if error means that attribute size is invalid.func ( error) bool {return errors.Is(, ErrAttributeSizeInvalid)}// CheckOverflow returns ErrAttributeSizeOverflow if got is bigger that max.func ( AttrType, , int) error {if <= {return nil}return ErrAttributeSizeOverflow}// IsAttrSizeOverflow returns true if error means that attribute size is too big.func ( error) bool {return errors.Is(, ErrAttributeSizeOverflow)}
![]() |
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. |