+### v0.6.5
+* Removed Book Keeping of RMR CTL ports. Route Distribution on demand.
+
### 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)
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.5
+tag: 0.6.6
xapp.Logger.Info("Update Route Table Request, msg.String() : %s", msg.String())
xapp.Logger.Info("Update Route Table Request, params.Payload : %s", string(params.Payload))
- /*m.Lock()
+ m.Lock()
data, err := sdlEngine.ReadAll(xapp.Config.GetString("rtfile"))
m.Unlock()
if err != nil || data == nil {
xapp.Logger.Error("Cannot get data from sdl interface due to: " + err.Error())
return
- }*/
+ }
- sbiEngine.CreateEndpoint(string(params.Payload),msg.String())
- /*if ep == nil {
+ ep,whid := sbiEngine.CreateEndpoint(string(params.Payload),msg.String())
+ if ep == nil || whid < 0 {
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
}
policies := rpeEngine.GeneratePolicies(rtmgr.Eps, data)
- err = sbiEngine.DistributeToEp(policies, ep)
+ err = sbiEngine.DistributeToEp(policies, *ep, whid)
if err != nil {
xapp.Logger.Error("Routing table cannot be published due to: " + err.Error())
return
- }*/
+ }
}
func sendRoutesToAll() (err error) {
Subs SubscriptionList
PrsCfg *PlatformRoutes
Mtype MessageTypeList
- RmrEp ProcessMultipleRMR
DynamicRouteList []string
)
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++
return false
}
-func (c *RmrPush) CreateEndpoint(payload string,rmrsrc string)*rtmgr.Endpoint {
+func (c *RmrPush) CreateEndpoint(payload string,rmrsrc string)(ep *string,whid int) {
return c.createEndpoint(payload,rmrsrc, c)
}
-func (c *RmrPush) DistributeToEp(policies *[]string, ep *rtmgr.Endpoint) error {
+func (c *RmrPush) DistributeToEp(policies *[]string, ep string, whid int) error {
xapp.Logger.Debug("Invoked: sbi.DistributeToEp")
xapp.Logger.Debug("args: %v", *policies)
rmrdynamiccallid = 201
}
- go c.send_data(ep, policies,rmrdynamiccallid)
+ go c.sendDynamicRoutes(ep, whid, policies,rmrdynamiccallid)
rmrdynamiccallid++
return nil
}
-func (c *RmrPush) send_rt_process(ep string,whid int, policies *[]string, call_id int) bool {
+func (c *RmrPush) sendDynamicRoutes(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 rmrpush = RmrPush{}
resetTestPushDataset(rmrpush, stub.ValidEndpoints)
- err = rmrpush.DistributeToEp(stub.ValidPolicies,rtmgr.Eps["localhost"])
+ err = rmrpush.DistributeToEp(stub.ValidPolicies,"localhost:4561",100)
if err != nil {
t.Errorf("rmrpush.DistributetoEp(policies) was incorrect, got: %v, want: %v.", err, "nil")
}
}
}
-func (s *Sbi) createEndpoint(payload string,rmrsrc string, sbi Engine) *rtmgr.Endpoint {
+func (s *Sbi) createEndpoint(payload string,rmrsrc string, sbi Engine) (*string,int) {
xapp.Logger.Debug("CreateEndPoint %v", payload)
// stringSlice := strings.Split(payload, " ")
// uuid := stringSlice[0]
xapp.Logger.Info("Wormhole Id created is %d for EndPoint %s",Whid,srcStringSlice[1])
if Whid > 0 {
- rtmgr.RmrEp[srcStringSlice[1]] = Whid
+// rtmgr.RmrEp[srcStringSlice[1]] = Whid
xapp.Logger.Info("received %s and mapped to Whid = %d",srcStringSlice[1],Whid)
+ return &srcStringSlice[1],Whid
}
- return nil
+ return nil,Whid
}
AddEndpoint(*rtmgr.Endpoint) error
DeleteEndpoint(*rtmgr.Endpoint) error
UpdateEndpoints(*rtmgr.RicComponents)
- CreateEndpoint(string,string)*rtmgr.Endpoint
- DistributeToEp(*[]string, *rtmgr.Endpoint) error
+ CreateEndpoint(string,string)(*string,int)
+ DistributeToEp(*[]string, string, int ) error
}
/*type NngSocket interface {