From c920ee3c3f96eb3c4f77932692b015ddebea3f60 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 11 Sep 2018 16:11:02 +0900 Subject: [PATCH] ing --- discovery/Host.go | 22 ++++++++++++++-------- discovery/Port.go | 12 ++++++------ discovery/Service.go | 9 ++++----- discovery/Zone.go | 16 ++++++++-------- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/discovery/Host.go b/discovery/Host.go index 566e3fa..b837489 100644 --- a/discovery/Host.go +++ b/discovery/Host.go @@ -6,15 +6,21 @@ import ( ) type Host struct { - MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` - Name string `json:"name,omitempty"` - Address string `json:"address,omitempty"` - Mac string `json:"mac,omitempty"` - Meta map[string]string `json:"meta,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Name string `json:"name,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` + + OsType string `json:"osType,omitempty"` + + DeviceType string `json:"deviceType,omitempty"` + DeviceVendor string `json:"deviceVendor,omitempty"` + DeviceModel string `json:"deviceModel,omitempty"` + + Meta map[string]map[string]string `json:"meta,omitempty"` + DiscoveredBy []string `json:"discoveredBy,omitempty"` + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` Zone *Zone `json:"zone,omitempty"` PortList []*Port `json:"portList,omitempty"` - - DiscoveredBy string `json:"discoveredBy,omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` } diff --git a/discovery/Port.go b/discovery/Port.go index 01121b1..323f69b 100644 --- a/discovery/Port.go +++ b/discovery/Port.go @@ -11,12 +11,12 @@ import ( type Port struct { MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` PortNumber json.Number `json:"portNumber,omitempty"` - Meta map[string]string `json:"meta,omitempty"` - Host *Host `json:"host,omitempty"` - ServiceList []*Service `json:"serviceList,omitempty"` + Meta map[string]map[string]string `json:"meta,omitempty"` + DiscoveredBy []string `json:"discoveredBy,omitempty"` + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - DiscoveredBy string `json:"discoveredBy,omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - UDPLayer gopacket.Layer `json:"-"` + Host *Host `json:"host,omitempty"` + ServiceList []*Service `json:"serviceList,omitempty"` + UDPLayer gopacket.Layer `json:"-"` } diff --git a/discovery/Service.go b/discovery/Service.go index f7a6b7e..e242257 100644 --- a/discovery/Service.go +++ b/discovery/Service.go @@ -10,11 +10,10 @@ type Service struct { Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` - Meta map[string]string `json:"meta,omitempty"` + + Meta map[string]map[string]string `json:"meta,omitempty"` + DiscoveredBy []string `json:"discoveredBy,omitempty"` + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` Port *Port `json:"port,omitempty"` - - DiscoveredBy string `json:"discoveredBy,omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` } diff --git a/discovery/Zone.go b/discovery/Zone.go index d637f91..3b44e8b 100644 --- a/discovery/Zone.go +++ b/discovery/Zone.go @@ -8,15 +8,15 @@ import ( ) type Zone struct { - Network string `json:"network,omitempty"` - Iface string `json:"iface,omitempty"` - MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` - Address string `json:"address,omitempty"` - Mac string `json:"mac,omitempty"` - Meta map[string]string `json:"meta,omitempty"` + Network string `json:"network,omitempty"` + Iface string `json:"iface,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` - DiscoveredBy string `json:"discoveredBy,omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` + Meta map[string]map[string]string `json:"meta,omitempty"` + DiscoveredBy []string `json:"discoveredBy,omitempty"` + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` mtx sync.RWMutex `json:"-"` }