summaryrefslogtreecommitdiffhomepage
path: root/packet
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-06 21:01:31 -0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-01-06 21:01:31 -0800
commitbdbb80e9a6eb2928f4942b432dba0fb0595fc658 (patch)
tree0b4873aa89db7b565944283e9930afd5fe17cb40 /packet
parent3371547e00ded7a9c329ccf84827a55dd7d7d084 (diff)
table: fix rib presentation
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'packet')
-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{