From 6d20904a90698db2578b6af09e4bc52241f0a1d5 Mon Sep 17 00:00:00 2001 From: rangajal Date: Wed, 8 Jan 2020 12:18:39 +0000 Subject: [PATCH] Check DNS lookup for E2T address, RED Button and KEEP alive message routes added for new E2T Address Change-Id: I98d9c69993c2795076946a5306dfafbd7fd97b45 Signed-off-by: rangajal --- RELNOTES | 3 +++ container-tag.yaml | 2 +- pkg/nbi/httprestful.go | 6 ++++++ pkg/rpe/rpe.go | 10 ++++++---- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/RELNOTES b/RELNOTES index edaf372..f0b7a43 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,3 +1,6 @@ +### v0.4.7 +* Check DNS lookup for E2T address, RED Button and KEEP alive message routes added for new E2T Address + ### v0.4.6 * Static platform routes can be configured via configuration file diff --git a/container-tag.yaml b/container-tag.yaml index 94d6bc0..449899c 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -2,4 +2,4 @@ # By default this file is in the docker build directory, # but the location can configured in the JJB template. --- -tag: 0.4.6 +tag: 0.4.7 diff --git a/pkg/nbi/httprestful.go b/pkg/nbi/httprestful.go index 2e14690..81384c0 100644 --- a/pkg/nbi/httprestful.go +++ b/pkg/nbi/httprestful.go @@ -39,6 +39,7 @@ import ( "github.com/go-openapi/loads" "github.com/go-openapi/runtime/middleware" "net/url" + "net" "os" "routing-manager/pkg/models" "routing-manager/pkg/restapi" @@ -172,6 +173,11 @@ func validateE2tData(data *models.E2tData) error { return fmt.Errorf("E2T E2TAddress is not a proper format like ip:port, %v", e2taddress_key ) } + _, err := net.LookupIP(stringSlice[0]) + if err != nil { + return fmt.Errorf("E2T E2TAddress DNS look up failed, E2TAddress: %v", stringSlice[0]) + } + if checkValidaE2TAddress(e2taddress_key) { return fmt.Errorf("E2TAddress already exist!!!, E2TAddress: %v",e2taddress_key) } diff --git a/pkg/rpe/rpe.go b/pkg/rpe/rpe.go index 64b93fe..8ee9b52 100644 --- a/pkg/rpe/rpe.go +++ b/pkg/rpe/rpe.go @@ -234,12 +234,14 @@ func (r *Rpe) generatePlatformRoutes(e2TermEp []rtmgr.Endpoint, subManEp *rtmgr. case "A1MEDIATOR": Ep = a1mediatorEp } - if routes.EndPoint == "E2TERMINST" && len(e2TermEp) > 0 { - r.addRoute_rx_list(routes.MessageType, sendEp, e2TermEp, routeTable, routes.SubscriptionId, routes.Meid) - continue - } + r.addRoute(routes.MessageType, sendEp, Ep, routeTable, routes.SubscriptionId, routes.Meid) } + + if len(e2TermEp) > 0 { + r.addRoute_rx_list("RIC_SCTP_CLEAR_ALL", e2ManEp, e2TermEp, routeTable, -1, "") + r.addRoute_rx_list("E2_TERM_KEEP_ALIVE_REQ", e2ManEp, e2TermEp, routeTable, -1, "") + } } func (r *Rpe) generateRouteTable(endPointList rtmgr.Endpoints) *rtmgr.RouteTable { -- 2.16.6