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 RanFunctionIdItem struct {
27 Text string `xml:",chardata"`
28 RanFunctionId uint32 `xml:"ranFunctionID"`
29 RanFunctionRevision uint32 `xml:"ranFunctionRevision"`
32 type RicServiceQueryProtocolIESingleContainer struct {
33 Text string `xml:",chardata"`
36 Text string `xml:",chardata"`
37 Reject string `xml:"reject"`
40 Text string `xml:",chardata"`
41 RanFunctionIdItem RanFunctionIdItem `xml:"RANfunctionID-Item"`
45 type RICServiceQueryIEs struct {
46 Text string `xml:",chardata"`
49 Text string `xml:",chardata"`
50 Reject string `xml:"reject"`
53 Text string `xml:",chardata"`
54 RANFunctionIdList struct {
55 Text string `xml:",chardata"`
56 ProtocolIESingleContainer []RicServiceQueryProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
57 } `xml:"RANfunctionsID-List"`
61 type RICServiceQuery struct {
62 Text string `xml:",chardata"`
64 Text string `xml:",chardata"`
65 RICServiceQueryIEs []RICServiceQueryIEs `xml:"RICserviceQuery-IEs"`
69 type InitiatingMessage struct {
70 Text string `xml:",chardata"`
71 ProcedureCode string `xml:"procedureCode"`
73 Text string `xml:",chardata"`
74 Ignore string `xml:"ignore"`
77 Text string `xml:",chardata"`
78 RICServiceQuery RICServiceQuery `xml:"RICserviceQuery"`
82 type RicServiceQueryE2APPDU struct {
83 XMLName xml.Name `xml:"E2AP-PDU"`
84 Text string `xml:",chardata"`
85 InitiatingMessage InitiatingMessage `xml:"initiatingMessage"`
89 type RICServiceQueryMessage struct{
90 XMLName xml.Name `xml:"RICserviceQueryMessage"`
91 Text string `xml:",chardata"`
92 E2APPDU RicServiceQueryE2APPDU `xml:"E2AP-PDU"`
95 func NewRicServiceQueryMessage(ranFunctions []*entities.RanFunction) RICServiceQueryMessage {
96 initiatingMessage := InitiatingMessage{}
97 initiatingMessage.ProcedureCode = "6"
98 initiatingMessage.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs = make([]RICServiceQueryIEs,1)
99 initiatingMessage.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Id = "9"
100 protocolIESingleContainer := make([]RicServiceQueryProtocolIESingleContainer,len(ranFunctions))
101 for i := 0; i < len(ranFunctions); i++ {
102 protocolIESingleContainer[i].Id = "6"
103 protocolIESingleContainer[i].Value.RanFunctionIdItem.RanFunctionId = ranFunctions[i].RanFunctionId
104 protocolIESingleContainer[i].Value.RanFunctionIdItem.RanFunctionRevision = ranFunctions[i].RanFunctionRevision
106 initiatingMessage.Value.RICServiceQuery.ProtocolIEs.RICServiceQueryIEs[0].Value.RANFunctionIdList.ProtocolIESingleContainer = protocolIESingleContainer
108 return RICServiceQueryMessage{E2APPDU:RicServiceQueryE2APPDU{InitiatingMessage:initiatingMessage}}