49 lines
1.3 KiB
Go
49 lines
1.3 KiB
Go
package discovery
|
|
|
|
import (
|
|
"git.loafle.net/overflow/model/meta"
|
|
"git.loafle.net/overflow/model/util"
|
|
)
|
|
|
|
const (
|
|
DefaultOsType = "UNKNOWN"
|
|
DefaultHostVendor = "UNKNOWN"
|
|
DefaultHostModel = "UNKNOWN"
|
|
)
|
|
|
|
var (
|
|
DefaultHostType = meta.MetaHostTypeEnumHost.String()
|
|
)
|
|
|
|
type Host struct {
|
|
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"`
|
|
|
|
HostType string `json:"hostType,omitempty"`
|
|
HostVendor string `json:"hostVendor,omitempty"`
|
|
HostModel string `json:"hostModel,omitempty"`
|
|
|
|
Meta map[string]map[string]string `json:"meta,omitempty"`
|
|
DiscoveredBy []*meta.MetaDiscovererType `json:"discoveredBy,omitempty"`
|
|
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
|
|
|
Zone *Zone `json:"zone,omitempty"`
|
|
PortList []*Port `json:"portList,omitempty"`
|
|
}
|
|
|
|
func NewHost(zone *Zone, metaIPType *meta.MetaIPType, address string) *Host {
|
|
return &Host{
|
|
Zone: zone,
|
|
MetaIPType: metaIPType,
|
|
Address: address,
|
|
OsType: DefaultOsType,
|
|
HostType: DefaultHostType,
|
|
HostVendor: DefaultHostVendor,
|
|
HostModel: DefaultHostModel,
|
|
}
|
|
}
|