forked from wmnsk/go-m3ua
/
error-code.go
50 lines (46 loc) · 1.06 KB
/
error-code.go
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2018-2020 go-m3ua authors. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
package params
// Error Code definitions.
const (
_ uint32 = iota
ErrInvalidVersion
_
ErrUnsupportedMessageClass
ErrUnsupportedMessageType
ErrUnsupportedTrafficModeType
ErrUnexpectedMessage
ErrProtocolError
_
ErrInvalidStreamIdentifier
_
_
_
ErrRefusedManagementBlocking
ErrAspIdentifierRequired
ErrInvalidAspIdentifier
_
ErrInvalidParameterValue
ErrParameterFieldError
ErrUnexpectedParameter
ErrDestinationStatusUnknown
ErrInvalidNetworkAppearance
ErrMissingParameter
_
_
ErrInvalidRoutingContext
ErrNoConfiguredAsForAsp
)
// NewErrorCode creates the ErrorCode Parameter.
// Note that this returns *Param, as no specific structure in this parameter.
func NewErrorCode(ec uint32) *Param {
return newUint32ValParam(ErrorCode, ec)
}
// ErrorCode returns multiple ErrorCode from Param.
func (p *Param) ErrorCode() uint32 {
if p.Tag != ErrorCode {
return 0
}
return p.decodeUint32ValData()
}