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

package sctp

import (
	
	
)

/*
chunkShutdownComplete represents an SCTP Chunk of type chunkShutdownComplete

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 = 14   |Reserved     |T|      Length = 4               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.
*/
type chunkShutdownComplete struct {
	chunkHeader
}

// Shutdown complete chunk errors.
var (
	ErrChunkTypeNotShutdownComplete = errors.New("ChunkType is not of type SHUTDOWN-COMPLETE")
)

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

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

	return nil
}

func ( *chunkShutdownComplete) () ([]byte, error) {
	.typ = ctShutdownComplete

	return .chunkHeader.marshal()
}

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

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