# The Jenkins job requires a tag to build the Docker image.
# Global-JJB script assumes this file is in the repo root.
---
-tag: 4.4.8
+tag: 4.4.9
type removeServedNrCellsParams struct {
servedNrCells []*entities.ServedNRCell
- err error
+ err error
}
type controllerUpdateGnbTestContext struct {
- getNodebInfoResult *getNodebInfoResult
+ getNodebInfoResult *getNodebInfoResult
removeServedNrCellsParams *removeServedNrCellsParams
- updateGnbCellsParams *updateGnbCellsParams
- requestBody map[string]interface{}
- expectedStatusCode int
- expectedJsonResponse string
+ updateGnbCellsParams *updateGnbCellsParams
+ requestBody map[string]interface{}
+ expectedStatusCode int
+ expectedJsonResponse string
}
func generateServedNrCells(cellIds ...string) []*entities.ServedNRCell {
}
func TestControllerUpdateGnbGetNodebSuccessRemoveServedNrCellsFailure(t *testing.T) {
- oldServedNrCells := generateServedNrCells("whatever1","whatever2")
+ oldServedNrCells := generateServedNrCells("whatever1", "whatever2")
context := controllerUpdateGnbTestContext{
removeServedNrCellsParams: &removeServedNrCellsParams{
- err: common.NewInternalError(errors.New("#writer.UpdateGnbCells - Internal Error")),
+ err: common.NewInternalError(errors.New("#writer.UpdateGnbCells - Internal Error")),
servedNrCells: oldServedNrCells,
},
getNodebInfoResult: &getNodebInfoResult{
}
func TestControllerUpdateGnbGetNodebSuccessUpdateGnbCellsFailure(t *testing.T) {
- oldServedNrCells := generateServedNrCells("whatever1","whatever2")
+ oldServedNrCells := generateServedNrCells("whatever1", "whatever2")
context := controllerUpdateGnbTestContext{
removeServedNrCellsParams: &removeServedNrCellsParams{
- err: nil,
+ err: nil,
servedNrCells: oldServedNrCells,
},
updateGnbCellsParams: &updateGnbCellsParams{
func getJsonRequestAsBuffer(requestJson map[string]interface{}) *bytes.Buffer {
b := new(bytes.Buffer)
_ = json.NewEncoder(b).Encode(requestJson)
- return b;
+ return b
}
func TestControllerGetNodebSuccess(t *testing.T) {
if err != nil {
t.Errorf("Error cannot deserialize json request")
}
- _ =json.Unmarshal(body, &errorResponse)
+ _ = json.Unmarshal(body, &errorResponse)
return errorResponse
}
"e2mgr/rmrCgo"
"e2mgr/services"
"e2mgr/services/rmrsender"
- "e2mgr/utils"
"encoding/xml"
"errors"
"fmt"
)
type E2SetupRequestNotificationHandler struct {
- logger *logger.Logger
- config *configuration.Configuration
- e2tInstancesManager managers.IE2TInstancesManager
- rmrSender *rmrsender.RmrSender
+ logger *logger.Logger
+ config *configuration.Configuration
+ e2tInstancesManager managers.IE2TInstancesManager
+ rmrSender *rmrsender.RmrSender
rNibDataService services.RNibDataService
e2tAssociationManager *managers.E2TAssociationManager
}
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,
+ logger: logger,
+ config: config,
+ e2tInstancesManager: e2tInstancesManager,
+ rmrSender: rmrSender,
+ rNibDataService: rNibDataService,
e2tAssociationManager: e2tAssociationManager,
}
}
-func (h E2SetupRequestNotificationHandler) Handle(request *models.NotificationRequest){
+func (h E2SetupRequestNotificationHandler) Handle(request *models.NotificationRequest) {
ranName := request.RanName
h.logger.Infof("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - received E2_SETUP_REQUEST. Payload: %x", ranName, request.Payload)
}
nodebInfo, err := h.rNibDataService.GetNodeb(ranName)
- if err != nil{
- if _, ok := err.(*common.ResourceNotFoundError); ok{
- nbIdentity := h.buildNbIdentity(ranName, 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)
- return
- }
- } else{
+
+ if err != nil {
+
+ if _, ok := err.(*common.ResourceNotFoundError); !ok {
h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to retrieve nodebInfo entity. Error: %s", ranName, err)
return
+
}
- } else {
- if nodebInfo.ConnectionStatus == entities.ConnectionStatus_SHUTTING_DOWN {
- h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s, connection status: %s - nodeB entity in incorrect state", nodebInfo.RanName, nodebInfo.ConnectionStatus)
- h.logger.Infof("#E2SetupRequestNotificationHandler.Handle - Summary: elapsed time for receiving and handling setup request message from E2 terminator: %f ms", utils.ElapsedTime(request.StartTime))
+ if nodebInfo, err = h.handleNewRan(ranName, e2tIpAddress, setupRequest); err != nil {
return
}
- 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)
+
+ } else {
+ if err = h.handleExistingRan(ranName, nodebInfo, setupRequest); err != nil {
return
}
}
+
err = h.e2tAssociationManager.AssociateRan(e2tIpAddress, nodebInfo)
- if err != nil{
+
+ if err != nil {
+
h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to associate E2T to nodeB entity. Error: %s", ranName, err)
- if _, ok := err.(*e2managererrors.RoutingManagerError); ok{
+ if _, ok := err.(*e2managererrors.RoutingManagerError); ok {
h.handleUnsuccessfulResponse(nodebInfo, request)
}
return
}
+
h.handleSuccessfulResponse(ranName, request, setupRequest)
}
-func (h E2SetupRequestNotificationHandler) handleUnsuccessfulResponse(nodebInfo *entities.NodebInfo, req *models.NotificationRequest){
+func (h E2SetupRequestNotificationHandler) handleNewRan(ranName string, e2tIpAddress string, setupRequest *models.E2SetupRequestMessage) (*entities.NodebInfo, error) {
+
+ nodebInfo, err := h.buildNodebInfo(ranName, e2tIpAddress, setupRequest)
+
+ if err != nil {
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to build nodebInfo entity. Error: %s", ranName, err)
+ return nil, err
+ }
+
+ nbIdentity := h.buildNbIdentity(ranName, setupRequest)
+ err = h.rNibDataService.SaveNodeb(nbIdentity, nodebInfo)
+
+ if err != nil {
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.handleNewRan - RAN name: %s - failed to save nodebInfo entity. Error: %s", ranName, err)
+ return nil, err
+ }
+
+ return nodebInfo, nil
+}
+
+func (h E2SetupRequestNotificationHandler) handleExistingRan(ranName string, nodebInfo *entities.NodebInfo, setupRequest *models.E2SetupRequestMessage) error {
+ if nodebInfo.GetConnectionStatus() == entities.ConnectionStatus_SHUTTING_DOWN {
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s, connection status: %s - nodeB entity in incorrect state", ranName, nodebInfo.ConnectionStatus)
+ return errors.New("nodeB entity in incorrect state")
+ }
+
+ ranFunctions, err := setupRequest.ExtractRanFunctionsList()
+
+ if err != nil {
+ h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to update nodebInfo entity. Error: %s", ranName, err)
+ return err
+ }
+
+ nodebInfo.GetGnb().RanFunctions = ranFunctions
+ return nil
+}
+
+func (h E2SetupRequestNotificationHandler) handleUnsuccessfulResponse(nodebInfo *entities.NodebInfo, req *models.NotificationRequest) {
failureResponse := models.NewE2SetupFailureResponseMessage(models.TimeToWaitEnum.V60s)
h.logger.Debugf("#E2SetupRequestNotificationHandler.handleUnsuccessfulResponse - E2_SETUP_RESPONSE has been built successfully %+v", failureResponse)
responsePayload, err := xml.Marshal(&failureResponse.E2APPDU)
- if err != nil{
+ if err != nil {
h.logger.Warnf("#E2SetupRequestNotificationHandler.handleUnsuccessfulResponse - RAN name: %s - Error marshalling RIC_E2_SETUP_RESP. Payload: %s", nodebInfo.RanName, responsePayload)
}
}
-func (h E2SetupRequestNotificationHandler) handleSuccessfulResponse(ranName string, req *models.NotificationRequest, setupRequest *models.E2SetupRequestMessage){
+func (h E2SetupRequestNotificationHandler) handleSuccessfulResponse(ranName string, req *models.NotificationRequest, setupRequest *models.E2SetupRequestMessage) {
ricNearRtId, err := convertTo20BitString(h.config.GlobalRicId.RicNearRtId)
- if err != nil{
+ if err != nil {
h.logger.Errorf("#E2SetupRequestNotificationHandler.handleSuccessfulResponse - RAN name: %s - failed to convert RicNearRtId value %s to 20 bit string . Error: %s", ranName, h.config.GlobalRicId.RicNearRtId, err)
return
}
- successResponse := models.NewE2SetupSuccessResponseMessage(h.config.GlobalRicId.PlmnId, ricNearRtId,setupRequest)
+ successResponse := models.NewE2SetupSuccessResponseMessage(h.config.GlobalRicId.PlmnId, ricNearRtId, setupRequest)
h.logger.Debugf("#E2SetupRequestNotificationHandler.handleSuccessfulResponse - E2_SETUP_RESPONSE has been built successfully %+v", successResponse)
responsePayload, err := xml.Marshal(&successResponse.E2APPDU)
- if err != nil{
+ if err != nil {
h.logger.Warnf("#E2SetupRequestNotificationHandler.handleSuccessfulResponse - RAN name: %s - Error marshalling RIC_E2_SETUP_RESP. Payload: %s", ranName, responsePayload)
}
_ = h.rmrSender.Send(msg)
}
-
func replaceEmptyTagsWithSelfClosing(responsePayload []byte) []byte {
responseString := strings.NewReplacer(
"<reject></reject>", "<reject/>",
"<v5s></v5s>", "<v5s/>",
"<v2s></v2s>", "<v2s/>",
"<v1s></v1s>", "<v1s/>",
- ).Replace(string(responsePayload))
+ ).Replace(string(responsePayload))
return []byte(responseString)
}
-func convertTo20BitString(ricNearRtId string) (string, error){
+func convertTo20BitString(ricNearRtId string) (string, error) {
r, err := strconv.ParseUint(ricNearRtId, 16, 32)
- if err != nil{
+ if err != nil {
return "", err
}
return fmt.Sprintf("%020b", r)[:20], nil
}
-func (h E2SetupRequestNotificationHandler) parseSetupRequest(payload []byte)(*models.E2SetupRequestMessage, string, error){
+func (h E2SetupRequestNotificationHandler) parseSetupRequest(payload []byte) (*models.E2SetupRequestMessage, string, error) {
pipInd := bytes.IndexByte(payload, '|')
if pipInd < 0 {
- return nil, "", errors.New( "#E2SetupRequestNotificationHandler.parseSetupRequest - Error parsing E2 Setup Request failed extract Payload: no | separator found")
+ return nil, "", errors.New("#E2SetupRequestNotificationHandler.parseSetupRequest - Error parsing E2 Setup Request failed extract Payload: no | separator found")
}
e2tIpAddress := string(payload[:pipInd])
return nil, "", errors.New("#E2SetupRequestNotificationHandler.parseSetupRequest - Empty E2T Address received")
}
setupRequest := &models.E2SetupRequestMessage{}
- err := xml.Unmarshal(payload[pipInd + 1:], &setupRequest.E2APPDU)
+ err := xml.Unmarshal(payload[pipInd+1:], &setupRequest.E2APPDU)
if err != nil {
return nil, "", errors.New(fmt.Sprintf("#E2SetupRequestNotificationHandler.parseSetupRequest - Error unmarshalling E2 Setup Request payload: %x", payload))
}
return setupRequest, e2tIpAddress, nil
}
-func (h E2SetupRequestNotificationHandler) buildNodebInfo(ranName string, e2tAddress string, request *models.E2SetupRequestMessage) (*entities.NodebInfo, error){
+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,
- RanName: ranName,
- NodeType: entities.Node_GNB,
- Configuration: &entities.NodebInfo_Gnb{Gnb: &entities.Gnb{}},
- GlobalNbId: &entities.GlobalNbId{
+ ConnectionStatus: entities.ConnectionStatus_CONNECTED,
+ RanName: ranName,
+ NodeType: entities.Node_GNB,
+ Configuration: &entities.NodebInfo_Gnb{Gnb: &entities.Gnb{}},
+ GlobalNbId: &entities.GlobalNbId{
PlmnId: request.GetPlmnId(),
NbId: request.GetNbId(),
},
}
- nodebInfo.GetGnb().RanFunctions, err = request.GetExtractRanFunctionsList()
+ nodebInfo.GetGnb().RanFunctions, err = request.ExtractRanFunctionsList()
return nodebInfo, err
}
-func (h E2SetupRequestNotificationHandler) buildNbIdentity(ranName string, setupRequest *models.E2SetupRequestMessage)*entities.NbIdentity{
+func (h E2SetupRequestNotificationHandler) buildNbIdentity(ranName string, setupRequest *models.E2SetupRequestMessage) *entities.NbIdentity {
return &entities.NbIdentity{
- InventoryName:ranName,
+ InventoryName: ranName,
GlobalNbId: &entities.GlobalNbId{
PlmnId: setupRequest.GetPlmnId(),
NbId: setupRequest.GetNbId(),
},
}
-}
\ No newline at end of file
+}
"strings"
)
+type Gnb struct {
+ Text string `xml:",chardata"`
+ GlobalGNBID struct {
+ Text string `xml:",chardata"`
+ PlmnID string `xml:"plmn-id"`
+ GnbID struct {
+ Text string `xml:",chardata"`
+ GnbID string `xml:"gnb-ID"`
+ } `xml:"gnb-id"`
+ } `xml:"global-gNB-ID"`
+}
+
+type EnGnb struct {
+ Text string `xml:",chardata"`
+ GlobalGNBID struct {
+ Text string `xml:",chardata"`
+ PlmnID string `xml:"pLMN-Identity"`
+ GnbID struct {
+ Text string `xml:",chardata"`
+ GnbID string `xml:"gNB-ID"`
+ } `xml:"gNB-ID"`
+ } `xml:"global-gNB-ID"`
+}
+
+type NgEnb struct {
+ Text string `xml:",chardata"`
+ GlobalNgENBID struct {
+ Text string `xml:",chardata"`
+ PlmnID string `xml:"plmn-id"`
+ GnbID struct {
+ Text string `xml:",chardata"`
+ GnbID string `xml:"gnb-ID"`
+ } `xml:"gnb-id"`
+ } `xml:"global-ng-eNB-ID"`
+}
+
+type Enb struct {
+ Text string `xml:",chardata"`
+ GlobalENBID struct {
+ Text string `xml:",chardata"`
+ PlmnID string `xml:"plmn-id"`
+ GnbID struct {
+ Text string `xml:",chardata"`
+ GnbID string `xml:"gnb-ID"`
+ } `xml:"gnb-id"`
+ } `xml:"global-eNB-ID"`
+}
+
+type GlobalE2NodeId struct {
+ Text string `xml:",chardata"`
+ GNB Gnb `xml:"gNB"`
+ EnGNB EnGnb `xml:"en-gNB"`
+ NgENB NgEnb `xml:"ng-eNB"`
+ ENB Enb `xml:"eNB"`
+}
+
+type E2SetupRequest struct {
+ Text string `xml:",chardata"`
+ ProtocolIEs struct {
+ Text string `xml:",chardata"`
+ E2setupRequestIEs []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"`
+ GlobalE2nodeID GlobalE2NodeId `xml:"GlobalE2node-ID"`
+ RANfunctionsList RANfunctionsList `xml:"RANfunctions-List"`
+ } `xml:"value"`
+ } `xml:"E2setupRequestIEs"`
+ } `xml:"protocolIEs"`
+}
+
type E2SetupRequestMessage struct {
XMLName xml.Name `xml:"E2SetupRequestMessage"`
Text string `xml:",chardata"`
Reject string `xml:"reject"`
} `xml:"criticality"`
Value struct {
- Text string `xml:",chardata"`
- E2setupRequest struct {
- Text string `xml:",chardata"`
- ProtocolIEs struct {
- Text string `xml:",chardata"`
- E2setupRequestIEs []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"`
- GlobalE2nodeID struct {
- Text string `xml:",chardata"`
- GNB struct {
- Text string `xml:",chardata"`
- GlobalGNBID struct {
- Text string `xml:",chardata"`
- PlmnID string `xml:"plmn-id"`
- GnbID struct {
- Text string `xml:",chardata"`
- GnbID string `xml:"gnb-ID"`
- } `xml:"gnb-id"`
- } `xml:"global-gNB-ID"`
- } `xml:"gNB"`
- EnGNB struct {
- Text string `xml:",chardata"`
- GlobalGNBID struct {
- Text string `xml:",chardata"`
- PlmnID string `xml:"plmn-id"`
- GnbID struct {
- Text string `xml:",chardata"`
- GnbID string `xml:"gnb-ID"`
- } `xml:"gnb-id"`
- } `xml:"global-gNB-ID"`
- } `xml:"en-gNB"`
- NgENB struct {
- Text string `xml:",chardata"`
- GlobalNgENBID struct {
- Text string `xml:",chardata"`
- PlmnID string `xml:"plmn-id"`
- GnbID struct {
- Text string `xml:",chardata"`
- GnbID string `xml:"gnb-ID"`
- } `xml:"gnb-id"`
- } `xml:"global-ng-eNB-ID"`
- } `xml:"ng-eNB"`
- ENB struct {
- Text string `xml:",chardata"`
- GlobalENBID struct {
- Text string `xml:",chardata"`
- PlmnID string `xml:"plmn-id"`
- GnbID struct {
- Text string `xml:",chardata"`
- GnbID string `xml:"gnb-ID"`
- } `xml:"gnb-id"`
- } `xml:"global-eNB-ID"`
- } `xml:"eNB"`
- } `xml:"GlobalE2node-ID"`
- RANfunctionsList RANfunctionsList `xml:"RANfunctions-List"`
- } `xml:"value"`
- } `xml:"E2setupRequestIEs"`
- } `xml:"protocolIEs"`
- } `xml:"E2setupRequest"`
+ Text string `xml:",chardata"`
+ E2setupRequest E2SetupRequest `xml:"E2setupRequest"`
} `xml:"value"`
} `xml:"initiatingMessage"`
} `xml:"E2AP-PDU"`
}
+type RanFunctionItem struct {
+ Text string `xml:",chardata"`
+ RanFunctionID string `xml:"ranFunctionID"`
+ RanFunctionDefinition string `xml:"ranFunctionDefinition"`
+ RanFunctionRevision string `xml:"ranFunctionRevision"`
+}
+
type RANfunctionsList struct {
- Text string `xml:",chardata"`
- ProtocolIESingleContainer []struct {
+ Text string `xml:",chardata"`
+ ProtocolIESingleContainer []struct {
Text string `xml:",chardata"`
ID string `xml:"id"`
Criticality struct {
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"`
+ Text string `xml:",chardata"`
+ RANfunctionItem RanFunctionItem `xml:"RANfunction-Item"`
} `xml:"value"`
- } `xml:"ProtocolIE-SingleContainer"`
+ } `xml:"ProtocolIE-SingleContainer"`
}
-func (m *E2SetupRequestMessage) GetExtractRanFunctionsList()([]*entities.RanFunction, error){
- list :=m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[1].Value.RANfunctionsList.ProtocolIESingleContainer
+func (m *E2SetupRequestMessage) ExtractRanFunctionsList() ([]*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++{
+ 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))
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.ExtractRanFunctionsList - 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))
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.ExtractRanFunctionsList - Failed parse uint RanFunctionRevision from %s", list[i].Value.RANfunctionItem.RanFunctionRevision))
}
funcs[i].RanFunctionDefinition = m.trimSpaces(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!= ""{
+func (m *E2SetupRequestMessage) getGlobalE2NodeId() GlobalE2NodeId {
+ return m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID
+}
+
+func (m *E2SetupRequestMessage) GetNodeType() entities.Node_Type {
+ globalE2NodeId := m.getGlobalE2NodeId()
+ if id := globalE2NodeId.GNB.GlobalGNBID.PlmnID; id != "" {
return entities.Node_GNB
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.EnGNB.GlobalGNBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.EnGNB.GlobalGNBID.PlmnID; id != "" {
return entities.Node_GNB
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.ENB.GlobalENBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.ENB.GlobalENBID.PlmnID; id != "" {
return entities.Node_ENB
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.NgENB.GlobalNgENBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.NgENB.GlobalNgENBID.PlmnID; id != "" {
return entities.Node_GNB
}
return entities.Node_UNKNOWN
}
-func (m *E2SetupRequestMessage) GetPlmnId() string{
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.GNB.GlobalGNBID.PlmnID; id!= ""{
+func (m *E2SetupRequestMessage) GetPlmnId() string {
+ globalE2NodeId := m.getGlobalE2NodeId()
+ if id := globalE2NodeId.GNB.GlobalGNBID.PlmnID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.EnGNB.GlobalGNBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.EnGNB.GlobalGNBID.PlmnID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.ENB.GlobalENBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.ENB.GlobalENBID.PlmnID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.NgENB.GlobalNgENBID.PlmnID; id!= ""{
+ if id := globalE2NodeId.NgENB.GlobalNgENBID.PlmnID; id != "" {
return m.trimSpaces(id)
}
return ""
}
-func (m *E2SetupRequestMessage) GetNbId() string{
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.GNB.GlobalGNBID.GnbID.GnbID; id!= ""{
+func (m *E2SetupRequestMessage) GetNbId() string {
+ globalE2NodeId := m.getGlobalE2NodeId()
+ if id := globalE2NodeId.GNB.GlobalGNBID.GnbID.GnbID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.EnGNB.GlobalGNBID.GnbID.GnbID; id!= ""{
+ if id := globalE2NodeId.EnGNB.GlobalGNBID.GnbID.GnbID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.ENB.GlobalENBID.GnbID.GnbID; id!= ""{
+ if id := globalE2NodeId.ENB.GlobalENBID.GnbID.GnbID; id != "" {
return m.trimSpaces(id)
}
- if id := m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[0].Value.GlobalE2nodeID.NgENB.GlobalNgENBID.GnbID.GnbID; id!= ""{
+ if id := globalE2NodeId.NgENB.GlobalNgENBID.GnbID.GnbID; id != "" {
return m.trimSpaces(id)
}
return ""
func (m *E2SetupRequestMessage) trimSpaces(str string) string {
return strings.NewReplacer(" ", "", "\n", "").Replace(str)
-}
\ No newline at end of file
+}
<E2AP-PDU>\r
<initiatingMessage>\r
<procedureCode>1</procedureCode>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<E2setupRequest>\r
<protocolIEs>\r
<E2setupRequestIEs>\r
<id>3</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<GlobalE2node-ID>\r
<en-gNB>\r
<global-gNB-ID>\r
- <plmn-id>13 10 14</plmn-id>\r
- <gnb-id>\r
- <gnb-ID>10011001101010101011</gnb-ID>\r
- </gnb-id>\r
+ <pLMN-Identity>13 10 14</pLMN-Identity>\r
+ <gNB-ID>\r
+ <gNB-ID>11000101110001101100011111111000</gNB-ID>\r
+ </gNB-ID>\r
</global-gNB-ID>\r
</en-gNB>\r
</GlobalE2node-ID>\r
</E2setupRequestIEs>\r
<E2setupRequestIEs>\r
<id>10</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunctions-List>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
</ProtocolIE-SingleContainer>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r
<E2AP-PDU>\r
<initiatingMessage>\r
<procedureCode>1</procedureCode>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<E2setupRequest>\r
<protocolIEs>\r
<E2setupRequestIEs>\r
<id>3</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<GlobalE2node-ID>\r
<gNB>\r
</E2setupRequestIEs>\r
<E2setupRequestIEs>\r
<id>10</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunctions-List>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
</ProtocolIE-SingleContainer>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r
<E2AP-PDU>\r
<initiatingMessage>\r
<procedureCode>1</procedureCode>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<E2setupRequest>\r
<protocolIEs>\r
<E2setupRequestIEs>\r
<id>3</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<GlobalE2node-ID>\r
<ng-eNB>\r
</E2setupRequestIEs>\r
<E2setupRequestIEs>\r
<id>10</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunctions-List>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>1</ranFunctionID>\r
</ProtocolIE-SingleContainer>\r
<ProtocolIE-SingleContainer>\r
<id>8</id>\r
- <criticality><reject/></criticality>\r
+ <criticality>\r
+ <reject/>\r
+ </criticality>\r
<value>\r
<RANfunction-Item>\r
<ranFunctionID>7</ranFunctionID>\r