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).
25 type RicServiceAckRANFunctionIDItem struct {
26 Text string `xml:",chardata"`
27 RanFunctionID uint32 `xml:"ranFunctionID"`
28 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
31 type RICserviceUpdateAcknowledgeProtocolIESingleContainer struct {
32 Text string `xml:",chardata"`
35 Text string `xml:",chardata"`
36 //Ignore string `xml:"ignore"`
37 Reject string `xml:"reject"`
40 Text string `xml:",chardata"`
41 RANfunctionIDItem RicServiceAckRANFunctionIDItem `xml:"RANfunctionID-Item"`
45 type RICserviceUpdateAcknowledgeIEs struct {
46 Text string `xml:",chardata"`
49 Text string `xml:",chardata"`
50 Reject string `xml:"reject"`
53 Text string `xml:",chardata"`
54 RANfunctionsIDList struct {
55 Text string `xml:",chardata"`
56 ProtocolIESingleContainer []RICserviceUpdateAcknowledgeProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
57 } `xml:"RANfunctionsID-List"`
61 type RicServiceUpdateAckSuccessfulOutcome struct {
62 XMLName xml.Name `xml:"successfulOutcome"`
63 Text string `xml:",chardata"`
64 ProcedureCode string `xml:"procedureCode"`
66 Text string `xml:",chardata"`
67 Reject string `xml:"reject"`
70 Text string `xml:",chardata"`
71 RICserviceUpdateAcknowledge RICserviceUpdateAcknowledge `xml:"RICserviceUpdateAcknowledge"`
75 type RICserviceUpdateAcknowledge struct {
76 Text string `xml:",chardata"`
78 Text string `xml:",chardata"`
79 RICserviceUpdateAcknowledgeIEs []RICserviceUpdateAcknowledgeIEs `xml:"RICserviceUpdateAcknowledge-IEs"`
83 type RicServiceUpdateAckE2APPDU struct {
84 XMLName xml.Name `xml:"E2AP-PDU"`
85 Text string `xml:",chardata"`
86 InitiatingMessage interface{}
89 func NewServiceUpdateAck(ricServiceUpdate []RicServiceAckRANFunctionIDItem) RicServiceUpdateAckE2APPDU {
90 successfulOutcome := RicServiceUpdateAckSuccessfulOutcome{}
91 successfulOutcome.ProcedureCode = "7"
92 if len(ricServiceUpdate) == 0 {
93 return RicServiceUpdateAckE2APPDU{InitiatingMessage:successfulOutcome}
96 ricServiceUpdateAcknowledgeIEs := make([]RICserviceUpdateAcknowledgeIEs, 1)
97 ricServiceUpdateAcknowledgeIEs[0].ID = "9"
98 protocolIESingleContainer := make([]RICserviceUpdateAcknowledgeProtocolIESingleContainer, len(ricServiceUpdate))
99 for i := 0; i < len(ricServiceUpdate); i++ {
100 protocolIESingleContainer[i].Value.RANfunctionIDItem = ricServiceUpdate[i]
101 protocolIESingleContainer[i].Id = "6"
103 ricServiceUpdateAcknowledgeIEs[0].Value.RANfunctionsIDList.ProtocolIESingleContainer = protocolIESingleContainer
104 successfulOutcome.Value.RICserviceUpdateAcknowledge.ProtocolIEs.RICserviceUpdateAcknowledgeIEs = ricServiceUpdateAcknowledgeIEs
105 return RicServiceUpdateAckE2APPDU{InitiatingMessage:successfulOutcome}