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"`
52 Value interface{} `xml:"value"`
55 type RICserviceUpdateAcknowledgeTransactionID struct {
56 Text string `xml:",chardata"`
57 TransactionID string `xml:"TransactionID"`
60 type RICserviceUpdateAcknowledgeRANfunctionsList struct {
61 Text string `xml:",chardata"`
62 RANfunctionsIDList struct {
63 Text string `xml:",chardata"`
64 ProtocolIESingleContainer []RICserviceUpdateAcknowledgeProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
65 } `xml:"RANfunctionsID-List"`
67 type RicServiceUpdateAckSuccessfulOutcome struct {
68 XMLName xml.Name `xml:"successfulOutcome"`
69 Text string `xml:",chardata"`
70 ProcedureCode string `xml:"procedureCode"`
72 Text string `xml:",chardata"`
73 Reject string `xml:"reject"`
76 Text string `xml:",chardata"`
77 RICserviceUpdateAcknowledge RICserviceUpdateAcknowledge `xml:"RICserviceUpdateAcknowledge"`
81 type RICserviceUpdateAcknowledge struct {
82 Text string `xml:",chardata"`
84 Text string `xml:",chardata"`
85 RICserviceUpdateAcknowledgeIEs []RICserviceUpdateAcknowledgeIEs `xml:"RICserviceUpdateAcknowledge-IEs"`
89 type RicServiceUpdateAckE2APPDU struct {
90 XMLName xml.Name `xml:"E2AP-PDU"`
91 Text string `xml:",chardata"`
92 SuccessfulOutcome interface{}
95 func NewServiceUpdateAck(ricServiceUpdate []RicServiceAckRANFunctionIDItem, txId string) RicServiceUpdateAckE2APPDU {
97 txIE := RICserviceUpdateAcknowledgeIEs{
98 ID: ProtocolIE_ID_id_TransactionID,
99 Value: RICserviceUpdateAcknowledgeTransactionID{
104 protocolIESingleContainer := make([]RICserviceUpdateAcknowledgeProtocolIESingleContainer, len(ricServiceUpdate))
105 for i := 0; i < len(ricServiceUpdate); i++ {
106 protocolIESingleContainer[i].Value.RANfunctionIDItem = ricServiceUpdate[i]
107 protocolIESingleContainer[i].Id = ProtocolIE_ID_id_RANfunctionID_Item
110 // mandatory RANFunctionsAccepted
111 functionListIE := RICserviceUpdateAcknowledgeIEs{
112 ID: ProtocolIE_ID_id_RANfunctionsAccepted,
113 Value: RICserviceUpdateAcknowledgeRANfunctionsList{
114 RANfunctionsIDList: struct {
115 Text string `xml:",chardata"`
116 ProtocolIESingleContainer []RICserviceUpdateAcknowledgeProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
118 ProtocolIESingleContainer: protocolIESingleContainer,
123 successfulOutcome := RicServiceUpdateAckSuccessfulOutcome{
124 ProcedureCode: ProcedureCode_id_RICserviceUpdate,
126 Text string `xml:",chardata"`
127 RICserviceUpdateAcknowledge RICserviceUpdateAcknowledge `xml:"RICserviceUpdateAcknowledge"`
129 RICserviceUpdateAcknowledge: RICserviceUpdateAcknowledge{
130 ProtocolIEs: struct {
131 Text string `xml:",chardata"`
132 RICserviceUpdateAcknowledgeIEs []RICserviceUpdateAcknowledgeIEs `xml:"RICserviceUpdateAcknowledge-IEs"`
134 RICserviceUpdateAcknowledgeIEs: []RICserviceUpdateAcknowledgeIEs{txIE, functionListIE},
140 return RicServiceUpdateAckE2APPDU{SuccessfulOutcome: successfulOutcome}