summaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorValli A. Vallimamod <vma@sip.solutions>2020-07-29 17:52:32 +0200
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2020-11-10 22:17:26 +0900
commitc0d75f780617ee9f62f02dc79acb1fc1fef5b7a8 (patch)
tree3d3d627564504741d09af69c5ad89090d4c996cb /internal
parentc595b561669e55103fc043a807e0d13e82990be8 (diff)
updates NLRI marshaller to include added fields
Diffstat (limited to 'internal')
-rw-r--r--internal/pkg/apiutil/attribute.go28
1 files 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),
}
}
}