diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-11 10:13:30 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-20 13:14:09 +0900 |
commit | 2b60347cfd5bfc48303aba038a18770f006ff7a6 (patch) | |
tree | 775ed258f0f4046a98df6da7a84a6028dbbd8e3d /table/path.go | |
parent | ba727eb444d17b73167d78a71d427c115ec4c34a (diff) |
path: improve Path.String()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go index 397bfbdd..48712610 100644 --- a/table/path.go +++ b/table/path.go @@ -506,6 +506,10 @@ func (path *Path) delPathAttr(typ bgp.BGPAttrType) { // return Path's string representation func (path *Path) String() string { s := bytes.NewBuffer(make([]byte, 0, 64)) + if path.IsEOR() { + s.WriteString(fmt.Sprintf("{ %s EOR | src: %s }", path.GetRouteFamily(), path.GetSource())) + return s.String() + } s.WriteString(fmt.Sprintf("{ %s | ", path.getPrefix())) s.WriteString(fmt.Sprintf("src: %s", path.GetSource())) s.WriteString(fmt.Sprintf(", nh: %s", path.GetNexthop())) |