summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go
index b7abe886..66e5ff30 100644
--- a/packet/bgp/bgp.go
+++ b/packet/bgp/bgp.go
@@ -6042,6 +6042,20 @@ func (p *PathAttributeMpUnreachNLRI) Serialize(options ...*MarshallingOption) ([
return p.PathAttribute.Serialize(options...)
}
+func (p *PathAttributeMpUnreachNLRI) MarshalJSON() ([]byte, error) {
+ return json.Marshal(struct {
+ Type BGPAttrType `json:"type"`
+ AFI uint16 `json:"afi"`
+ SAFI uint8 `json:"safi"`
+ Value []AddrPrefixInterface `json:"value"`
+ }{
+ Type: p.GetType(),
+ AFI: p.AFI,
+ SAFI: p.SAFI,
+ Value: p.Value,
+ })
+}
+
func (p *PathAttributeMpUnreachNLRI) String() string {
if len(p.Value) > 0 {
return fmt.Sprintf("{MpUnreach(%s): {NLRIs: %s}}", AfiSafiToRouteFamily(p.AFI, p.SAFI), p.Value)