10 Star 38 Fork 19

Gitee 极速下载 / Pion-WebRTC

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/pion/webrtc
克隆/下载
error_cause_protocol_violation.go 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
backkem 提交于 2018-09-24 21:01 . SCTP: Notifier & Initialization
package sctp
import (
"fmt"
"github.com/pkg/errors"
)
/*
This error cause MAY be included in ABORT chunks that are sent
because an SCTP endpoint detects a protocol violation of the peer
that is not covered by the error causes described in Section 3.3.10.1
to Section 3.3.10.12. An implementation MAY provide additional
information specifying what kind of protocol violation has been
detected.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Cause Code=13 | Cause Length=Variable |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
/ Additional Information /
\ \
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
type errorCauseProtocolViolation struct {
errorCauseHeader
additionalInformation []byte
}
func (e *errorCauseProtocolViolation) marshal() ([]byte, error) {
e.raw = e.additionalInformation
return e.errorCauseHeader.marshal()
}
func (e *errorCauseProtocolViolation) unmarshal(raw []byte) error {
err := e.errorCauseHeader.unmarshal(raw)
if err != nil {
return errors.Wrap(err, "Unable to unmarshal Protocol Violation error")
}
e.additionalInformation = e.raw
return nil
}
// String makes errorCauseProtocolViolation printable
func (e *errorCauseProtocolViolation) String() string {
return fmt.Sprintf("%s: %s", e.errorCauseHeader, e.additionalInformation)
}
1
https://gitee.com/mirrors/Pion-WebRTC.git
git@gitee.com:mirrors/Pion-WebRTC.git
mirrors
Pion-WebRTC
Pion-WebRTC
v1.1.1

搜索帮助