This commit is contained in:
crusader 2018-09-18 02:51:25 +09:00
parent d9dea68ea6
commit 1739673413

View File

@ -671,6 +671,12 @@ func (ds *ofDiscoverySession) addtionalHost(discoveredBy *omm.MetaDiscovererType
h = _h
modified = true
}
case omm.MetaDiscovererTypeEnumUPnP:
_h, _modified := ds.addtionalHostUPnP(h, meta)
if _modified {
h = _h
modified = true
}
}
return
@ -690,7 +696,29 @@ func (ds *ofDiscoverySession) addtionalHostMDNS(host *omd.Host, meta map[string]
if ok || "" != _model {
h.HostModel = _model
if "Synology" == _vendor && strings.Contains(_model, "DS1817+") {
h.HostType = "NAS"
h.HostType = omm.MetaHostTypeEnumNAS.String()
}
modified = true
}
return
}
func (ds *ofDiscoverySession) addtionalHostUPnP(host *omd.Host, meta map[string]string) (h *omd.Host, modified bool) {
h = host
modified = false
_vendor, ok := meta["Manufacturer"]
if ok || "" != _vendor {
h.HostVendor = _vendor
modified = true
}
_model, ok := meta["ModelName"]
if ok || "" != _model {
h.HostModel = _model
if "EFM Networks" == _vendor && strings.Contains(_model, "ipTIME A2004NS") {
h.HostType = omm.MetaHostTypeEnumRouter.String()
}
modified = true
}
@ -737,14 +765,14 @@ func (ds *ofDiscoverySession) addtionalServiceMDNS(service *omd.Service, meta ma
case 515:
if "printer" == service.Name || "printer" == service.Key {
_h, _ := ds.findHost(service.Port.Host)
_h.HostType = "PRINTER"
_h.HostType = omm.MetaHostTypeEnumPrinter.String()
_h.Name = service.Name
ds.delegate(_h)
}
case 9100:
if "pdl-datastream" == service.Name || "pdl-datastream" == service.Key {
_h, _ := ds.findHost(service.Port.Host)
_h.HostType = "PRINTER"
_h.HostType = omm.MetaHostTypeEnumPrinter.String()
_h.Name = service.Name
ds.delegate(_h)
}