Source File
param_outgoing_reset_request.go
Belonging Package
github.com/pion/sctp
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage sctpimport ()const (paramOutgoingResetRequestStreamIdentifiersOffset = 12)// This parameter is used by the sender to request the reset of some or// all outgoing streams.// 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// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Parameter Type = 13 | Parameter Length = 16 + 2 * N |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Re-configuration Request Sequence Number |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Re-configuration Response Sequence Number |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Sender's Last Assigned TSN |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Stream Number 1 (optional) | Stream Number 2 (optional) |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// / ...... /// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Stream Number N-1 (optional) | Stream Number N (optional) |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+type paramOutgoingResetRequest struct {paramHeader// reconfigRequestSequenceNumber is used to identify the request. It is a monotonically// increasing number that is initialized to the same value as the// initial TSN. It is increased by 1 whenever sending a new Re-// configuration Request Parameter.reconfigRequestSequenceNumber uint32// When this Outgoing SSN Reset Request Parameter is sent in response// to an Incoming SSN Reset Request Parameter, this parameter is also// an implicit response to the incoming request. This field then// holds the Re-configuration Request Sequence Number of the incoming// request. In other cases, it holds the next expected// Re-configuration Request Sequence Number minus 1.reconfigResponseSequenceNumber uint32// This value holds the next TSN minus 1 -- in other words, the last// TSN that this sender assigned.senderLastTSN uint32// This optional field, if included, is used to indicate specific// streams that are to be reset. If no streams are listed, then all// streams are to be reset.streamIdentifiers []uint16}// Outgoing reset request parameter errors.var (ErrSSNResetRequestParamTooShort = errors.New("outgoing SSN reset request parameter too short"))func ( *paramOutgoingResetRequest) () ([]byte, error) {.typ = outSSNResetReq.raw = make([]byte, paramOutgoingResetRequestStreamIdentifiersOffset+2*len(.streamIdentifiers))binary.BigEndian.PutUint32(.raw, .reconfigRequestSequenceNumber)binary.BigEndian.PutUint32(.raw[4:], .reconfigResponseSequenceNumber)binary.BigEndian.PutUint32(.raw[8:], .senderLastTSN)for , := range .streamIdentifiers {binary.BigEndian.PutUint16(.raw[paramOutgoingResetRequestStreamIdentifiersOffset+2*:], )}return .paramHeader.marshal()}func ( *paramOutgoingResetRequest) ( []byte) (param, error) {:= .paramHeader.unmarshal()if != nil {return nil,}if len(.raw) < paramOutgoingResetRequestStreamIdentifiersOffset {return nil, ErrSSNResetRequestParamTooShort}.reconfigRequestSequenceNumber = binary.BigEndian.Uint32(.raw).reconfigResponseSequenceNumber = binary.BigEndian.Uint32(.raw[4:]).senderLastTSN = binary.BigEndian.Uint32(.raw[8:]):= (len(.raw) - paramOutgoingResetRequestStreamIdentifiersOffset) / 2.streamIdentifiers = make([]uint16, )for := 0; < ; ++ {.streamIdentifiers[] = binary.BigEndian.Uint16(.raw[paramOutgoingResetRequestStreamIdentifiersOffset+2*:])}return , nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |