2 // Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
16 // This source code is part of the near-RT RIC (RAN Intelligent Controller)
17 // platform project (RICP).
23 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
26 type RANfunctionsItemProtocolIESingleContainer struct {
27 Text string `xml:",chardata"`
30 Text string `xml:",chardata"`
31 Ignore string `xml:"ignore"`
34 Text string `xml:",chardata"`
35 RANfunctionItem struct {
36 Text string `xml:",chardata"`
37 RanFunctionID uint32 `xml:"ranFunctionID"`
38 RanFunctionDefinition string `xml:"ranFunctionDefinition"`
39 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
40 } `xml:"RANfunction-Item"`
44 type RANfunctionsItemIDProtocolIESingleContainer struct {
45 Text string `xml:",chardata"`
48 Text string `xml:",chardata"`
49 Ignore string `xml:"ignore"`
52 Text string `xml:",chardata"`
53 RANfunctionIDItem struct {
54 Text string `xml:",chardata"`
55 RanFunctionID uint32 `xml:"ranFunctionID"`
56 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
57 } `xml:"RANfunctionID-Item"`
62 type RICServiceUpdateIEs struct {
63 Text string `xml:",chardata"`
66 Text string `xml:",chardata"`
67 Reject string `xml:"reject"`
70 Text string `xml:",chardata"`
71 RANfunctionsList struct {
72 Text string `xml:",chardata"`
73 RANfunctionsItemProtocolIESingleContainer []RANfunctionsItemProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
74 } `xml:"RANfunctions-List"`
75 RANfunctionsIDList struct {
76 Text string `xml:",chardata"`
77 RANfunctionsItemIDProtocolIESingleContainer []RANfunctionsItemIDProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
78 } `xml:"RANfunctionsID-List"`
82 type RICServiceUpdateInitiatingMessage struct {
83 Text string `xml:",chardata"`
84 ProcedureCode string `xml:"procedureCode"`
86 Text string `xml:",chardata"`
87 Reject string `xml:"reject"`
90 Text string `xml:",chardata"`
91 RICServiceUpdate struct {
92 Text string `xml:",chardata"`
94 Text string `xml:",chardata"`
95 RICServiceUpdateIEs []RICServiceUpdateIEs `xml:"RICserviceUpdate-IEs"`
97 } `xml:"RICserviceUpdate"`
101 type RICServiceUpdateE2APPDU struct {
102 XMLName xml.Name `xml:"E2AP-PDU"`
103 Text string `xml:",chardata"`
104 InitiatingMessage RICServiceUpdateInitiatingMessage `xml:"initiatingMessage"`
107 type RICServiceUpdateMessage struct{
108 XMLName xml.Name `xml:"RICserviceUpdateMessage"`
109 Text string `xml:",chardata"`
110 E2APPDU RICServiceUpdateE2APPDU `xml:"E2AP-PDU"`
113 func (m *RICServiceUpdateE2APPDU) ExtractRanFunctionsList() []*entities.RanFunction {
114 serviceUpdateRequestIes := m.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs
115 if len(serviceUpdateRequestIes) < 2 {
119 ranFunctionsListContainer := serviceUpdateRequestIes[1].Value.RANfunctionsList.RANfunctionsItemProtocolIESingleContainer
120 funcs := make([]*entities.RanFunction, len(ranFunctionsListContainer))
121 for i := 0; i < len(funcs); i++ {
122 ranFunctionItem := ranFunctionsListContainer[i].Value.RANfunctionItem
124 funcs[i] = &entities.RanFunction{
125 RanFunctionId: ranFunctionItem.RanFunctionID,
126 RanFunctionDefinition: ranFunctionItem.RanFunctionDefinition,
127 RanFunctionRevision: ranFunctionItem.RanFunctionRevision,