summaryrefslogtreecommitdiffhomepage
path: root/packet/bgp/bgp.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-03-03 13:45:36 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-18 07:09:30 +0000
commit1c50e56b7ac74287531142f7ecf55183a7ca8b66 (patch)
tree0b2b303a4a7423e90c9c96af6a168671ac25fc3b /packet/bgp/bgp.go
parent70e24d96ece4e9405284434de9458e1fb3c77974 (diff)
packet: add MarshalJSON method for FlowSpecUnknown struct
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'packet/bgp/bgp.go')
-rw-r--r--packet/bgp/bgp.go10
1 files changed, 10 insertions, 0 deletions
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