From 1c50e56b7ac74287531142f7ecf55183a7ca8b66 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Thu, 3 Mar 2016 13:45:36 +0900 Subject: packet: add MarshalJSON method for FlowSpecUnknown struct Signed-off-by: ISHIDA Wataru --- packet/bgp/bgp.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'packet/bgp/bgp.go') diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index bca284d2..b0147a10 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -2951,6 +2951,16 @@ func (p *FlowSpecUnknown) String() string { return fmt.Sprintf("[unknown:%v]", p.Value) } +func (p *FlowSpecUnknown) MarshalJSON() ([]byte, error) { + return json.Marshal(struct { + Type BGPFlowSpecType `json:"type"` + Value string `json:"value"` + }{ + Type: p.Type(), + Value: string(p.Value), + }) +} + type FlowSpecNLRI struct { Value []FlowSpecComponentInterface rf RouteFamily -- cgit v1.2.3