summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp
diff options
context:
space:
mode:
Diffstat (limited to 'packet/bgp')
-rw-r--r--packet/bgp/bgp.go11
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{