summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJieJhih Jhang <jiejhihjhang@gmail.com>2020-07-13 01:20:55 +0800
committerJieJhih Jhang <jiejhihjhang@gmail.com>2020-07-13 01:20:55 +0800
commit6178fc524f320a7fcd72f634659bb00eac6477a6 (patch)
treee0e3f6a3e8ab470619ed38d8ea32490de470919d
parentffa47a6c7e13ecbb78f0b4ab3ed0244f3084569c (diff)
implement LsAddrPrefix marshal json function
-rw-r--r--pkg/packet/bgp/bgp.go10
1 files changed, 9 insertions, 1 deletions
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 {