+ }
+}
+
+func (r *Rpe) generatePlatformRoutes(e2TermEp []rtmgr.Endpoint, subManEp *rtmgr.Endpoint, e2ManEp *rtmgr.Endpoint, ueManEp *rtmgr.Endpoint, rsmEp *rtmgr.Endpoint, a1mediatorEp *rtmgr.Endpoint, routeTable *rtmgr.RouteTable) {
+ xapp.Logger.Debug("rpe.generatePlatformRoutes invoked")
+ //Platform Routes --- Subscription Routes
+ //Subscription Manager -> E2 Termination
+ r.addRoute("RIC_SUB_REQ", subManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_SUB_DEL_REQ", subManEp, nil, routeTable, -1, "%meid")
+ //E2 Termination -> Subscription Manager
+ r.addRoute("RIC_SUB_RESP", nil, subManEp, routeTable, -1, "")
+ r.addRoute("RIC_SUB_DEL_RESP", nil, subManEp, routeTable, -1, "")
+ r.addRoute("RIC_SUB_FAILURE", nil, subManEp, routeTable, -1, "")
+ r.addRoute("RIC_SUB_DEL_FAILURE", nil, subManEp, routeTable, -1, "")
+
+ //TODO: UE Man Routes removed (since it is not existing)
+ //UE Manager -> Subscription Manager
+ //r.addRoute("RIC_SUB_REQ", ueManEp, subManEp, routeTable)
+ //r.addRoute("RIC_SUB_DEL_REQ", ueManEp, subManEp, routeTable)
+ ////UE Manager -> E2 Termination
+ //r.addRoute("RIC_CONTROL_REQ", ueManEp, e2TermEp, routeTable)
+
+ //Platform Routes --- X2 Routes
+ //E2 Manager -> E2 Termination
+ r.addRoute("RIC_X2_SETUP_REQ", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_X2_RESET_REQ", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_X2_RESET_RESP", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_ENDC_X2_SETUP_REQ", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_ENB_CONF_UPDATE_ACK", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_ENB_CONF_UPDATE_FAILURE", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_ENDC_CONF_UPDATE_ACK", e2ManEp, nil, routeTable, -1, "%meid")
+ r.addRoute("RIC_ENDC_CONF_UPDATE_FAILURE", e2ManEp, nil, routeTable, -1, "%meid")
+
+ if len(e2TermEp) > 0 {
+ r.addRoute_rx_list("RIC_SCTP_CLEAR_ALL", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("E2_TERM_KEEP_ALIVE_REQ", e2ManEp, e2TermEp, routeTable, -1, "")
+ }
+
+ //E2 Termination -> E2 Manager
+ r.addRoute("E2_TERM_INIT", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_X2_SETUP_RESP", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_X2_SETUP_FAILURE", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_X2_RESET_REQ", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_X2_RESET_RESP", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ENDC_X2_SETUP_RESP", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ENDC_X2_SETUP_FAILURE", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ENDC_CONF_UPDATE", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_SCTP_CONNECTION_FAILURE", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ERROR_INDICATION", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ENB_CONF_UPDATE", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("RIC_ENB_LOAD_INFORMATION", nil, e2ManEp, routeTable, -1, "")
+ r.addRoute("E2_TERM_KEEP_ALIVE_RESP", nil, e2ManEp, routeTable, -1, "")
+
+
+
+ //E2 Manager -> Resource Status Manager
+ r.addRoute("RAN_CONNECTED", e2ManEp, rsmEp, routeTable, -1, "")
+ r.addRoute("RAN_RESTARTED", e2ManEp, rsmEp, routeTable, -1, "")
+ r.addRoute("RAN_RECONFIGURED", e2ManEp, rsmEp, routeTable, -1, "")
+
+ //Resource Status Manager -> E2 Termination
+ r.addRoute("RIC_RES_STATUS_REQ", rsmEp, nil, routeTable, -1, "%meid")
+ //E2 Termination -> Resource Status Manager
+ r.addRoute("RIC_RES_STATUS_RESP", nil, rsmEp, routeTable, -1, "")
+ r.addRoute("RIC_RES_STATUS_FAILURE", nil, rsmEp, routeTable, -1, "")
+
+ //ACxapp -> A1 Mediator
+ r.addRoute("A1_POLICY_QUERY", nil, a1mediatorEp, routeTable, -1, "")
+ r.addRoute("A1_POLICY_RESPONSE", nil, a1mediatorEp, routeTable, -1, "")
+}
+
+func (r *Rpe) generateRouteTable(endPointList rtmgr.Endpoints) *rtmgr.RouteTable {
+ xapp.Logger.Debug("rpe.generateRouteTable invoked")
+ xapp.Logger.Debug("Endpoint List: %v", endPointList)
+ routeTable := &rtmgr.RouteTable{}
+ e2TermEp := getEndpointByName(&endPointList, "E2TERM")
+ if e2TermEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "E2 Termination")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ subManEp := getEndpointByName(&endPointList, "SUBMAN")
+ if subManEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "Subscription Manager")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ e2ManEp := getEndpointByName(&endPointList, "E2MAN")
+ if e2ManEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "E2 Manager")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ ueManEp := getEndpointByName(&endPointList, "UEMAN")
+ if ueManEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "UE Manger")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ rsmEp := getEndpointByName(&endPointList, "RSM")
+ if rsmEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "Resource Status Manager")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ A1MediatorEp := getEndpointByName(&endPointList, "A1MEDIATOR")
+ if A1MediatorEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "A1Mediator")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+
+ e2TermListEp := getEndpointListByName(&endPointList, "E2TERMINST")
+ if len(e2TermListEp) == 0 {
+ xapp.Logger.Error("Platform component not found: %v", "E2 Termination List")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }
+ r.generatePlatformRoutes(e2TermListEp, subManEp, e2ManEp, ueManEp, rsmEp, A1MediatorEp, routeTable)
+
+ for _, endPoint := range endPointList {
+ xapp.Logger.Debug("Endpoint: %v, xAppType: %v", endPoint.Name, endPoint.XAppType)
+ if endPoint.XAppType != sbi.PlatformType && (len(endPoint.TxMessages) > 0 || len(endPoint.RxMessages) > 0) {
+ r.generateXappRoutes(endPoint, e2TermEp, subManEp, routeTable)
+ r.generateSubscriptionRoutes(endPoint, e2TermEp, subManEp, routeTable)