diff options
author | JieJhih Jhang <jiejhihjhang@gmail.com> | 2020-07-13 01:20:55 +0800 |
---|---|---|
committer | JieJhih Jhang <jiejhihjhang@gmail.com> | 2020-07-13 01:20:55 +0800 |
commit | 6178fc524f320a7fcd72f634659bb00eac6477a6 (patch) | |
tree | e0e3f6a3e8ab470619ed38d8ea32490de470919d /pkg | |
parent | ffa47a6c7e13ecbb78f0b4ab3ed0244f3084569c (diff) |
implement LsAddrPrefix marshal json function
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/packet/bgp/bgp.go | 10 |
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 { |