Skip to content
Snippets Groups Projects
Commit 67b80b3b authored by Fabian Seidl's avatar Fabian Seidl
Browse files

added missing parameters to route session

See merge request !83
parent 50fce357
No related branches found
No related tags found
1 merge request!83added missing parameters to route session
Pipeline #188438 passed
...@@ -81,6 +81,7 @@ func (yh *AssignForwardingHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnmi ...@@ -81,6 +81,7 @@ func (yh *AssignForwardingHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnmi
initKMS = &kms.RemoteKMS{ initKMS = &kms.RemoteKMS{
Id: initiatingKmsAddress.GetNodeId(), Id: initiatingKmsAddress.GetNodeId(),
Address: initiatingKmsAddressString, Address: initiatingKmsAddressString,
Port: initiatingKmsAddress.GetPort(),
} }
} }
......
...@@ -2,6 +2,7 @@ package danet ...@@ -2,6 +2,7 @@ package danet
import ( import (
"fmt" "fmt"
"strings"
"code.fbi.h-da.de/danet/quant/ekms/etsiqkdnclient" "code.fbi.h-da.de/danet/quant/ekms/etsiqkdnclient"
"code.fbi.h-da.de/danet/quant/ekms/internal/kms" "code.fbi.h-da.de/danet/quant/ekms/internal/kms"
...@@ -119,6 +120,7 @@ func (yh *KeyRoutingSessionHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnm ...@@ -119,6 +120,7 @@ func (yh *KeyRoutingSessionHandler) Update(c ygot.ValidatedGoStruct, jobs []*gnm
initKMS = &kms.RemoteKMS{ initKMS = &kms.RemoteKMS{
Id: initiatingKmsAddress.GetNodeId(), Id: initiatingKmsAddress.GetNodeId(),
Address: initiatingKmsAddressString, Address: initiatingKmsAddressString,
Port: initiatingKmsAddress.GetPort(),
} }
} }
...@@ -151,6 +153,18 @@ func updateOrCreateKeyRoutingSessions(confKMS *gnmitargetygot.Temp_KeyRoutingSes ...@@ -151,6 +153,18 @@ func updateOrCreateKeyRoutingSessions(confKMS *gnmitargetygot.Temp_KeyRoutingSes
confNextHop.Port = ygot.Uint16(route.Next.Address().AddrPort().Port()) 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 // TODO: add key properties
// confKeyProperties := confTempRoutingSession.GetOrCreateKeyProperties() // confKeyProperties := confTempRoutingSession.GetOrCreateKeyProperties()
......
...@@ -90,6 +90,8 @@ func updateOrCreatePeerTable(confKMS *gnmitargetygot.Temp_KmsPeerTable, ekmsClie ...@@ -90,6 +90,8 @@ func updateOrCreatePeerTable(confKMS *gnmitargetygot.Temp_KmsPeerTable, ekmsClie
confTempPeerAddress.IpAddress = ygot.String(peer.Address().IP.String()) confTempPeerAddress.IpAddress = ygot.String(peer.Address().IP.String())
confTempPeerAddress.Port = ygot.Uint16(uint16(peer.Address().Port)) 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 // TODO: implement for kms, curently hardcoded
confInterKmsProtocol := confTempPeerInformation.GetOrCreateInterKmsProtocol() confInterKmsProtocol := confTempPeerInformation.GetOrCreateInterKmsProtocol()
......
...@@ -38,6 +38,7 @@ type Route struct { ...@@ -38,6 +38,7 @@ type Route struct {
type RemoteKMS struct { type RemoteKMS struct {
Id string Id string
Address string Address string
Port uint16
} }
type BitKeyLength string type BitKeyLength string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment