diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-12 08:15:25 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-20 13:14:09 +0900 |
commit | d62e65f4fe06deca5c4ce7dee957a9b517b80f12 (patch) | |
tree | c0541bc16c3b4b08b8e71e1ac66daa4ea23b3224 /packet | |
parent | 2b60347cfd5bfc48303aba038a18770f006ff7a6 (diff) |
fsm: improve debug message
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-rw-r--r-- | packet/bgp/bgp.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 9ea753c4..de5545d0 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -4660,6 +4660,10 @@ func (p *PathAttributeMpReachNLRI) MarshalJSON() ([]byte, error) { }) } +func (p *PathAttributeMpReachNLRI) String() string { + return fmt.Sprintf("{MpReach(%s): {Nexthop: %s, NLRIs: %s}}", AfiSafiToRouteFamily(p.AFI, p.SAFI), p.Nexthop, p.Value) +} + func NewPathAttributeMpReachNLRI(nexthop string, nlri []AddrPrefixInterface) *PathAttributeMpReachNLRI { t := BGP_ATTR_TYPE_MP_REACH_NLRI ip := net.ParseIP(nexthop) @@ -4742,6 +4746,13 @@ func (p *PathAttributeMpUnreachNLRI) Serialize() ([]byte, error) { return p.PathAttribute.Serialize() } +func (p *PathAttributeMpUnreachNLRI) String() string { + if len(p.Value) > 0 { + return fmt.Sprintf("{MpUnreach(%s): {NLRIs: %s}}", AfiSafiToRouteFamily(p.AFI, p.SAFI), p.Value) + } + return fmt.Sprintf("{MpUnreach(%s): End-of-Rib}", AfiSafiToRouteFamily(p.AFI, p.SAFI)) +} + func NewPathAttributeMpUnreachNLRI(nlri []AddrPrefixInterface) *PathAttributeMpUnreachNLRI { t := BGP_ATTR_TYPE_MP_UNREACH_NLRI p := &PathAttributeMpUnreachNLRI{ |