Source File
param_reconfig_response.go
Belonging Package
github.com/pion/sctp
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage sctpimport ()// This parameter is used by the receiver of a Re-configuration Request// Parameter to respond to the request.//// 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 = 16 | Parameter Length |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Re-configuration Response Sequence Number |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Result |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Sender's Next TSN (optional) |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+// | Receiver's Next TSN (optional) |// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+type paramReconfigResponse struct {paramHeader// This value is copied from the request parameter and is used by the// receiver of the Re-configuration Response Parameter to tie the// response to the request.reconfigResponseSequenceNumber uint32// This value describes the result of the processing of the request.result reconfigResult}type reconfigResult uint32const (reconfigResultSuccessNOP reconfigResult = 0reconfigResultSuccessPerformed reconfigResult = 1reconfigResultDenied reconfigResult = 2reconfigResultErrorWrongSSN reconfigResult = 3reconfigResultErrorRequestAlreadyInProgress reconfigResult = 4reconfigResultErrorBadSequenceNumber reconfigResult = 5reconfigResultInProgress reconfigResult = 6)// Reconfiguration response errors.var (ErrReconfigRespParamTooShort = errors.New("reconfig response parameter too short"))func ( reconfigResult) () string {switch {case reconfigResultSuccessNOP:return "0: Success - Nothing to do"case reconfigResultSuccessPerformed:return "1: Success - Performed"case reconfigResultDenied:return "2: Denied"case reconfigResultErrorWrongSSN:return "3: Error - Wrong SSN"case reconfigResultErrorRequestAlreadyInProgress:return "4: Error - Request already in progress"case reconfigResultErrorBadSequenceNumber:return "5: Error - Bad Sequence Number"case reconfigResultInProgress:return "6: In progress"default:return fmt.Sprintf("Unknown reconfigResult: %d", )}}func ( *paramReconfigResponse) () ([]byte, error) {.typ = reconfigResp.raw = make([]byte, 8)binary.BigEndian.PutUint32(.raw, .reconfigResponseSequenceNumber)binary.BigEndian.PutUint32(.raw[4:], uint32(.result))return .paramHeader.marshal()}func ( *paramReconfigResponse) ( []byte) (param, error) {:= .paramHeader.unmarshal()if != nil {return nil,}if len(.raw) < 8 {return nil, ErrReconfigRespParamTooShort}.reconfigResponseSequenceNumber = binary.BigEndian.Uint32(.raw).result = reconfigResult(binary.BigEndian.Uint32(.raw[4:]))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. |