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 TransactionID string `xml:"TransactionID"`
73 RANfunctionsList struct {
74 Text string `xml:",chardata"`
75 RANfunctionsItemProtocolIESingleContainer []RANfunctionsItemProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
76 } `xml:"RANfunctions-List"`
77 RANfunctionsIDList struct {
78 Text string `xml:",chardata"`
79 RANfunctionsItemIDProtocolIESingleContainer []RANfunctionsItemIDProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
80 } `xml:"RANfunctionsID-List"`
84 type RICServiceUpdateInitiatingMessage struct {
85 Text string `xml:",chardata"`
86 ProcedureCode string `xml:"procedureCode"`
88 Text string `xml:",chardata"`
89 Reject string `xml:"reject"`
92 Text string `xml:",chardata"`
93 RICServiceUpdate struct {
94 Text string `xml:",chardata"`
96 Text string `xml:",chardata"`
97 RICServiceUpdateIEs []RICServiceUpdateIEs `xml:"RICserviceUpdate-IEs"`
99 } `xml:"RICserviceUpdate"`
103 type RICServiceUpdateE2APPDU struct {
104 XMLName xml.Name `xml:"E2AP-PDU"`
105 Text string `xml:",chardata"`
106 InitiatingMessage RICServiceUpdateInitiatingMessage `xml:"initiatingMessage"`
109 type RICServiceUpdateMessage struct {
110 XMLName xml.Name `xml:"RICserviceUpdateMessage"`
111 Text string `xml:",chardata"`
112 E2APPDU RICServiceUpdateE2APPDU `xml:"E2AP-PDU"`
115 func (m *RICServiceUpdateE2APPDU) ExtractRanFunctionsList() []*entities.RanFunction {
116 serviceUpdateRequestIes := m.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs
117 if len(serviceUpdateRequestIes) < 3 {
121 ranFunctionsListContainer := serviceUpdateRequestIes[2].Value.RANfunctionsList.RANfunctionsItemProtocolIESingleContainer
122 funcs := make([]*entities.RanFunction, len(ranFunctionsListContainer))
123 for i := 0; i < len(funcs); i++ {
124 ranFunctionItem := ranFunctionsListContainer[i].Value.RANfunctionItem
126 funcs[i] = &entities.RanFunction{
127 RanFunctionId: ranFunctionItem.RanFunctionID,
128 RanFunctionDefinition: ranFunctionItem.RanFunctionDefinition,
129 RanFunctionRevision: ranFunctionItem.RanFunctionRevision,
130 RanFunctionOid: ranFunctionItem.RanFunctionOID,