// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package sctp

import (
	
	
)

/*
chunkShutdownAck represents an SCTP Chunk of type chunkShutdownAck

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 = 8    | Chunk  Flags  |      Length = 4               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.
*/
type chunkShutdownAck struct {
	chunkHeader
}

// Shutdown ack chunk errors.
var (
	ErrChunkTypeNotShutdownAck = errors.New("ChunkType is not of type SHUTDOWN-ACK")
)

func ( *chunkShutdownAck) ( []byte) error {
	if  := .chunkHeader.unmarshal();  != nil {
		return 
	}

	if .typ != ctShutdownAck {
		return fmt.Errorf("%w: actually is %s", ErrChunkTypeNotShutdownAck, .typ.String())
	}

	return nil
}

func ( *chunkShutdownAck) () ([]byte, error) {
	.typ = ctShutdownAck

	return .chunkHeader.marshal()
}

func ( *chunkShutdownAck) () ( bool,  error) {
	return false, nil
}

// String makes chunkShutdownAck printable.
func ( *chunkShutdownAck) () string {
	return .chunkHeader.String()
}