Source File
param_zero_checksum.go
Belonging Package
github.com/pion/sctp
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage sctpimport ()// This parameter is used to inform the receiver that a sender is willing to// accept zero as checksum if some other error detection method is used// instead.//// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Type = 0x8001 (suggested) | Length = 8 |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Error Detection Method Identifier (EDMID) |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+type paramZeroChecksumAcceptable struct {paramHeader// The Error Detection Method Identifier (EDMID) specifies an alternate// error detection method the sender of this parameter is willing to use for// received packets.edmid uint32}// Zero Checksum parameter error.var (ErrZeroChecksumParamTooShort = errors.New("zero checksum parameter too short"))const (dtlsErrorDetectionMethod uint32 = 1)func ( *paramZeroChecksumAcceptable) () ([]byte, error) {.typ = zeroChecksumAcceptable.raw = make([]byte, 4)binary.BigEndian.PutUint32(.raw, .edmid)return .paramHeader.marshal()}func ( *paramZeroChecksumAcceptable) ( []byte) (param, error) {:= .paramHeader.unmarshal()if != nil {return nil,}if len(.raw) < 4 {return nil, ErrZeroChecksumParamTooShort}.edmid = binary.BigEndian.Uint32(.raw)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. |