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
// Copyright 2019-2020 UPF-N4 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 ie
// NewQoSMonitoringPerQoSFlowControlInformation creates a new QoSMonitoringPerQoSFlowControlInformation IE.
func NewQoSMonitoringPerQoSFlowControlInformation(ies ...*IE) *IE {
return newGroupedIE(QoSMonitoringPerQoSFlowControlInformation, 0, ies)
}
// QoSMonitoringPerQoSFlowControlInformation returns the IEs above QoSMonitoringPerQoSFlowControlInformation if the type of IE matches.
func (i *IE) QoSMonitoringPerQoSFlowControlInformation() ([]*IE, error) {
switch i.Type {
case QoSMonitoringPerQoSFlowControlInformation:
return ParseMultiIEs(i.Payload)
case CreateSRR:
ies, err := i.CreateSRR()
if err != nil {
return nil, err
}
for _, x := range ies {
if x.Type == QoSMonitoringPerQoSFlowControlInformation {
return x.QoSMonitoringPerQoSFlowControlInformation()
}
}
return nil, ErrIENotFound
case UpdateSRR:
ies, err := i.UpdateSRR()
if err != nil {
return nil, err
}
for _, x := range ies {
if x.Type == QoSMonitoringPerQoSFlowControlInformation {
return x.QoSMonitoringPerQoSFlowControlInformation()
}
}
return nil, ErrIENotFound
default:
return nil, &InvalidTypeError{Type: i.Type}
}
}