Skip to content
Snippets Groups Projects
Commit 0b4d858e authored by Maximilian Wilhelm's avatar Maximilian Wilhelm
Browse files

Print OriginatorID and ClusterList in BGPPath, too.

parent 60f8ce22
Branches
Tags
No related merge requests found
...@@ -242,6 +242,14 @@ func (b *BGPPath) Print() string { ...@@ -242,6 +242,14 @@ func (b *BGPPath) Print() string {
ret += fmt.Sprintf("\t\tCommunities: %v\n", b.Communities) ret += fmt.Sprintf("\t\tCommunities: %v\n", b.Communities)
ret += fmt.Sprintf("\t\tLargeCommunities: %v\n", b.LargeCommunities) 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 return ret
} }
...@@ -334,6 +342,17 @@ func (b *BGPPath) CommunitiesString() string { ...@@ -334,6 +342,17 @@ func (b *BGPPath) CommunitiesString() string {
return strings.TrimRight(str, " ") 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 // LargeCommunitiesString returns the formated communities
func (b *BGPPath) LargeCommunitiesString() string { func (b *BGPPath) LargeCommunitiesString() string {
str := "" str := ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment