summaryrefslogtreecommitdiffhomepage
path: root/table/destination.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/destination.go')
-rw-r--r--table/destination.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/table/destination.go b/table/destination.go
index 2954c699..f6ee4030 100644
--- a/table/destination.go
+++ b/table/destination.go
@@ -855,3 +855,14 @@ func (ipv6d *IPv6Destination) getPrefix() net.IP {
}
return ip
}
+
+func (ipv6d *IPv6Destination) MarshalJSON() ([]byte, error) {
+ prefix := ipv6d.getNlri().(*bgp.IPv6AddrPrefix).Prefix
+ return json.Marshal(struct {
+ Prefix string
+ Paths []Path
+ }{
+ Prefix: prefix.String(),
+ Paths: ipv6d.knownPathList,
+ })
+}