// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage sctp // nolint:duplimport ()/*Abort represents an SCTP Chunk of type ABORTThe ABORT chunk is sent to the peer of an association to close theassociation. The ABORT chunk may contain Cause Parameters to informthe receiver about the reason of the abort. DATA chunks MUST NOT bebundled with ABORT. Control chunks (except for INIT, INIT ACK, andSHUTDOWN COMPLETE) MAY be bundled with an ABORT, but they MUST beplaced before the ABORT in the SCTP packet or they will be ignored bythe receiver. 0 1 2 3 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 = 6 |Reserved |T| Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | zero or more Error Causes | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/type chunkAbort struct {chunkHeader errorCauses []errorCause}// Abort chunk errors.var (ErrChunkTypeNotAbort = errors.New("ChunkType is not of type ABORT")ErrBuildAbortChunkFailed = errors.New("failed build Abort Chunk"))func ( *chunkAbort) ( []byte) error {if := .chunkHeader.unmarshal(); != nil {return }if .typ != ctAbort {returnfmt.Errorf("%w: actually is %s", ErrChunkTypeNotAbort, .typ.String()) } := chunkHeaderSizefor {iflen()- < 4 {break } , := buildErrorCause([:])if != nil {returnfmt.Errorf("%w: %v", ErrBuildAbortChunkFailed, ) //nolint:errorlint } += int(.length()) .errorCauses = append(.errorCauses, ) }returnnil}func ( *chunkAbort) () ([]byte, error) { .chunkHeader.typ = ctAbort .flags = 0x00 .raw = []byte{}for , := range .errorCauses { , := .marshal()if != nil {returnnil, } .raw = append(.raw, ...) }return .chunkHeader.marshal()}func ( *chunkAbort) () ( bool, error) {returnfalse, nil}// String makes chunkAbort printable.func ( *chunkAbort) () string { := .chunkHeader.String()for , := range .errorCauses { += fmt.Sprintf("\n - %s", ) }return}
The pages are generated with Goldsv0.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.