From c0d75f780617ee9f62f02dc79acb1fc1fef5b7a8 Mon Sep 17 00:00:00 2001 From: "Valli A. Vallimamod" Date: Wed, 29 Jul 2020 17:52:32 +0200 Subject: updates NLRI marshaller to include added fields --- internal/pkg/apiutil/attribute.go | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/internal/pkg/apiutil/attribute.go b/internal/pkg/apiutil/attribute.go index 9b73786a..69622b0c 100644 --- a/internal/pkg/apiutil/attribute.go +++ b/internal/pkg/apiutil/attribute.go @@ -634,26 +634,38 @@ func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any { switch n := v.NLRI.(type) { case *bgp.LsNodeNLRI: nlri = &api.LsAddrPrefix{ - Type: api.LsNLRIType_LS_NLRI_NODE, - Nlri: MarshalLsNodeNLRI(n), + Type: api.LsNLRIType_LS_NLRI_NODE, + Length: uint32(n.Length), + ProtocolId: api.LsProtocolID(n.ProtocolID), + Identifier: n.Identifier, + Nlri: MarshalLsNodeNLRI(n), } case *bgp.LsLinkNLRI: nlri = &api.LsAddrPrefix{ - Type: api.LsNLRIType_LS_NLRI_LINK, - Nlri: MarshalLsLinkNLRI(n), + Type: api.LsNLRIType_LS_NLRI_LINK, + Length: uint32(n.Length), + ProtocolId: api.LsProtocolID(n.ProtocolID), + Identifier: n.Identifier, + Nlri: MarshalLsLinkNLRI(n), } case *bgp.LsPrefixV4NLRI: nlri = &api.LsAddrPrefix{ - Type: api.LsNLRIType_LS_NLRI_PREFIX_V4, - Nlri: MarshalLsPrefixV4NLRI(n), + Type: api.LsNLRIType_LS_NLRI_PREFIX_V4, + Length: uint32(n.Length), + ProtocolId: api.LsProtocolID(n.ProtocolID), + Identifier: n.Identifier, + Nlri: MarshalLsPrefixV4NLRI(n), } case *bgp.LsPrefixV6NLRI: nlri = &api.LsAddrPrefix{ - Type: api.LsNLRIType_LS_NLRI_PREFIX_V6, - Nlri: MarshalLsPrefixV6NLRI(n), + Type: api.LsNLRIType_LS_NLRI_PREFIX_V6, + Length: uint32(n.Length), + ProtocolId: api.LsProtocolID(n.ProtocolID), + Identifier: n.Identifier, + Nlri: MarshalLsPrefixV6NLRI(n), } } } -- cgit v1.2.3