diff --git a/go.mod b/go.mod index f310b159..04396008 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/uuid v1.3.0 github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf - github.com/jalapeno-api-gateway/jagw-go v1.3.3 + github.com/jalapeno-api-gateway/jagw-go v1.3.4-beta github.com/nqd/flat v0.1.1 github.com/sirupsen/logrus v1.9.0 google.golang.org/grpc v1.51.0 diff --git a/go.sum b/go.sum index 00ca8e65..c544fdd2 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,10 @@ github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf h1:7JTmne github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/jalapeno-api-gateway/jagw-go v1.3.3 h1:+dBl0it3SxQeKF0VuoiSs/m1INCdcc3FbkjfZX5dTfk= github.com/jalapeno-api-gateway/jagw-go v1.3.3/go.mod h1:qAWkx3+8xsQj5rvtoEpfaMok6zpgS8VU7Huytf9sybk= +github.com/jalapeno-api-gateway/jagw-go v1.3.4-alpha h1:LzoRb4nAV9fNjo5VslIxHsQgqLX4MWHl4mYT3TGUhJk= +github.com/jalapeno-api-gateway/jagw-go v1.3.4-alpha/go.mod h1:qAWkx3+8xsQj5rvtoEpfaMok6zpgS8VU7Huytf9sybk= +github.com/jalapeno-api-gateway/jagw-go v1.3.4-beta h1:jD8g/ghSfrIsWPZzX8GSvLPAAtQ6CCJSpJnDucb+vfk= +github.com/jalapeno-api-gateway/jagw-go v1.3.4-beta/go.mod h1:qAWkx3+8xsQj5rvtoEpfaMok6zpgS8VU7Huytf9sybk= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= diff --git a/pkg/arango/document-types.go b/pkg/arango/document-types.go index ac5a2a72..2c7e3e46 100644 --- a/pkg/arango/document-types.go +++ b/pkg/arango/document-types.go @@ -46,6 +46,12 @@ type LSLink struct { RemoteIGPRouterID string `json:"remote_igp_router_id,omitempty"` UnidirLinkDelay uint32 `json:"unidir_link_delay,omitempty"` UnidirLinkDelayMinMax []uint32 `json:"unidir_link_delay_min_max,omitempty"` + MaxLinkBWKbps uint64 `json:"max_link_bw_kbps,omitempty"` + UnidirDelayVariation uint32 `json:"unidir_delay_variation,omitempty"` + UnidirPacketLoss float32 `json:"unidir_packet_loss,omitempty"` + UnidirResidualBW uint32 `json:"unidir_residual_bw,omitempty"` + UnidirAvailableBW uint32 `json:"unidir_available_bw,omitempty"` + UnidirBWUtilization uint32 `json:"unidir_bw_utilization,omitempty"` } type LSPrefix struct { diff --git a/pkg/model/property/class-properties.go b/pkg/model/property/class-properties.go index 9bd043e8..296d4d22 100644 --- a/pkg/model/property/class-properties.go +++ b/pkg/model/property/class-properties.go @@ -44,6 +44,12 @@ var AllLsLinkProperties = []string{ RemoteIgpRouterId, UnidirLinkDelay, UnidirLinkDelayMinMax, + MaxLinkBWKbps, + UnidirDelayVariation, + UnidirPacketLoss, + UnidirResidualBW, + UnidirAvailableBW, + UnidirBWUtilization, } var AllLsPrefixProperties = []string{ diff --git a/pkg/model/property/property.go b/pkg/model/property/property.go index df4efec8..13fb17ba 100644 --- a/pkg/model/property/property.go +++ b/pkg/model/property/property.go @@ -45,4 +45,10 @@ const ( Longitude = "Longitude" UnidirLinkDelay = "UnidirLinkDelay" UnidirLinkDelayMinMax = "UnidirLinkDelayMinMax" + MaxLinkBWKbps = "MaxLinkBWKbps" + UnidirDelayVariation = "UnidirDelayVariation" + UnidirPacketLoss = "UnidirPacketLoss" + UnidirResidualBW = "UnidirResidualBW" + UnidirAvailableBW = "UnidirAvailableBW" + UnidirBWUtilization = "UnidirBWUtilization" ) diff --git a/pkg/model/topology/document-converters.go b/pkg/model/topology/document-converters.go index ffeed277..9198278d 100644 --- a/pkg/model/topology/document-converters.go +++ b/pkg/model/topology/document-converters.go @@ -59,6 +59,12 @@ func ConvertLsLink(doc arango.LSLink) LsLink { RemoteIgpRouterId: doc.RemoteIGPRouterID, UnidirLinkDelay: doc.UnidirLinkDelay, UnidirLinkDelayMinMax: doc.UnidirLinkDelayMinMax, + MaxLinkBWKbps: doc.MaxLinkBWKbps, + UnidirDelayVariation: doc.UnidirDelayVariation, + UnidirPacketLoss: doc.UnidirPacketLoss, + UnidirResidualBW: doc.UnidirResidualBW, + UnidirAvailableBW: doc.UnidirAvailableBW, + UnidirBWUtilization: doc.UnidirBWUtilization, } } diff --git a/pkg/model/topology/documents.go b/pkg/model/topology/documents.go index 0dcc782b..ffd75983 100644 --- a/pkg/model/topology/documents.go +++ b/pkg/model/topology/documents.go @@ -52,6 +52,12 @@ type LsLink struct { RemoteIgpRouterId string UnidirLinkDelay uint32 UnidirLinkDelayMinMax []uint32 + MaxLinkBWKbps uint64 + UnidirDelayVariation uint32 + UnidirPacketLoss float32 + UnidirResidualBW uint32 + UnidirAvailableBW uint32 + UnidirBWUtilization uint32 } type LsPrefix struct { diff --git a/pkg/requestservice/topology.go b/pkg/requestservice/topology.go index 78933694..f69a1553 100644 --- a/pkg/requestservice/topology.go +++ b/pkg/requestservice/topology.go @@ -124,6 +124,18 @@ func convertLsLink(doc interface{}, properties []string) *jagw.LsLink { lsLink.UnidirLinkDelay = proto.Uint32(document.UnidirLinkDelay) case property.UnidirLinkDelayMinMax: lsLink.UnidirLinkDelayMinMax = document.UnidirLinkDelayMinMax + case property.MaxLinkBWKbps: + lsLink.MaxLinkBwKbps = proto.Uint64(document.MaxLinkBWKbps) + case property.UnidirDelayVariation: + lsLink.UnidirDelayVariation = proto.Uint32(document.UnidirDelayVariation) + case property.UnidirPacketLoss: + lsLink.UnidirPacketLoss = proto.Float32(document.UnidirPacketLoss) + case property.UnidirResidualBW: + lsLink.UnidirResidualBw = proto.Uint32(document.UnidirResidualBW) + case property.UnidirAvailableBW: + lsLink.UnidirAvailableBw = proto.Uint32(document.UnidirAvailableBW) + case property.UnidirBWUtilization: + lsLink.UnidirBwUtilization = proto.Uint32(document.UnidirBWUtilization) } } diff --git a/pkg/subscriptionservice/topology.go b/pkg/subscriptionservice/topology.go index 91f252fe..8095e963 100644 --- a/pkg/subscriptionservice/topology.go +++ b/pkg/subscriptionservice/topology.go @@ -56,26 +56,34 @@ func convertLsLinkEvent(event messages.TopologyEvent) *jagw.LsLinkEvent { } response.LsLink = &jagw.LsLink{ - Key: proto.String(document.Key), - Id: proto.String(document.ID), - RouterHash: proto.String(document.RouterHash), - RouterIp: proto.String(document.RouterIP), - DomainId: proto.Int64(document.DomainID), - PeerHash: proto.String(document.PeerHash), - PeerIp: proto.String(document.PeerIP), - PeerAsn: proto.Int32(document.PeerASN), - Timestamp: proto.String(document.Timestamp), - IgpRouterId: proto.String(document.IGPRouterID), - Protocol: proto.String(document.Protocol), - AreaId: proto.String(document.AreaID), - Nexthop: proto.String(document.Nexthop), - Mtid: convertMTID(document.MTID), - LocalLinkIp: proto.String(document.LocalLinkIP), - RemoteLinkIp: proto.String(document.RemoteLinkIP), - IgpMetric: proto.Uint32(document.IGPMetric), - RemoteNodeHash: proto.String(document.RemoteNodeHash), - LocalNodeHash: proto.String(document.LocalNodeHash), - RemoteIgpRouterId: proto.String(document.RemoteIGPRouterID), + Key: proto.String(document.Key), + Id: proto.String(document.ID), + RouterHash: proto.String(document.RouterHash), + RouterIp: proto.String(document.RouterIP), + DomainId: proto.Int64(document.DomainID), + PeerHash: proto.String(document.PeerHash), + PeerIp: proto.String(document.PeerIP), + PeerAsn: proto.Int32(document.PeerASN), + Timestamp: proto.String(document.Timestamp), + IgpRouterId: proto.String(document.IGPRouterID), + Protocol: proto.String(document.Protocol), + AreaId: proto.String(document.AreaID), + Nexthop: proto.String(document.Nexthop), + Mtid: convertMTID(document.MTID), + LocalLinkIp: proto.String(document.LocalLinkIP), + RemoteLinkIp: proto.String(document.RemoteLinkIP), + IgpMetric: proto.Uint32(document.IGPMetric), + RemoteNodeHash: proto.String(document.RemoteNodeHash), + LocalNodeHash: proto.String(document.LocalNodeHash), + RemoteIgpRouterId: proto.String(document.RemoteIGPRouterID), + UnidirLinkDelay: proto.Uint32(document.UnidirLinkDelay), + UnidirLinkDelayMinMax: document.UnidirLinkDelayMinMax, + MaxLinkBwKbps: proto.Uint64(document.MaxLinkBWKbps), + UnidirDelayVariation: proto.Uint32(document.UnidirDelayVariation), + UnidirPacketLoss: proto.Float32(document.UnidirPacketLoss), + UnidirResidualBw: proto.Uint32(document.UnidirResidualBW), + UnidirAvailableBw: proto.Uint32(document.UnidirAvailableBW), + UnidirBwUtilization: proto.Uint32(document.UnidirBWUtilization), } return response diff --git a/proto/core/topology.proto b/proto/core/topology.proto index ab4c7621..9133bc9d 100644 --- a/proto/core/topology.proto +++ b/proto/core/topology.proto @@ -51,6 +51,12 @@ message LsLink { optional string remote_igp_router_id = 22; optional uint32 unidir_link_delay = 23; repeated uint32 unidir_link_delay_min_max = 24; + optional uint64 max_link_bw_kbps = 25; + optional uint32 unidir_delay_variation = 26; + optional float unidir_packet_loss = 27; + optional uint32 unidir_residual_bw = 28; + optional uint32 unidir_available_bw = 29; + optional uint32 unidir_bw_utilization = 30; } message LsPrefix {