2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
19 This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 platform project (RICP).
23 ==================================================================================
27 Abstract: Routing Manager Main file. Implemets the following functions:
28 - parseArgs: reading command line arguments
29 - init:Rtmgr initializing the service modules
30 - serve: running the loop
36 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
39 "routing-manager/pkg/nbi"
40 "routing-manager/pkg/nbi/restful"
41 "routing-manager/pkg/rtmgr"
46 const SERVICENAME = "rtmgr"
48 func SetupCloseHandler() {
49 c := make(chan os.Signal, 2)
50 signal.Notify(c, os.Interrupt, syscall.SIGTERM)
53 xapp.Logger.Info("\r- Ctrl+C pressed in Terminal")
62 xapp.Logger.Info("Start " + SERVICENAME + " service")
63 rtmgr.Eps = make(rtmgr.Endpoints)
64 rtmgr.Mtype = make(rtmgr.MessageTypeList)
65 rtmgr.Rtmgr_ready = false
66 rtmgr.RMRConnStatus = make(map[string]bool)
68 // RMR thread is starting port: 4560
72 // Waiting for RMR to be ready
73 time.Sleep(time.Duration(2) * time.Second)
74 for xapp.Rmr.IsReady() == false {
75 time.Sleep(time.Duration(2) * time.Second)
78 dummy_whid := int(xapp.Rmr.Openwh("rtmgr:4560"))
79 xapp.Logger.Info("created dummy Wormhole ID for routingmanager and dummy_whid :%d", dummy_whid)
82 restful.LaunchRest(xapp.Config.GetString("nbiurl"))