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).
24 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
27 type RANfunctionsItemProtocolIESingleContainer struct {
28 Text string `xml:",chardata"`
31 Text string `xml:",chardata"`
32 Ignore string `xml:"ignore"`
35 Text string `xml:",chardata"`
36 RANfunctionItem struct {
37 Text string `xml:",chardata"`
38 RanFunctionID uint32 `xml:"ranFunctionID"`
39 RanFunctionDefinition string `xml:"ranFunctionDefinition"`
40 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
41 RanFunctionOID string `xml:"ranFunctionOID"`
42 } `xml:"RANfunction-Item"`
46 type RANfunctionsItemIDProtocolIESingleContainer struct {
47 Text string `xml:",chardata"`
50 Text string `xml:",chardata"`
51 Ignore string `xml:"ignore"`
54 Text string `xml:",chardata"`
55 RANfunctionIDItem struct {
56 Text string `xml:",chardata"`
57 RanFunctionID uint32 `xml:"ranFunctionID"`
58 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
59 } `xml:"RANfunctionID-Item"`
63 type RICServiceUpdateIEs struct {
64 Text string `xml:",chardata"`
67 Text string `xml:",chardata"`
68 Reject string `xml:"reject"`
71 Text string `xml:",chardata"`
72 RANfunctionsList struct {
73 Text string `xml:",chardata"`
74 RANfunctionsItemProtocolIESingleContainer []RANfunctionsItemProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
75 } `xml:"RANfunctions-List"`
76 RANfunctionsIDList struct {
77 Text string `xml:",chardata"`
78 RANfunctionsItemIDProtocolIESingleContainer []RANfunctionsItemIDProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
79 } `xml:"RANfunctionsID-List"`
83 type RICServiceUpdateInitiatingMessage struct {
84 Text string `xml:",chardata"`
85 ProcedureCode string `xml:"procedureCode"`
87 Text string `xml:",chardata"`
88 Reject string `xml:"reject"`
91 Text string `xml:",chardata"`
92 RICServiceUpdate struct {
93 Text string `xml:",chardata"`
95 Text string `xml:",chardata"`
96 RICServiceUpdateIEs []RICServiceUpdateIEs `xml:"RICserviceUpdate-IEs"`
98 } `xml:"RICserviceUpdate"`
102 type RICServiceUpdateE2APPDU struct {
103 XMLName xml.Name `xml:"E2AP-PDU"`
104 Text string `xml:",chardata"`
105 InitiatingMessage RICServiceUpdateInitiatingMessage `xml:"initiatingMessage"`
108 type RICServiceUpdateMessage struct {
109 XMLName xml.Name `xml:"RICserviceUpdateMessage"`
110 Text string `xml:",chardata"`
111 E2APPDU RICServiceUpdateE2APPDU `xml:"E2AP-PDU"`
114 func (m *RICServiceUpdateE2APPDU) ExtractRanFunctionsList() []*entities.RanFunction {
115 serviceUpdateRequestIes := m.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs
116 if len(serviceUpdateRequestIes) < 2 {
120 ranFunctionsListContainer := serviceUpdateRequestIes[1].Value.RANfunctionsList.RANfunctionsItemProtocolIESingleContainer
121 funcs := make([]*entities.RanFunction, len(ranFunctionsListContainer))
122 for i := 0; i < len(funcs); i++ {
123 ranFunctionItem := ranFunctionsListContainer[i].Value.RANfunctionItem
125 funcs[i] = &entities.RanFunction{
126 RanFunctionId: ranFunctionItem.RanFunctionID,
127 RanFunctionDefinition: ranFunctionItem.RanFunctionDefinition,
128 RanFunctionRevision: ranFunctionItem.RanFunctionRevision,
129 RanFunctionOid: ranFunctionItem.RanFunctionOID,