func (r *Route) MarshalJSON() ([]byte, error) { rt := route{ Dst: ip.IPNet(r.Dst), GW: r.GW, } return json.Marshal(rt) }
func (c *IPConfig) MarshalJSON() ([]byte, error) { ipc := ipConfig{ IP: ip.IPNet(c.IP), Gateway: c.Gateway, Routes: c.Routes, } return json.Marshal(ipc) }