- r.addRoute("RIC_SUB_REQ", subManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_SUB_DEL_REQ", subManEp, e2TermEp, routeTable, -1)
- //E2 Termination -> Subscription Manager
- r.addRoute("RIC_SUB_RESP", e2TermEp, subManEp, routeTable, -1)
- r.addRoute("RIC_SUB_DEL_RESP", e2TermEp, subManEp, routeTable, -1)
- r.addRoute("RIC_SUB_FAILURE", e2TermEp, subManEp, routeTable, -1)
- r.addRoute("RIC_SUB_DEL_FAILURE", e2TermEp, 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, e2TermEp, routeTable, -1)
- r.addRoute("RIC_X2_RESET_REQ", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_X2_RESET_RESP", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_ENDC_X2_SETUP_REQ", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_SCTP_CLEAR_ALL", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_ENB_CONF_UPDATE_ACK", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_ENB_CONF_UPDATE_FAILURE", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_ENDC_CONF_UPDATE_ACK", e2ManEp, e2TermEp, routeTable, -1)
- r.addRoute("RIC_ENDC_CONF_UPDATE_FAILURE", e2ManEp, e2TermEp, routeTable, -1)
- //E2 Termination -> E2 Manager
- r.addRoute("E2_TERM_INIT", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_X2_SETUP_RESP", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_X2_SETUP_FAILURE", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_X2_RESET_REQ", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_X2_RESET_RESP", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ENDC_X2_SETUP_RESP", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ENDC_X2_SETUP_FAILURE", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ENDC_CONF_UPDATE", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_SCTP_CONNECTION_FAILURE", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ERROR_INDICATION", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ENB_CONF_UPDATE", e2TermEp, e2ManEp, routeTable, -1)
- r.addRoute("RIC_ENB_LOAD_INFORMATION", e2TermEp, 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, e2TermEp, routeTable, -1)
- //E2 Termination -> Resource Status Manager
- r.addRoute("RIC_RES_STATUS_RESP", e2TermEp, rsmEp, routeTable, -1)
- r.addRoute("RIC_RES_STATUS_FAILURE", e2TermEp, rsmEp, routeTable, -1)
- //ACxapp -> A1 Mediator
- r.addRoute("A1_POLICY_QUERY", nil, a1mediatorEp, routeTable, -1)
- r.addRoute("A1_POLICY_RESPONSE", nil, a1mediatorEp, routeTable, -1)
+ if rtmgr.PrsCfg == nil {
+ xapp.Logger.Info("No static routes configuration")
+ return
+ }
+ for _, routes := range *rtmgr.PrsCfg {
+ var sendEp *rtmgr.Endpoint
+ var Ep *rtmgr.Endpoint
+ switch routes.SenderEndPoint {
+ case "SUBMAN":
+ sendEp = subManEp
+ case "E2MAN":
+ sendEp = e2ManEp
+ //case "RSM":,
+ // sendEp = rsmEp
+ case "A1MEDIATOR":
+ sendEp = a1mediatorEp
+ }
+ switch routes.EndPoint {
+ case "SUBMAN":
+ Ep = subManEp
+ case "E2MAN":
+ Ep = e2ManEp
+ //case "UEMAN":
+ // Ep = ueManEp
+ //case "RSM":
+ // Ep = rsmEp
+ case "A1MEDIATOR":
+ Ep = a1mediatorEp
+ }
+
+ r.addRoute(routes.MessageType, sendEp, Ep, routeTable, routes.SubscriptionId, routes.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, "")
+ r.addRoute_rx_list("RIC_E2_SETUP_RESP", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2_SETUP_FAILURE", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_SERVICE_UPDATE_ACK", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_SERVICE_UPDATE_FAILURE", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2NODE_CONFIG_UPDATE_ACK", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2NODE_CONFIG_UPDATE_FAILURE", e2ManEp, e2TermEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2_RESET_RESP", e2ManEp, e2TermEp, routeTable, -1, "")
+ }
+}
+
+func (r *Rpe) generatePartialRouteTable(endPointList rtmgr.Endpoints, xappSubData *models.XappSubscriptionData, updatetype rtmgr.RMRUpdateType) *rtmgr.RouteTable {
+ xapp.Logger.Debug("rpe.generatePartialRouteTable invoked")
+ xapp.Logger.Debug("Endpoint List: %v", endPointList)
+ routeTable := &rtmgr.RouteTable{}
+ subManEp := getEndpointByName(&endPointList, "SUBMAN")
+ if subManEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "Subscription Manager")
+ 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)
+ }
+ e2ManEp := getEndpointByName(&endPointList, "E2MAN")
+ if e2ManEp == nil {
+ xapp.Logger.Error("Platform component not found: %v", "E2 Manager")
+ xapp.Logger.Debug("Endpoints: %v", endPointList)
+ }*/
+
+ if xappSubData != nil && updatetype == rtmgr.SubsType {
+ xapp.Logger.Info("Updating partial subscription routes")
+ r.generatePartialSubscriptionTable(xappSubData, subManEp, routeTable)
+ }
+ /*if updatetype == rtmgr.XappType {
+ xapp.Logger.Info("Updating partial xapp routes")
+ 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, subManEp, routeTable)
+ r.generateXappToXappRoutes(endPoint, endPointList, routeTable)
+ }
+ }
+ }
+ if updatetype == rtmgr.E2Type {
+ xapp.Logger.Info("Updating partial E2 routes")
+ if len(e2TermListEp) > 0 {
+ r.addRoute_rx_list("RIC_SCTP_CLEAR_ALL", e2ManEp, e2TermListEp, routeTable, -1, "")
+ r.addRoute_rx_list("E2_TERM_KEEP_ALIVE_REQ", e2ManEp, e2TermListEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2_SETUP_RESP", e2ManEp, e2TermListEp, routeTable, -1, "")
+ r.addRoute_rx_list("RIC_E2_SETUP_FAILURE", e2ManEp, e2TermListEp, routeTable, -1, "")
+ }
+ }*/
+
+ return routeTable
+