From 56b14bfe6022f87d2982d08936c6e8101ee3524c Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Mon, 6 Mar 2017 20:18:08 +0100 Subject: [PATCH] [TASK] Store gateway6 from gluon-package gluon-radv-filterd (fixed #30) --- data/statistics.go | 3 ++- data/statistics_test.go | 2 +- meshviewer/meshviewer.go | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/data/statistics.go b/data/statistics.go index 6718a33..579d1d4 100644 --- a/data/statistics.go +++ b/data/statistics.go @@ -14,7 +14,8 @@ type Statistics struct { Memory Memory `json:"memory,omitempty"` Uptime float64 `json:"uptime,omitempty"` Idletime float64 `json:"idletime,omitempty"` - Gateway string `json:"gateway,omitempty"` + GatewayIPv4 string `json:"gateway,omitempty"` + GatewayIPv6 string `json:"gateway6,omitempty"` Processes struct { Total uint32 `json:"total"` Running uint32 `json:"running"` diff --git a/data/statistics_test.go b/data/statistics_test.go index c323266..09a8bf4 100644 --- a/data/statistics_test.go +++ b/data/statistics_test.go @@ -14,7 +14,7 @@ func TestStatistics(t *testing.T) { testfile("statistics.json", obj) assert.Equal("f81a67a601ea", obj.NodeID) - assert.Equal("52:54:00:a9:f7:6e", obj.Gateway) + assert.Equal("52:54:00:a9:f7:6e", obj.GatewayIPv4) assert.Equal(float64(57861871176), obj.Traffic.Rx.Bytes) assert.Equal(uint32(35), obj.Clients.Total) assert.Equal(uint32(35), obj.Clients.Wifi) diff --git a/meshviewer/meshviewer.go b/meshviewer/meshviewer.go index b2e3f4d..fd3aa3b 100644 --- a/meshviewer/meshviewer.go +++ b/meshviewer/meshviewer.go @@ -46,7 +46,8 @@ type Statistics struct { MemoryUsage float64 `json:"memory_usage,omitempty"` Uptime float64 `json:"uptime,omitempty"` Idletime float64 `json:"idletime,omitempty"` - Gateway string `json:"gateway,omitempty"` + GatewayIPv4 string `json:"gateway,omitempty"` + GatewayIPv6 string `json:"gateway6,omitempty"` Processes struct { Total uint32 `json:"total"` Running uint32 `json:"running"` @@ -74,7 +75,8 @@ func NewStatistics(stats *data.Statistics) *Statistics { return &Statistics{ NodeID: stats.NodeID, - Gateway: stats.Gateway, + GatewayIPv4: stats.GatewayIPv4, + GatewayIPv6: stats.GatewayIPv6, RootFsUsage: stats.RootFsUsage, LoadAverage: stats.LoadAverage, MemoryUsage: memoryUsage,