diff options
Diffstat (limited to 'table/destination.go')
-rw-r--r-- | table/destination.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/table/destination.go b/table/destination.go index de2bf659..61d3e4c8 100644 --- a/table/destination.go +++ b/table/destination.go @@ -76,6 +76,21 @@ func (lhs *PeerInfo) Equal(rhs *PeerInfo) bool { return false } +func (i *PeerInfo) String() string { + if i.Address == nil { + return "local" + } + s := bytes.NewBuffer(make([]byte, 0, 64)) + s.WriteString(fmt.Sprintf("{ %s | ", i.Address)) + s.WriteString(fmt.Sprintf("as: %d", i.AS)) + s.WriteString(fmt.Sprintf(", id: %s", i.ID)) + if i.RouteReflectorClient { + s.WriteString(fmt.Sprintf(", cluster-id: %s", i.RouteReflectorClusterID)) + } + s.WriteString(" }") + return s.String() +} + type Destination struct { routeFamily bgp.RouteFamily nlri bgp.AddrPrefixInterface |