RoutingManager struct {
BaseUrl string
}
+ RicId struct {
+ PlmnId string
+ RicNearRtId string
+ }
NotificationResponseBuffer int
BigRedButtonTimeoutSec int
MaxConnectionAttempts int
module e2mgr
require (
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.32
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.32
- gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.32
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.33
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.33
+ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.33
gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.5.2
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/go-ozzo/ozzo-validation v3.5.0+incompatible
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.32 h1:rth8ETFAQxKd5LzB/j8Xic5gDU/NQ4K9LBioBXBMMb4=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.32/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.32 h1:9xffoKE1Y4FR6KzncK/FhjbljoshPT90kDSeU78H6G8=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.33 h1:QqWDNf3E8OpevC8swnZFxd56oW/7+5kVa9Ps4LWAZy8=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.33/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.32/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.32 h1:TSpWWIccJhSyvqBibXQFgyP13KqhsFA14auTSqvEpz0=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.32/go.mod h1:oPHTwdTeaOEuvqVRAog9WoCTW7O6ynE6rOyFB/sp9C0=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.33 h1:VwfmU5yww6nejkRK2qYD/+VYy6+RBHWHihInHwgK1EE=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.33/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.33 h1:dUTtIlG3F1+qyDZ1OIVsVFwygAioLNUkjiMzxTaHV9o=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.33/go.mod h1:oPHTwdTeaOEuvqVRAog9WoCTW7O6ynE6rOyFB/sp9C0=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfMnIqCcJxTnLlDA=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
import (
"bytes"
+ "e2mgr/configuration"
"e2mgr/logger"
"e2mgr/managers"
"e2mgr/models"
type E2SetupRequestNotificationHandler struct {
logger *logger.Logger
+ config *configuration.Configuration
e2tInstancesManager managers.IE2TInstancesManager
rmrSender *rmrsender.RmrSender
rNibDataService services.RNibDataService
e2tAssociationManager *managers.E2TAssociationManager
}
-func NewE2SetupRequestNotificationHandler(logger *logger.Logger, e2tInstancesManager managers.IE2TInstancesManager, rmrSender *rmrsender.RmrSender, rNibDataService services.RNibDataService, e2tAssociationManager *managers.E2TAssociationManager) E2SetupRequestNotificationHandler {
+func NewE2SetupRequestNotificationHandler(logger *logger.Logger, config *configuration.Configuration, e2tInstancesManager managers.IE2TInstancesManager, rmrSender *rmrsender.RmrSender, rNibDataService services.RNibDataService, e2tAssociationManager *managers.E2TAssociationManager) E2SetupRequestNotificationHandler {
return E2SetupRequestNotificationHandler{
logger: logger,
+ config: config,
e2tInstancesManager: e2tInstancesManager,
rmrSender: rmrSender,
rNibDataService: rNibDataService,
if err != nil{
if _, ok := err.(*common.ResourceNotFoundError); ok{
nbIdentity := h.buildNbIdentity(ranName, setupRequest)
- nodebInfo = h.buildNodebInfo(ranName, e2tIpAddress, setupRequest)
+ nodebInfo, err = h.buildNodebInfo(ranName, e2tIpAddress, setupRequest)
+ if err != nil{
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to build nodebInfo entity. Error: %s", ranName, err)
+ return
+ }
err = h.rNibDataService.SaveNodeb(nbIdentity, nodebInfo)
if err != nil{
h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to save nodebInfo entity. Error: %s", ranName, err)
h.logger.Infof("#E2SetupRequestNotificationHandler.Handle - Summary: elapsed time for receiving and handling setup request message from E2 terminator: %f ms", utils.ElapsedTime(request.StartTime))
return
}
- h.updateNodeBFunctions(nodebInfo, setupRequest)
+ nodebInfo.GetGnb().RanFunctions, err = setupRequest.GetExtractRanFunctionsList()
+ if err != nil{
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to update nodebInfo entity. Error: %s", ranName, err)
+ return
+ }
}
err = h.e2tAssociationManager.AssociateRan(e2tIpAddress, nodebInfo)
if err != nil{
h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to associate E2T to nodeB entity. Error: %s", ranName, err)
return
}
- successResponse := &models.E2SetupSuccessResponseMessage{}
- successResponse.SetPlmnId(setupRequest.GetPlmnId())
- successResponse.SetNbId("&" + fmt.Sprintf("%020b", 0xf0))
+ successResponse := models.NewE2SetupSuccessResponseMessage()
+ successResponse.SetPlmnId(h.config.RicId.PlmnId)
+ successResponse.SetRicId(h.config.RicId.RicNearRtId)
+ successResponse.SetExtractRanFunctionsIDList(setupRequest)
responsePayload, err := xml.Marshal(successResponse)
+
if err != nil{
h.logger.Warnf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - Error marshalling E2 Setup Response. Response: %x", ranName, responsePayload)
}
msg := models.NewRmrMessage(rmrCgo.RIC_E2_SETUP_RESP, ranName, responsePayload, request.TransactionId)
h.logger.Infof("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - E2 Setup Request has been built. Message: %x", ranName, msg)
- //TODO err = h.rmrSender.Send(msg)
-
+ err = h.rmrSender.Send(msg)
}
func (h E2SetupRequestNotificationHandler) parseSetupRequest(payload []byte)(*models.E2SetupRequestMessage, string, error){
setupRequest := &models.E2SetupRequestMessage{}
err := xml.Unmarshal(payload[pipInd + 1:], &setupRequest)
if err != nil {
- return nil, "", errors.New("#E2SetupRequestNotificationHandler.parseSetupRequest - Error unmarshalling E2 Setup Request payload: %s")
+ return nil, "", errors.New(fmt.Sprintf("#E2SetupRequestNotificationHandler.parseSetupRequest - Error unmarshalling E2 Setup Request payload: %x", payload))
}
return setupRequest, e2tIpAddress, nil
}
-func (h E2SetupRequestNotificationHandler) updateNodeBFunctions(nodeB *entities.NodebInfo, request *models.E2SetupRequestMessage){
- //TODO the function should be implemented in the scope of the US 192 "Save the entire Setup request in RNIB"
-}
-
-func (h E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) *entities.NodebInfo{
+func (h E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) (*entities.NodebInfo, error){
+ var err error
nodebInfo := &entities.NodebInfo{
AssociatedE2TInstanceAddress: e2tAddress,
ConnectionStatus: entities.ConnectionStatus_CONNECTED,
NodeType: entities.Node_GNB,
Configuration: &entities.NodebInfo_Gnb{Gnb: &entities.Gnb{}},
}
- h.updateNodeBFunctions(nodebInfo, request)
- return nodebInfo
+ nodebInfo.GetGnb().RanFunctions, err = request.GetExtractRanFunctionsList()
+ return nodebInfo, err
}
func (h E2SetupRequestNotificationHandler) buildNbIdentity(ranName string, setupRequest *models.E2SetupRequestMessage)*entities.NbIdentity{
"e2mgr/managers"
"e2mgr/mocks"
"e2mgr/models"
+ "e2mgr/rmrCgo"
"e2mgr/services"
"e2mgr/tests"
"errors"
nodebRanName = "gnb:310-410-b5c67788"
)
+func TestParseSetupRequest_Success(t *testing.T){
+ path, err :=filepath.Abs("../../tests/resources/setupRequest_gnb.xml")
+ if err != nil {
+ t.Fatal(err)
+ }
+ xmlGnb, err := ioutil.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ handler := stubMockSuccessFlowNewNodeb(t)
+ prefBytes := []byte(prefix)
+ request, _, err := handler.parseSetupRequest(append(prefBytes, xmlGnb...))
+ assert.Equal(t, request.GetPlmnId(), "131014")
+ assert.Equal(t, request.GetNbId(), "10110101110001100111011110001000")
+}
+
+func TestParseSetupRequest_ColonFailure(t *testing.T){
+ path, err :=filepath.Abs("../../tests/resources/setupRequest_gnb.xml")
+ if err != nil {
+ t.Fatal(err)
+ }
+ xmlGnb, err := ioutil.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ handler := stubMockSuccessFlowNewNodeb(t)
+ prefBytes := []byte("10.0.2.15;9999|")
+ request, _, err := handler.parseSetupRequest(append(prefBytes, xmlGnb...))
+ assert.Nil(t, request)
+ assert.NotNil(t, err)
+ assert.EqualError(t, err, "#E2SetupRequestNotificationHandler.parseSetupRequest - Error parsing E2 Setup Request, failed extract E2T IP Address: no ':' separator found")
+}
+
+func TestParseSetupRequest_PipFailure(t *testing.T){
+ path, err :=filepath.Abs("../../tests/resources/setupRequest_gnb.xml")
+ if err != nil {
+ t.Fatal(err)
+ }
+ xmlGnb, err := ioutil.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ handler := stubMockSuccessFlowNewNodeb(t)
+ prefBytes := []byte("10.0.2.15:9999")
+ request, _, err := handler.parseSetupRequest(append(prefBytes, xmlGnb...))
+ assert.Nil(t, request)
+ assert.NotNil(t, err)
+ assert.EqualError(t, err, "#E2SetupRequestNotificationHandler.parseSetupRequest - Error parsing E2 Setup Request failed extract Payload: no | separator found")
+}
+
+func TestParseSetupRequest_UnmarshalFailure(t *testing.T){
+ handler := stubMockSuccessFlowNewNodeb(t)
+ prefBytes := []byte(prefix)
+ request, _, err := handler.parseSetupRequest(append(prefBytes, 1,2,3))
+ assert.Nil(t, request)
+ assert.NotNil(t, err)
+ assert.EqualError(t, err, "#E2SetupRequestNotificationHandler.parseSetupRequest - Error unmarshalling E2 Setup Request payload: 31302e302e322e31353a393939397c010203")
+}
+
func TestE2SetupRequestNotificationHandler_HandleNewGnbSuccess(t *testing.T) {
path, err :=filepath.Abs("../../tests/resources/setupRequest_gnb.xml")
if err != nil {
assertNewNodebSavedLog(buf, t)
assertAssociatedLog(buf, t)
assertRequestBuiltLog(buf, t)
+ assertRequestSentLog(buf, t)
assertNoMoreRecordsLog(buf, t)
}
assertExistingNodebRetrievedLog(buf, t)
assertAssociatedLog(buf, t)
assertRequestBuiltLog(buf, t)
+ assertRequestSentLog(buf, t)
assertNoMoreRecordsLog(buf, t)
}
assert.Contains(t, record, "#E2TAssociationManager.AssociateRan - successfully associated RAN")
}
+func assertRequestSentLog(buf *bytes.Buffer, t *testing.T) {
+ record, _ := buf.ReadString('\n')
+ assert.Contains(t, record, "uccessfully sent RMR message")
+}
func assertRequestBuiltLog(buf *bytes.Buffer, t *testing.T) {
record, _ := buf.ReadString('\n')
assert.Contains(t, record, "E2 Setup Request has been built")
}
func stubMockSuccessFlowNewNodeb(t *testing.T) E2SetupRequestNotificationHandler{
- _, handler, readerMock, writerMock, _, e2tInstancesManagerMock, routingManagerClientMock := initMocks(t)
+ _, handler, readerMock, writerMock, rmrMessengerMock, e2tInstancesManagerMock, routingManagerClientMock := initMocks(t)
var e2tInstance = &entities.E2TInstance{}
e2tInstancesManagerMock.On("GetE2TInstance", e2tInstanceAddress).Return(e2tInstance, nil)
var gnb *entities.NodebInfo
routingManagerClientMock.On("AssociateRanToE2TInstance", e2tInstanceAddress, mock.Anything).Return(nil)
writerMock.On("UpdateNodebInfo", mock.Anything).Return(nil)
e2tInstancesManagerMock.On("AddRansToInstance", mock.Anything, mock.Anything).Return(nil)
+ var err error
+ rmrMessage := &rmrCgo.MBuf{}
+ rmrMessengerMock.On("SendMsg", mock.Anything, mock.Anything).Return(rmrMessage, err)
return handler
}
func stubMockSuccessFlowExistingNodeb(t *testing.T) E2SetupRequestNotificationHandler{
- _, handler, readerMock, writerMock, _, e2tInstancesManagerMock, routingManagerClientMock := initMocks(t)
+ _, handler, readerMock, writerMock, rmrMessengerMock, e2tInstancesManagerMock, routingManagerClientMock := initMocks(t)
var e2tInstance = &entities.E2TInstance{}
e2tInstancesManagerMock.On("GetE2TInstance", e2tInstanceAddress).Return(e2tInstance, nil)
- var gnb = &entities.NodebInfo{RanName: nodebRanName}
+ var gnb = &entities.NodebInfo{
+ RanName: nodebRanName,
+ AssociatedE2TInstanceAddress: e2tAddress,
+ ConnectionStatus: entities.ConnectionStatus_CONNECTED,
+ NodeType: entities.Node_GNB,
+ Configuration: &entities.NodebInfo_Gnb{Gnb: &entities.Gnb{}},
+ }
readerMock.On("GetNodeb", mock.Anything).Return(gnb, nil)
routingManagerClientMock.On("AssociateRanToE2TInstance", e2tInstanceAddress, mock.Anything).Return(nil)
writerMock.On("UpdateNodebInfo", mock.Anything).Return(nil)
e2tInstancesManagerMock.On("AddRansToInstance", mock.Anything, mock.Anything).Return(nil)
+ var err error
+ rmrMessage := &rmrCgo.MBuf{}
+ rmrMessengerMock.On("SendMsg", mock.Anything, mock.Anything).Return(rmrMessage, err)
return handler
}
rnibDataService := services.NewRnibDataService(logger, config, readerMock, writerMock)
e2tInstancesManagerMock := &mocks.E2TInstancesManagerMock{}
e2tAssociationManager := managers.NewE2TAssociationManager(logger, rnibDataService, e2tInstancesManagerMock, routingManagerClientMock)
- handler := NewE2SetupRequestNotificationHandler(logger, e2tInstancesManagerMock, rmrSender, rnibDataService, e2tAssociationManager)
+ handler := NewE2SetupRequestNotificationHandler(logger, config, e2tInstancesManagerMock, rmrSender, rnibDataService, e2tAssociationManager)
return logger, handler, readerMock, writerMock, rmrMessengerMock, e2tInstancesManagerMock, routingManagerClientMock
}
import (
"encoding/xml"
+ "errors"
+ "fmt"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "strconv"
)
type E2SetupRequestMessage struct {
} `xml:"global-eNB-ID"`
} `xml:"eNB"`
} `xml:"GlobalE2node-ID"`
- RANfunctionsList struct {
- Text string `xml:",chardata"`
- ProtocolIESingleContainer []struct {
- Text string `xml:",chardata"`
- ID string `xml:"id"`
- Criticality struct {
- Text string `xml:",chardata"`
- Reject string `xml:"reject"`
- } `xml:"criticality"`
- Value struct {
- Text string `xml:",chardata"`
- RANfunctionItem struct {
- Text string `xml:",chardata"`
- RanFunctionID string `xml:"ranFunctionID"`
- RanFunctionDefinition string `xml:"ranFunctionDefinition"`
- RanFunctionRevision string `xml:"ranFunctionRevision"`
- } `xml:"RANfunction-Item"`
- } `xml:"value"`
- } `xml:"ProtocolIE-SingleContainer"`
- } `xml:"RANfunctions-List"`
+ RANfunctionsList RANfunctionsList `xml:"RANfunctions-List"`
} `xml:"value"`
} `xml:"E2setupRequestIEs"`
} `xml:"protocolIEs"`
} `xml:"E2AP-PDU"`
}
+type RANfunctionsList struct {
+ Text string `xml:",chardata"`
+ ProtocolIESingleContainer []struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"id"`
+ Criticality struct {
+ Text string `xml:",chardata"`
+ Reject string `xml:"reject"`
+ } `xml:"criticality"`
+ Value struct {
+ Text string `xml:",chardata"`
+ RANfunctionItem struct {
+ Text string `xml:",chardata"`
+ RanFunctionID string `xml:"ranFunctionID"`
+ RanFunctionDefinition string `xml:"ranFunctionDefinition"`
+ RanFunctionRevision string `xml:"ranFunctionRevision"`
+ } `xml:"RANfunction-Item"`
+ } `xml:"value"`
+ } `xml:"ProtocolIE-SingleContainer"`
+}
+
+func (m *E2SetupRequestMessage) GetExtractRanFunctionsList()([]*entities.RanFunction, error){
+ list :=m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[1].Value.RANfunctionsList.ProtocolIESingleContainer
+ funcs := make([]*entities.RanFunction, len(list))
+ for i:=0; i < len(funcs); i++{
+ funcs[i] = &entities.RanFunction{}
+ id, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionID, 10, 32)
+ if err != nil {
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.GetExtractRanFunctionsList - Failed parse uint RanFunctionID from %s", list[i].Value.RANfunctionItem.RanFunctionID))
+ }
+ funcs[i].RanFunctionId = uint32(id)
+ rev, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionRevision, 10, 32)
+ if err != nil {
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.GetExtractRanFunctionsList - Failed parse uint RanFunctionRevision from %s", list[i].Value.RANfunctionItem.RanFunctionRevision))
+ }
+ funcs[i].RanFunctionDefinition = list[i].Value.RANfunctionItem.RanFunctionDefinition
+ funcs[i].RanFunctionRevision = uint32(rev)
+ }
+ return funcs, nil
+}
+
func (m *E2SetupRequestMessage) GetNodeType() entities.Node_Type{
if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.GNB.GlobalGNBID.PlmnID; id!= ""{
return entities.Node_GNB
Text string `xml:",chardata"`
ProtocolIEs struct {
Text string `xml:",chardata"`
- E2setupResponseIEs struct {
- Text string `xml:",chardata"`
- ID string `xml:"id"`
- Criticality struct {
- Text string `xml:",chardata"`
- Reject string `xml:"reject"`
- } `xml:"criticality"`
- Value struct {
- Text string `xml:",chardata"`
- GlobalRICID struct {
- Text string `xml:",chardata"`
- PLMNIdentity string `xml:"pLMN-Identity"`
- RicID string `xml:"ric-ID"`
- } `xml:"GlobalRIC-ID"`
- } `xml:"value"`
- } `xml:"E2setupResponseIEs"`
+ E2setupResponseIEs []E2setupResponseIEs`xml:"E2setupResponseIEs"`
} `xml:"protocolIEs"`
} `xml:"E2setupResponse"`
} `xml:"value"`
} `xml:"E2AP-PDU"`
}
+type E2setupResponseIEs struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"id"`
+ Criticality struct {
+ Text string `xml:",chardata"`
+ Reject string `xml:"reject"`
+ } `xml:"criticality"`
+ Value struct {
+ Text string `xml:",chardata"`
+ GlobalRICID struct {
+ Text string `xml:",chardata"`
+ PLMNIdentity string `xml:"pLMN-Identity"`
+ RicID string `xml:"ric-ID"`
+ } `xml:"GlobalRIC-ID"`
+ RANfunctionsIDList struct {
+ Text string `xml:",chardata"`
+ ProtocolIESingleContainer []ProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"`
+ } `xml:"RANfunctionsID-List"`
+ } `xml:"value"`
+}
+
+type ProtocolIESingleContainer struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"id"`
+ Criticality struct {
+ Text string `xml:",chardata"`
+ Ignore string `xml:"ignore"`
+ } `xml:"criticality"`
+ Value struct {
+ Text string `xml:",chardata"`
+ RANfunctionIDItem struct {
+ Text string `xml:",chardata"`
+ RanFunctionID string `xml:"ranFunctionID"`
+ RanFunctionRevision string `xml:"ranFunctionRevision"`
+ } `xml:"RANfunctionID-Item"`
+ } `xml:"value"`
+}
+
+func NewE2SetupSuccessResponseMessage() *E2SetupSuccessResponseMessage{
+ msg := &E2SetupSuccessResponseMessage{}
+ msg.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs = make([]E2setupResponseIEs, 2)
+ return msg
+}
+
+func (m *E2SetupSuccessResponseMessage) SetExtractRanFunctionsIDList(request *E2SetupRequestMessage) {
+ list := &request.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[1].Value.RANfunctionsList
+ ids := make([]ProtocolIESingleContainer,len(list.ProtocolIESingleContainer))
+ for i := 0; i< len(ids); i++{
+ ids[i] = m.convertToRANfunctionID(list, i)
+ }
+ m.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs[1].Value.RANfunctionsIDList.ProtocolIESingleContainer = ids
+}
+
+func (m *E2SetupSuccessResponseMessage) convertToRANfunctionID(list *RANfunctionsList, i int) ProtocolIESingleContainer{
+ id := ProtocolIESingleContainer{}
+ id.Value.RANfunctionIDItem.RanFunctionID = list.ProtocolIESingleContainer[i].Value.RANfunctionItem.RanFunctionID
+ id.Value.RANfunctionIDItem.RanFunctionRevision = list.ProtocolIESingleContainer[i].Value.RANfunctionItem.RanFunctionRevision
+ return id
+}
func (m *E2SetupSuccessResponseMessage) SetPlmnId(plmnId string){
- m.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs.Value.GlobalRICID.PLMNIdentity = plmnId
+ m.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs[0].Value.GlobalRICID.PLMNIdentity = plmnId
}
-func (m *E2SetupSuccessResponseMessage) SetNbId(ricID string){
- m.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs.Value.GlobalRICID.RicID = ricID
+func (m *E2SetupSuccessResponseMessage) SetRicId(ricId string){
+ m.E2APPDU.SuccessfulOutcome.Value.E2setupResponse.ProtocolIEs.E2setupResponseIEs[0].Value.GlobalRICID.RicID = ricId
}
\ No newline at end of file
x2ResetRequestNotificationHandler := rmrmsghandlers.NewX2ResetRequestNotificationHandler(logger, rnibDataService, ranStatusChangeManager, rmrSender)
e2TermInitNotificationHandler := rmrmsghandlers.NewE2TermInitNotificationHandler(logger, ranReconnectionManager, e2tInstancesManager, routingManagerClient)
e2TKeepAliveResponseHandler := rmrmsghandlers.NewE2TKeepAliveResponseHandler(logger, rnibDataService, e2tInstancesManager)
- e2SetupRequestNotificationHandler := rmrmsghandlers.NewE2SetupRequestNotificationHandler(logger, e2tInstancesManager, rmrSender, rnibDataService, e2tAssociationManager)
+ e2SetupRequestNotificationHandler := rmrmsghandlers.NewE2SetupRequestNotificationHandler(logger, config, e2tInstancesManager, rmrSender, rnibDataService, e2tAssociationManager)
provider.Register(rmrCgo.RIC_X2_SETUP_RESP, x2SetupResponseHandler)
provider.Register(rmrCgo.RIC_X2_SETUP_FAILURE, x2SetupFailureResponseHandler)
<GlobalE2node-ID>\r
<en-gNB>\r
<global-gNB-ID>\r
- <plmn-id>13 10 14</plmn-id>\r
+ <plmn-id>131014</plmn-id>\r
<gnb-id>\r
- <gnb-ID>\r
- 10110101110001100111011110001000\r
- </gnb-ID>\r
+ <gnb-ID>10110101110001100111011110001000</gnb-ID>\r
</gnb-id>\r
</global-gNB-ID>\r
</en-gNB>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r
<GlobalE2node-ID>\r
<gNB>\r
<global-gNB-ID>\r
- <plmn-id>13 10 14</plmn-id>\r
+ <plmn-id>131014</plmn-id>\r
<gnb-id>\r
<gnb-ID>10110101110001100111011110001000</gnb-ID>\r
</gnb-id>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r
<GlobalE2node-ID>\r
<ng-eNB>\r
<global-ng-eNB-ID>\r
- <plmn-id>13 10 14</plmn-id>\r
+ <plmn-id>131014</plmn-id>\r
<gnb-id>\r
<gnb-ID>10110101110001100111011110001000</gnb-ID>\r
</gnb-id>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r
- <ranFunctionDefinition>33 44 55</ranFunctionDefinition>\r
+ <ranFunctionDefinition>334455</ranFunctionDefinition>\r
<ranFunctionRevision>0</ranFunctionRevision>\r
</RANfunction-Item>\r
</value>\r