diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-06 21:01:31 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-06 21:01:31 -0800 |
commit | bdbb80e9a6eb2928f4942b432dba0fb0595fc658 (patch) | |
tree | 0b4873aa89db7b565944283e9930afd5fe17cb40 /packet | |
parent | 3371547e00ded7a9c329ccf84827a55dd7d7d084 (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.go | 12 |
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{ |