This commit is contained in:
crusader 2018-09-18 02:32:36 +09:00
parent 34f3f59837
commit d9dea68ea6
2 changed files with 9 additions and 6 deletions

View File

@ -735,15 +735,15 @@ func (ds *ofDiscoverySession) addtionalServiceMDNS(service *omd.Service, meta ma
switch portNumber {
case 515:
if "printer" == service.Key {
_h := service.Port.Host
if "printer" == service.Name || "printer" == service.Key {
_h, _ := ds.findHost(service.Port.Host)
_h.HostType = "PRINTER"
_h.Name = service.Name
ds.delegate(_h)
}
case 9100:
if "pdl-datastream" == service.Key {
_h := service.Port.Host
if "pdl-datastream" == service.Name || "pdl-datastream" == service.Key {
_h, _ := ds.findHost(service.Port.Host)
_h.HostType = "PRINTER"
_h.Name = service.Name
ds.delegate(_h)

View File

@ -24,8 +24,11 @@ func scanTCP(discoverySession session.DiscoverySession, targetPort *omd.Port) er
if err != nil {
return fmt.Errorf("Service scan on %s:%s error has occurred %v ", hostAddress, targetPort.PortNumber, err)
}
if 9100 == portNumber {
return nil
if omm.MetaHostTypeEnumPrinter.String() == targetPort.Host.HostType {
if 9100 == portNumber || 515 == portNumber {
return nil
}
}
matchCtx := osm.NewMatchCtx(hostAddress, portNumber)