summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/apiutil
diff options
context:
space:
mode:
authorSerguei Bezverkhi <sbezverk@cisco.com>2020-11-25 17:29:13 -0500
committerSerguei Bezverkhi <sbezverk@cisco.com>2020-11-25 17:29:13 -0500
commit48e55b7c388dd6912f4c7f39998723b4ab6159e3 (patch)
tree242bfba54e72ca8bc8cfbe0a77200b5b79e8c58e /internal/pkg/apiutil
parent66413b5335790dc9110b80c8cffe31b3259df9d2 (diff)
code changes
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
Diffstat (limited to 'internal/pkg/apiutil')
-rw-r--r--internal/pkg/apiutil/attribute.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/pkg/apiutil/attribute.go b/internal/pkg/apiutil/attribute.go
index 9d70802b..112df6ff 100644
--- a/internal/pkg/apiutil/attribute.go
+++ b/internal/pkg/apiutil/attribute.go
@@ -768,6 +768,13 @@ func UnmarshalNLRI(rf bgp.RouteFamily, an *any.Any) (bgp.AddrPrefixInterface, er
}
nlri = bgp.NewEVPNIPPrefixRoute(rd, *esi, v.EthernetTag, uint8(v.IpPrefixLen), v.IpPrefix, v.GwAddress, v.Label)
}
+ case *api.SRPolicyNLRI:
+ switch rf {
+ case bgp.RF_SR_POLICY_IPv4:
+ nlri = bgp.NewSRPolicyIPv4(v.Length, v.Distinguisher, v.Color, v.Endpoint)
+ case bgp.RF_SR_POLICY_IPv6:
+ nlri = bgp.NewSRPolicyIPv6(v.Length, v.Distinguisher, v.Color, v.Endpoint)
+ }
case *api.LabeledVPNIPAddressPrefix:
rd, err := UnmarshalRD(v.Rd)
if err != nil {
@@ -1604,6 +1611,11 @@ func unmarshalAttribute(an *any.Any) (bgp.PathAttributeInterface, error) {
subTlv = bgp.NewTunnelEncapSubTLVProtocol(uint16(sv.Protocol))
case *api.TunnelEncapSubTLVColor:
subTlv = bgp.NewTunnelEncapSubTLVColor(sv.Color)
+
+ // TODO (sbezverk) Add processing SR Policy Tunnel sub tlv
+ case *api.TunnelEncapSubTLVSRPreference:
+ subTlv = bgp.NewTunnelEncapSubTLVSRPreference(sv.Flags, sv.Preference)
+
case *api.TunnelEncapSubTLVUnknown:
subTlv = bgp.NewTunnelEncapSubTLVUnknown(bgp.EncapSubTLVType(sv.Type), sv.Value)
default: