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
35 //TODO: change flag to pflag (won't need any argument parse)
38 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
41 "routing-manager/pkg/nbi"
42 //"routing-manager/pkg/rpe"
43 "routing-manager/pkg/rtmgr"
44 //"routing-manager/pkg/sbi"
45 //"routing-manager/pkg/sdl"
50 const SERVICENAME = "rtmgr"
52 func SetupCloseHandler() {
53 c := make(chan os.Signal, 2)
54 signal.Notify(c, os.Interrupt, syscall.SIGTERM)
57 xapp.Logger.Info("\r- Ctrl+C pressed in Terminal")
66 xapp.Logger.Info("Start " + SERVICENAME + " service")
67 rtmgr.Eps = make(rtmgr.Endpoints)
68 rtmgr.Mtype = make(rtmgr.MessageTypeList)
69 rtmgr.Rtmgr_ready = false
71 // RMR thread is starting port: 4560
75 // Waiting for RMR to be ready
76 time.Sleep(time.Duration(2) * time.Second)
77 for xapp.Rmr.IsReady() == false {
78 time.Sleep(time.Duration(2) * time.Second)
81 dummy_whid := int(xapp.Rmr.Openwh("localhost:4560"))
82 xapp.Logger.Info("created dummy Wormhole ID for routingmanager and dummy_whid :%d", dummy_whid)