ing
This commit is contained in:
parent
d9dea68ea6
commit
1739673413
|
@ -671,6 +671,12 @@ func (ds *ofDiscoverySession) addtionalHost(discoveredBy *omm.MetaDiscovererType
|
||||||
h = _h
|
h = _h
|
||||||
modified = true
|
modified = true
|
||||||
}
|
}
|
||||||
|
case omm.MetaDiscovererTypeEnumUPnP:
|
||||||
|
_h, _modified := ds.addtionalHostUPnP(h, meta)
|
||||||
|
if _modified {
|
||||||
|
h = _h
|
||||||
|
modified = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -690,7 +696,29 @@ func (ds *ofDiscoverySession) addtionalHostMDNS(host *omd.Host, meta map[string]
|
||||||
if ok || "" != _model {
|
if ok || "" != _model {
|
||||||
h.HostModel = _model
|
h.HostModel = _model
|
||||||
if "Synology" == _vendor && strings.Contains(_model, "DS1817+") {
|
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
|
modified = true
|
||||||
}
|
}
|
||||||
|
@ -737,14 +765,14 @@ func (ds *ofDiscoverySession) addtionalServiceMDNS(service *omd.Service, meta ma
|
||||||
case 515:
|
case 515:
|
||||||
if "printer" == service.Name || "printer" == service.Key {
|
if "printer" == service.Name || "printer" == service.Key {
|
||||||
_h, _ := ds.findHost(service.Port.Host)
|
_h, _ := ds.findHost(service.Port.Host)
|
||||||
_h.HostType = "PRINTER"
|
_h.HostType = omm.MetaHostTypeEnumPrinter.String()
|
||||||
_h.Name = service.Name
|
_h.Name = service.Name
|
||||||
ds.delegate(_h)
|
ds.delegate(_h)
|
||||||
}
|
}
|
||||||
case 9100:
|
case 9100:
|
||||||
if "pdl-datastream" == service.Name || "pdl-datastream" == service.Key {
|
if "pdl-datastream" == service.Name || "pdl-datastream" == service.Key {
|
||||||
_h, _ := ds.findHost(service.Port.Host)
|
_h, _ := ds.findHost(service.Port.Host)
|
||||||
_h.HostType = "PRINTER"
|
_h.HostType = omm.MetaHostTypeEnumPrinter.String()
|
||||||
_h.Name = service.Name
|
_h.Name = service.Name
|
||||||
ds.delegate(_h)
|
ds.delegate(_h)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user