diff --git a/cmd/iqos-xapp/iqos-xapp.go b/cmd/iqos-xapp/iqos-xapp.go index e3dcad3..ed92f5a 100644 --- a/cmd/iqos-xapp/iqos-xapp.go +++ b/cmd/iqos-xapp/iqos-xapp.go @@ -21,19 +21,21 @@ func main() { // set manager configuration cfg := manager.Config{ - AppID: "iqos-xapp", - CAPath: "/etc/iqos-xapp/certs/ca.pem", - KeyPath: "/etc/iqos-xapp/certs/tls.key", - CertPath: "/etc/iqos-xapp/certs/tls.crt", - E2tEndpoint: "onos-e2t", - E2tPort: 5150, - TopoEndpoint: "onos-topo", - TopoPort: 5150, - ConfigPath: "/etc/iqos-xapp/config/config.json", - KpmSM: manager.KpmSM{ - Name: "oran-e2sm-kpm", - Version: "v2", - }, + AppID: "iqos-xapp", + CAPath: "/etc/iqos-xapp/certs/tls.cacert", + KeyPath: "/etc/iqos-xapp/certs/tls.key", + CertPath: "/etc/iqos-xapp/certs/tls.crt", + ConfigPath: "/etc/iqos-xapp/config/config.json", + E2tEndpoint: "onos-e2t", + E2tPort: 5150, + TopoEndpoint: "onos-topo", + TopoPort: 5150, + UeNibEndpoint: "onos-uenib", + UeNibPort: 5150, + KpmSMName: "oran-e2sm-kpm", + KpmSMVersion: "v2", + RsmSMName: "oran-e2sm-rsm", + RsmSMVersion: "v1", } // creates the xApp manager diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 107bd0e..7b67bdb 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -3,6 +3,7 @@ package manager import ( appConfig "github.com/gercom-ufpa/iqos-xapp/pkg/config" "github.com/gercom-ufpa/iqos-xapp/pkg/southbound/e2" + "github.com/gercom-ufpa/iqos-xapp/pkg/uemgr" "github.com/onosproject/onos-lib-go/pkg/logging" ) @@ -17,22 +18,34 @@ func NewManager(config Config) *Manager { log.Warn(err) } - // creates an e2Config - e2config := e2.Config{ - AppID: config.AppID, - AppConfig: appCfg, - E2tAddress: config.E2tEndpoint, - E2tPort: config.E2tPort, - TopoAddress: config.TopoEndpoint, - TopoPort: config.TopoPort, - KpmSM: e2.KpmSM{ - Name: config.KpmSM.Name, - Version: config.KpmSM.Version, - }, + // Creates App Managers + // UE-NIB Manager + uemgrConfig := uemgr.Config{ + UeNibEndpoint: config.UeNibEndpoint, + UeNibPort: config.UeNibPort, + } + ueManager, err := uemgr.NewManager(uemgrConfig) + if err != nil { + log.Warn(err) } - // creates managers + // R-NIB Manager (TODO) + + // A1 Manager (TODO) + // E2 manager + e2config := e2.Config{ + AppID: config.AppID, + AppConfig: appCfg, + E2tAddress: config.E2tEndpoint, + E2tPort: config.E2tPort, + TopoAddress: config.TopoEndpoint, + TopoPort: config.TopoPort, + KpmSMName: config.KpmSMName, + KpmSMVersion: config.KpmSMVersion, + RsmSMName: config.RsmSMName, + RsmSMVersion: config.RsmSMVersion, + } e2Manager, err := e2.NewManager(e2config) if err != nil { log.Warn(err) @@ -43,6 +56,7 @@ func NewManager(config Config) *Manager { appConfig: appCfg, config: config, E2Manager: e2Manager, + UeManager: ueManager, } return manager diff --git a/pkg/manager/options.go b/pkg/manager/options.go index 32069ee..2f11acb 100644 --- a/pkg/manager/options.go +++ b/pkg/manager/options.go @@ -3,33 +3,26 @@ package manager import ( appConfig "github.com/gercom-ufpa/iqos-xapp/pkg/config" "github.com/gercom-ufpa/iqos-xapp/pkg/southbound/e2" + "github.com/gercom-ufpa/iqos-xapp/pkg/uemgr" ) // manager configuration type Config struct { - AppID string - CAPath string - KeyPath string - CertPath string - E2tEndpoint string - E2tPort int - TopoEndpoint string - TopoPort int - ConfigPath string - KpmSM - RsmSM -} - -// KPM Service Model config -type KpmSM struct { - Name string - Version string -} - -// RSM Service Model config -type RsmSM struct { - Name string - Version string + AppID string + CAPath string + KeyPath string + CertPath string + E2tEndpoint string + E2tPort int + TopoEndpoint string + TopoPort int + UeNibEndpoint string + UeNibPort int + ConfigPath string + KpmSMName string + KpmSMVersion string + RsmSMName string + RsmSMVersion string } // Manager is an abstract struct for manager @@ -37,4 +30,5 @@ type Manager struct { appConfig appConfig.Config config Config E2Manager e2.Manager + UeManager uemgr.Manager } diff --git a/pkg/southbound/e2/options.go b/pkg/southbound/e2/options.go index 6407f4b..93e6dba 100644 --- a/pkg/southbound/e2/options.go +++ b/pkg/southbound/e2/options.go @@ -6,26 +6,16 @@ import ( // e2 config type Config struct { - AppID string - AppConfig *appConfig.AppConfig - E2tAddress string - E2tPort int - TopoAddress string - TopoPort int - KpmSM - RsmSM -} - -// KPM Service Model config -type KpmSM struct { - Name string - Version string -} - -// RSM Service Model config -type RsmSM struct { - Name string - Version string + AppID string + AppConfig *appConfig.AppConfig + E2tAddress string + E2tPort int + TopoAddress string + TopoPort int + KpmSMName string + KpmSMVersion string + RsmSMName string + RsmSMVersion string } // E2 Manager