| 1 |
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly> |
| 2 |
// SPDX-License-Identifier: MIT |
| 3 |
|
| 4 |
package sctp |
| 5 |
|
| 6 |
// errorCauseUnrecognizedChunkType represents an SCTP error cause. |
| 7 |
type errorCauseUnrecognizedChunkType struct { |
| 8 |
errorCauseHeader |
| 9 |
unrecognizedChunk []byte |
| 10 |
} |
| 11 |
|
| 12 |
func (e *errorCauseUnrecognizedChunkType) marshal() ([]byte, error) { |
| 13 |
e.code = unrecognizedChunkType |
| 14 |
e.errorCauseHeader.raw = e.unrecognizedChunk |
| 15 |
|
| 16 |
return e.errorCauseHeader.marshal() |
| 17 |
} |
| 18 |
|
| 19 |
func (e *errorCauseUnrecognizedChunkType) unmarshal(raw []byte) error { |
| 20 |
err := e.errorCauseHeader.unmarshal(raw) |
| 21 |
if err != nil { |
| 22 |
return err |
| 23 |
} |
| 24 |
|
| 25 |
e.unrecognizedChunk = e.errorCauseHeader.raw |
| 26 |
|
| 27 |
return nil |
| 28 |
} |
| 29 |
|
| 30 |
// String makes errorCauseUnrecognizedChunkType printable. |
| 31 |
func (e *errorCauseUnrecognizedChunkType) String() string { |
| 32 |
return e.errorCauseHeader.String() |
| 33 |
} |