From 3524c6eff617ede773ee83dce1d50a2601088846 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 7 Dec 2018 22:22:46 +0000 Subject: [PATCH] Add build name and version to getSelf call on admin socket --- src/yggdrasil/admin.go | 2 ++ yggdrasilctl.go | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/yggdrasil/admin.go b/src/yggdrasil/admin.go index 2b5bc64..af59734 100644 --- a/src/yggdrasil/admin.go +++ b/src/yggdrasil/admin.go @@ -556,6 +556,8 @@ func (a *admin) getData_getSelf() *admin_nodeInfo { table := a.core.switchTable.table.Load().(lookupTable) coords := table.self.getCoords() self := admin_nodeInfo{ + {"build_name", GetBuildName()}, + {"build_version", GetBuildVersion()}, {"box_pub_key", hex.EncodeToString(a.core.boxPub[:])}, {"ip", a.core.GetAddress().String()}, {"subnet", a.core.GetSubnet().String()}, diff --git a/yggdrasilctl.go b/yggdrasilctl.go index 79b5f86..6919ec3 100644 --- a/yggdrasilctl.go +++ b/yggdrasilctl.go @@ -181,6 +181,12 @@ func main() { } case "getself": for k, v := range res["self"].(map[string]interface{}) { + if buildname, ok := v.(map[string]interface{})["build_name"].(string); ok { + fmt.Println("Build name:", buildname) + } + if buildversion, ok := v.(map[string]interface{})["build_version"].(string); ok { + fmt.Println("Build version:", buildversion) + } fmt.Println("IPv6 address:", k) if subnet, ok := v.(map[string]interface{})["subnet"].(string); ok { fmt.Println("IPv6 subnet:", subnet)