代码拉取完成,页面将自动刷新
package sctp
import (
"fmt"
"github.com/pkg/errors"
)
/*
Abort represents an SCTP Chunk of type ABORT
The ABORT chunk is sent to the peer of an association to close the
association. The ABORT chunk may contain Cause Parameters to inform
the receiver about the reason of the abort. DATA chunks MUST NOT be
bundled with ABORT. Control chunks (except for INIT, INIT ACK, and
SHUTDOWN COMPLETE) MAY be bundled with an ABORT, but they MUST be
placed before the ABORT in the SCTP packet or they will be ignored by
the receiver.
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 = 6 |Reserved |T| Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| zero or more Error Causes |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
type chunkAbort struct {
chunkHeader
errorCauses []errorCause
}
func (a *chunkAbort) unmarshal(raw []byte) error {
if err := a.chunkHeader.unmarshal(raw); err != nil {
return err
}
if a.typ != ABORT {
return errors.Errorf("ChunkType is not of type ABORT, actually is %s", a.typ.String())
}
offset := chunkHeaderSize
for {
if len(raw)-offset < 4 {
break
}
e, err := buildErrorCause(raw[offset:])
if err != nil {
return errors.Wrap(err, "Failed build Abort Chunk")
}
offset += int(e.length())
a.errorCauses = append(a.errorCauses, e)
}
return nil
}
func (a *chunkAbort) marshal() ([]byte, error) {
return nil, errors.Errorf("Unimplemented")
}
func (a *chunkAbort) check() (abort bool, err error) {
return false, nil
}
// String makes chunkAbort printable
func (a *chunkAbort) String() string {
res := a.chunkHeader.String()
for _, cause := range a.errorCauses {
res += fmt.Sprintf("\n - %s", cause)
}
return res
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。