# a Docker tag from the string in file container-tag.yaml
#FROM golang:1.12.1 as rtmgrbuild
-FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:8-u18.04 as rtmgrbuild
+FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:9-u18.04 as rtmgrbuild
# Install RMr shared library
ARG RMRVERSION=4.1.2
+### v0.6.4
+* Creating dymanic endpoints(Eps) and distributing routes to those endpoints on upgrade route table request from xApp (this is fixed part MCxapp distribution issue for multiple route ports)
+
### v0.6.3
* [RIC-369] Routing manager needs to support for xApps that terminate other protocols than E2
xapp.Logger.Info("Start " + SERVICENAME + " service")
rtmgr.Eps = make(rtmgr.Endpoints)
rtmgr.Mtype = make(rtmgr.MessageTypeList)
+ rtmgr.RmrEp = make(rtmgr.ProcessMultipleRMR)
rtmgr.Rtmgr_ready = false
// RMR thread is starting port: 4560
# By default this file is in the docker build directory,
# but the location can configured in the JJB template.
---
-tag: 0.6.4
+tag: 0.6.5
return
}
- ep := sbiEngine.CreateEndpoint(string(params.Payload))
+ ep := sbiEngine.CreateEndpoint(string(params.Payload),msg.String())
if ep == nil {
xapp.Logger.Error("Update Routing Table Request can't handle due to end point %s is not avail in complete ep list: ", string(params.Payload))
return
Subs SubscriptionList
PrsCfg *PlatformRoutes
Mtype MessageTypeList
+ RmrEp ProcessMultipleRMR
DynamicRouteList []string
)
type MessageTypeList map[string]string
+type ProcessMultipleRMR map[string]int
+
//TODO: uuid is not a real UUID but a string of "ip:port"
// this should be changed to real UUID later on which should come from xApp Manager // petszila
type Endpoint struct {
for _, ep := range rtmgr.Eps {
go c.send_sync(ep, policies, channel, rmrcallid)
}
+ for rEp, id := range rtmgr.RmrEp {
+ go c.send_rt_process(rEp,id,policies,rmrcallid)
+ }
+
rmrcallid++
count := 0
return false
}
-func (c *RmrPush) CreateEndpoint(payload string) *rtmgr.Endpoint {
- return c.createEndpoint(payload, c)
+func (c *RmrPush) CreateEndpoint(payload string,rmrsrc string)*rtmgr.Endpoint {
+ return c.createEndpoint(payload,rmrsrc, c)
}
func (c *RmrPush) DistributeToEp(policies *[]string, ep *rtmgr.Endpoint) error {
return nil
}
+
+func (c *RmrPush) send_rt_process(ep string,whid int, policies *[]string, call_id int) bool {
+ xapp.Logger.Debug("Invoked send_rt_process to endpoint: " + ep + " call_id: " + strconv.Itoa(call_id) + "whid: " + strconv.Itoa(whid))
+ var state int
+ var retstr string
+
+ var policy = []byte{}
+
+ for _, pe := range *policies {
+ b:= []byte(pe)
+ for j:=0; j<len(b); j++{
+ policy = append(policy,b[j])
+ }
+ }
+ params := &RMRParams{&xapp.RMRParams{}}
+ params.Mtype = 20
+ params.PayloadLen = len(policy)
+ params.Payload =[]byte(policy)
+ params.Mbuf = nil
+ params.Whid = whid
+ params.Callid = call_id
+ params.Timeout = 200
+ state, retstr = xapp.Rmr.SendCallMsg(params.RMRParams)
+ routestatus := strings.Split(retstr," ")
+ if state != C.RMR_OK && routestatus[0] == "OK" {
+ xapp.Logger.Error("Updating Routes to Endpoint: " + ep + " failed, call_id: " + strconv.Itoa(call_id) + ",whi_id: " + strconv.Itoa(whid) + " for xapp.Rmr.SendCallMsg " + " Route Update Status: " + routestatus[0])
+ return false
+ } else {
+ xapp.Logger.Info("Update Routes to Endpoint: " + ep + " successful, call_id: " + strconv.Itoa(call_id) + ", Payload length: " + strconv.Itoa(params.PayloadLen) + ",whi_id: " + strconv.Itoa(whid) + ", Route Update Status: " + routestatus[0] + "(# of Entries:" + strconv.Itoa(len(*policies)))
+ return true
+ }
+
+ xapp.Logger.Error("Route Update to endpoint: " + ep + " failed, call_id: " + strconv.Itoa(call_id) + ",whi_id: " + strconv.Itoa(whid) + " xapp.Rmr.SendCallMsg not called")
+ return false
+}
+
import (
"errors"
- "fmt"
+ //"fmt"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
- "net"
+ //"net"
"routing-manager/pkg/rtmgr"
"strconv"
"strings"
}
}
-func (s *Sbi) createEndpoint(payload string, sbi Engine) *rtmgr.Endpoint {
+func (s *Sbi) createEndpoint(payload string,rmrsrc string, sbi Engine) *rtmgr.Endpoint {
xapp.Logger.Debug("CreateEndPoint %v", payload)
- stringSlice := strings.Split(payload, " ")
- uuid := stringSlice[0]
- xapp.Logger.Debug(">>> uuid %v", stringSlice[0])
+// stringSlice := strings.Split(payload, " ")
+// uuid := stringSlice[0]
+// xapp.Logger.Debug(">>> uuid %v", stringSlice[0])
- if _, ok := rtmgr.Eps[uuid]; ok {
+/* if _, ok := rtmgr.Eps[uuid]; ok {
ep := rtmgr.Eps[uuid]
return ep
- }
+ }*/
/* incase the stored Endpoint list is in the form of IP:port*/
- stringsubsplit := strings.Split(uuid, ":")
+/* stringsubsplit := strings.Split(uuid, ":")
addr, err := net.LookupIP(stringsubsplit[0])
if err == nil {
convertedUuid := fmt.Sprintf("%s:%s", addr[0], stringsubsplit[1])
ep := rtmgr.Eps[convertedUuid]
return ep
}
+ }*/
+
+ /* Create a new mapping, this case is assumed for multiple process sending RMR request from a container */
+ srcString := strings.Split(rmrsrc," ")
+ srcStringSlice := strings.Split(srcString[0],"=")
+ Whid := int(xapp.Rmr.Openwh(srcStringSlice[1]))
+
+ xapp.Logger.Info("Wormhole Id created is %d for EndPoint %s",Whid,srcStringSlice[1])
+ if Whid > 0 {
+ rtmgr.RmrEp[srcStringSlice[1]] = Whid
+ xapp.Logger.Info("received %s and mapped to Whid = %d",srcStringSlice[1],Whid)
}
return nil
-}
+ }
AddEndpoint(*rtmgr.Endpoint) error
DeleteEndpoint(*rtmgr.Endpoint) error
UpdateEndpoints(*rtmgr.RicComponents)
- CreateEndpoint(string) (*rtmgr.Endpoint)
+ CreateEndpoint(string,string)*rtmgr.Endpoint
DistributeToEp(*[]string, *rtmgr.Endpoint) error
}