diff --git a/ekms/handlers/danet/assignForwardingHandler.go b/ekms/handlers/danet/assignForwardingHandler.go index 4817e421e561eede29f1f07885e4adb52e479d71..bc0b188101b4503c578ea8a8676062fbe191a6c8 100644 --- a/ekms/handlers/danet/assignForwardingHandler.go +++ b/ekms/handlers/danet/assignForwardingHandler.go @@ -81,6 +81,7 @@ func (yh *AssignForwardingHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnmi initKMS = &kms.RemoteKMS{ Id: initiatingKmsAddress.GetNodeId(), Address: initiatingKmsAddressString, + Port: initiatingKmsAddress.GetPort(), } } diff --git a/ekms/handlers/danet/keyRoutingSessionsHandler.go b/ekms/handlers/danet/keyRoutingSessionsHandler.go index c73d88020de59eacefe9a938e004ac432a6fe1fe..68073274e2289324894cef705fa8a624ef53a815 100644 --- a/ekms/handlers/danet/keyRoutingSessionsHandler.go +++ b/ekms/handlers/danet/keyRoutingSessionsHandler.go @@ -2,6 +2,7 @@ package danet import ( "fmt" + "strings" "code.fbi.h-da.de/danet/quant/ekms/etsiqkdnclient" "code.fbi.h-da.de/danet/quant/ekms/internal/kms" @@ -119,6 +120,7 @@ func (yh *KeyRoutingSessionHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnm initKMS = &kms.RemoteKMS{ Id: initiatingKmsAddress.GetNodeId(), Address: initiatingKmsAddressString, + Port: initiatingKmsAddress.GetPort(), } } @@ -151,6 +153,18 @@ func updateOrCreateKeyRoutingSessions(confKMS *gnmitargetygot.Temp_KeyRoutingSes confNextHop.Port = ygot.Uint16(route.Next.Address().AddrPort().Port()) } + if route.RemoteKMS != nil { + confTempRoutingSessionInitAddress := confTempRoutingSession.GetOrCreateInitiatingKmsAddress() + if route.RemoteKMS.Address != "" { + confTempRoutingSessionInitAddress.IpAddress = ygot.String(strings.Split(route.RemoteKMS.Address, ":")[0]) // TODO: maybe split address in remote kms and not in one string? + confTempRoutingSessionInitAddress.Port = ygot.Uint16(route.RemoteKMS.Port) + confTempRoutingSessionInitAddress.Hostname = ygot.String(strings.Split(route.RemoteKMS.Address, ":")[0]) // TODO: maybe split address in remote kms and not in one string? + } + if route.RemoteKMS.Id != "" { + confTempRoutingSessionInitAddress.NodeId = ygot.String(route.RemoteKMS.Id) + } + } + // TODO: add key properties // confKeyProperties := confTempRoutingSession.GetOrCreateKeyProperties() diff --git a/ekms/handlers/danet/peerHandler.go b/ekms/handlers/danet/peerHandler.go index f0f17572ee3f1e141ebce09d9fdaec28e7a56fa7..1a22e2753c53a186f98be3ecc0d230b73df538fb 100644 --- a/ekms/handlers/danet/peerHandler.go +++ b/ekms/handlers/danet/peerHandler.go @@ -90,6 +90,8 @@ func updateOrCreatePeerTable(confKMS *gnmitargetygot.Temp_KmsPeerTable, ekmsClie confTempPeerAddress.IpAddress = ygot.String(peer.Address().IP.String()) confTempPeerAddress.Port = ygot.Uint16(uint16(peer.Address().Port)) + confTempPeerAddress.Hostname = ygot.String(peer.Address().String()) // TODO: get real hostname here + confTempPeerAddress.NodeId = ygot.String(peer.GetKmsPeerId().String()) // TODO: implement for kms, curently hardcoded confInterKmsProtocol := confTempPeerInformation.GetOrCreateInterKmsProtocol() diff --git a/ekms/internal/kms/kms.go b/ekms/internal/kms/kms.go index c153679d85f3a92c566fb89cf7fe4483aeb83eb7..62f0937fa6a37f812fac76f67cc83b78aa51b5f4 100644 --- a/ekms/internal/kms/kms.go +++ b/ekms/internal/kms/kms.go @@ -38,6 +38,7 @@ type Route struct { type RemoteKMS struct { Id string Address string + Port uint16 } type BitKeyLength string