summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp.go
diff options
context:
space:
mode:
Diffstat (limited to 'packet/bgp.go')
-rw-r--r--packet/bgp.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/packet/bgp.go b/packet/bgp.go
index 26bdd6a6..32690745 100644
--- a/packet/bgp.go
+++ b/packet/bgp.go
@@ -1724,6 +1724,18 @@ func (p *PathAttributeMpReachNLRI) Serialize() ([]byte, error) {
return p.PathAttribute.Serialize()
}
+func (p *PathAttributeMpReachNLRI) MarshalJSON() ([]byte, error) {
+ // TODO: fix address printing
+ return json.Marshal(struct {
+ Type string
+ Nexthop string
+ Address []string
+ }{
+ Type: p.Type.String(),
+ Nexthop: p.Nexthop.String(),
+ })
+}
+
func NewPathAttributeMpReachNLRI(nexthop string, nlri []AddrPrefixInterface) *PathAttributeMpReachNLRI {
return &PathAttributeMpReachNLRI{
PathAttribute: PathAttribute{