summaryrefslogtreecommitdiff
path: root/vendor/github.com/pion/sctp/error_cause_unrecognized_chunk_type.go
blob: fee9a360365583a2f54c6513d94a888a70ae59e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package sctp

// errorCauseUnrecognizedChunkType represents an SCTP error cause
type errorCauseUnrecognizedChunkType struct {
	errorCauseHeader
	unrecognizedChunk []byte
}

func (e *errorCauseUnrecognizedChunkType) marshal() ([]byte, error) {
	e.code = unrecognizedChunkType
	e.errorCauseHeader.raw = e.unrecognizedChunk
	return e.errorCauseHeader.marshal()
}

func (e *errorCauseUnrecognizedChunkType) unmarshal(raw []byte) error {
	err := e.errorCauseHeader.unmarshal(raw)
	if err != nil {
		return err
	}

	e.unrecognizedChunk = e.errorCauseHeader.raw
	return nil
}

// String makes errorCauseUnrecognizedChunkType printable
func (e *errorCauseUnrecognizedChunkType) String() string {
	return e.errorCauseHeader.String()
}