diff --git a/route/bgp_path.go b/route/bgp_path.go index 4b0b852cc7097859dc737a83e713eae4c5871df7..6b63916bf99102238561b14f78743e3ce2f41404 100644 --- a/route/bgp_path.go +++ b/route/bgp_path.go @@ -242,6 +242,14 @@ func (b *BGPPath) Print() string { ret += fmt.Sprintf("\t\tCommunities: %v\n", b.Communities) ret += fmt.Sprintf("\t\tLargeCommunities: %v\n", b.LargeCommunities) + if b.OriginatorID != 0 { + oid := uint32To4Byte(b.OriginatorID) + ret += fmt.Sprintf("\t\tOriginatorID: %d.%d.%d.%d\n", oid[0], oid[1], oid[2], oid[3]) + } + if b.ClusterList != nil { + ret += fmt.Sprintf("\t\tClusterList %s\n", b.ClusterListString()) + } + return ret } @@ -334,6 +342,17 @@ func (b *BGPPath) CommunitiesString() string { return strings.TrimRight(str, " ") } +// ClusterListString returns the formated ClusterList +func (b *BGPPath) ClusterListString() string { + str := "" + for _, cid := range b.ClusterList { + octes := uint32To4Byte(cid) + str += fmt.Sprintf("%d.%d.%d.%d ", octes[0], octes[1], octes[2], octes[3]) + } + + return strings.TrimRight(str, " ") +} + // LargeCommunitiesString returns the formated communities func (b *BGPPath) LargeCommunitiesString() string { str := ""