From ca2428ecafe173437cac2e3aa30918f614a90a94 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 20 Jul 2020 15:55:31 -0700 Subject: [PATCH] tailcfg: add Hostinfo.OSVersion, DeviceModel Signed-off-by: Brad Fitzpatrick --- tailcfg/tailcfg.go | 2 ++ tailcfg/tailcfg_test.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index a83bbabc4..5ae8936c2 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -284,6 +284,8 @@ type Hostinfo struct { FrontendLogID string // logtail ID of frontend instance BackendLogID string // logtail ID of backend instance OS string // operating system the client runs on (a version.OS value) + OSVersion string // operating system version, with optional distro prefix ("Debian 10.4", "Windows 10 Pro 10.0.19041") + DeviceModel string // mobile phone model ("Pixel 3a", "iPhone 11 Pro") Hostname string // name of the host the client runs on RoutableIPs []wgcfg.CIDR `json:",omitempty"` // set of IP ranges this client can route RequestTags []string `json:",omitempty"` // set of ACL tags this node wants to claim diff --git a/tailcfg/tailcfg_test.go b/tailcfg/tailcfg_test.go index f33cad4e5..cd35f7647 100644 --- a/tailcfg/tailcfg_test.go +++ b/tailcfg/tailcfg_test.go @@ -23,7 +23,8 @@ func fieldsOf(t reflect.Type) (fields []string) { func TestHostinfoEqual(t *testing.T) { hiHandles := []string{ - "IPNVersion", "FrontendLogID", "BackendLogID", "OS", "Hostname", "RoutableIPs", "RequestTags", "Services", + "IPNVersion", "FrontendLogID", "BackendLogID", "OS", "OSVersion", + "DeviceModel", "Hostname", "RoutableIPs", "RequestTags", "Services", "NetInfo", } if have := fieldsOf(reflect.TypeOf(Hostinfo{})); !reflect.DeepEqual(have, hiHandles) {