From 6178fc524f320a7fcd72f634659bb00eac6477a6 Mon Sep 17 00:00:00 2001 From: JieJhih Jhang Date: Mon, 13 Jul 2020 01:20:55 +0800 Subject: implement LsAddrPrefix marshal json function --- pkg/packet/bgp/bgp.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go index 2790c080..0bb399b7 100644 --- a/pkg/packet/bgp/bgp.go +++ b/pkg/packet/bgp/bgp.go @@ -7800,7 +7800,15 @@ func (l *LsAddrPrefix) Serialize(options ...*MarshallingOption) ([]byte, error) } func (l *LsAddrPrefix) MarshalJSON() ([]byte, error) { - return nil, nil + return json.Marshal(struct { + Type LsNLRIType `json:"type"` + Length uint16 `json:"length"` + NLRI string `json:"nlri"` + }{ + l.Type, + l.Length, + l.String(), + }) } func (l *LsAddrPrefix) String() string { -- cgit v1.2.3