"e2mgr/rNibWriter"
"e2mgr/rmrCgo"
"e2mgr/services"
+ "e2mgr/sessions"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "time"
)
type RanSetupManager struct {
// ExecuteSetup updates the connection status and number of attempts in the nodebInfo and send an endc/x2 setup request to establish a connection with the RAN
func (m *RanSetupManager) ExecuteSetup(nodebInfo *entities.NodebInfo) error {
+ //Fill details for the response handler
+ requestDetails := models.RequestDetails{RanName: nodebInfo.RanName, RanPort: uint16(nodebInfo.Port), RanIp: nodebInfo.Ip}
+ m.rmrService.E2sessions[nodebInfo.RanName] = sessions.E2SessionDetails{SessionStart: time.Now(), Request: &requestDetails}
+
// Update retries and connection status (connecting)
if err := m.updateConnectionStatusConnecting(nodebInfo); err != nil {
+ delete(m.rmrService.E2sessions,nodebInfo.RanName)
return e2managererrors.NewRnibDbError()
}
// Build the endc/x2 setup request
rmrMsgType, request, err := m.prepareSetupRequest(nodebInfo)
if err != nil {
+ delete(m.rmrService.E2sessions,nodebInfo.RanName)
return err
}
if err := m.rmrService.SendRmrMessage(response); err != nil {
m.logger.Errorf("#RanSetupManager.ExecuteSetup - failed to send setup request to RMR: %s", err)
+ delete(m.rmrService.E2sessions,nodebInfo.RanName)
+
// Decrement retries and connection status (disconnected)
if err := m.updateConnectionStatusDisconnected(nodebInfo); err != nil {
return e2managererrors.NewRnibDbError()