ing
This commit is contained in:
parent
4e18a6f932
commit
b9ac5b2a71
|
@ -52,9 +52,7 @@ func Scan(discoverySession session.DiscoverySession) error {
|
||||||
}
|
}
|
||||||
delay.Store(true)
|
delay.Store(true)
|
||||||
if h := handlePacketARP(zone, targetHosts, hosts, packet); nil != h {
|
if h := handlePacketARP(zone, targetHosts, hosts, packet); nil != h {
|
||||||
if h != nil {
|
go discoverySession.AddHost(h)
|
||||||
discoverySession.AddHost(h)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if false == delay.Load().(bool) {
|
if false == delay.Load().(bool) {
|
||||||
|
|
|
@ -54,9 +54,7 @@ func scanV4(discoverySession session.DiscoverySession) error {
|
||||||
}
|
}
|
||||||
delay.Store(true)
|
delay.Store(true)
|
||||||
if h := handlePacketICMP4(zone, targetHosts, hosts, packet); nil != h {
|
if h := handlePacketICMP4(zone, targetHosts, hosts, packet); nil != h {
|
||||||
if h != nil {
|
go discoverySession.AddHost(h)
|
||||||
discoverySession.AddHost(h)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if false == delay.Load().(bool) {
|
if false == delay.Load().(bool) {
|
||||||
|
|
|
@ -49,16 +49,11 @@ func scanV6(discoverySession session.DiscoverySession) error {
|
||||||
select {
|
select {
|
||||||
case packet, ok := <-icmpChan:
|
case packet, ok := <-icmpChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
// logging.Logger().Debugf("icmp channel is closed")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
delay.Store(true)
|
delay.Store(true)
|
||||||
if h := handlePacketICMP6(zone, targetHosts, hosts, packet); nil != h {
|
if h := handlePacketICMP6(zone, targetHosts, hosts, packet); nil != h {
|
||||||
if h != nil {
|
go discoverySession.AddHost(h)
|
||||||
discoverySession.AddHost(h)
|
|
||||||
}
|
|
||||||
|
|
||||||
// resultChan <- h
|
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if false == delay.Load().(bool) {
|
if false == delay.Load().(bool) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ func tryConnect(discoverySession session.DiscoverySession, ports map[int]*omd.Po
|
||||||
|
|
||||||
ports[port] = p
|
ports[port] = p
|
||||||
|
|
||||||
discoverySession.AddPort(p)
|
go discoverySession.AddPort(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Ulimit() int64 {
|
func Ulimit() int64 {
|
||||||
|
|
|
@ -47,7 +47,7 @@ func scanV4(discoverySession session.DiscoverySession, targetHost *omd.Host) err
|
||||||
}
|
}
|
||||||
delay.Store(true)
|
delay.Store(true)
|
||||||
if p := handlePacketTCP4(discoverySession, targetHost, ports, packet); nil != p {
|
if p := handlePacketTCP4(discoverySession, targetHost, ports, packet); nil != p {
|
||||||
discoverySession.AddPort(p)
|
go discoverySession.AddPort(p)
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if false == delay.Load().(bool) {
|
if false == delay.Load().(bool) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ func tryConnect(discoverySession session.DiscoverySession, ports map[int]*omd.Po
|
||||||
|
|
||||||
ports[port] = p
|
ports[port] = p
|
||||||
|
|
||||||
discoverySession.AddPort(p)
|
go discoverySession.AddPort(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Ulimit() int64 {
|
func Ulimit() int64 {
|
||||||
|
|
|
@ -47,7 +47,7 @@ func scanV4(discoverySession session.DiscoverySession, targetHost *omd.Host) err
|
||||||
}
|
}
|
||||||
delay.Store(true)
|
delay.Store(true)
|
||||||
if p := handlePacketUDP4(discoverySession, targetHost, ports, packet); nil != p {
|
if p := handlePacketUDP4(discoverySession, targetHost, ports, packet); nil != p {
|
||||||
discoverySession.AddPort(p)
|
go discoverySession.AddPort(p)
|
||||||
}
|
}
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
if false == delay.Load().(bool) {
|
if false == delay.Load().(bool) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ LOOP:
|
||||||
|
|
||||||
if nil != discoveredMatcher {
|
if nil != discoveredMatcher {
|
||||||
// log.Printf("discovered matcher: %s(%s) %v", discoveredMatcher.Name(), discoveredMatcher.Key(), discoveredMatcher)
|
// log.Printf("discovered matcher: %s(%s) %v", discoveredMatcher.Name(), discoveredMatcher.Key(), discoveredMatcher)
|
||||||
discoverySession.AddService(&omd.Service{
|
go discoverySession.AddService(&omd.Service{
|
||||||
MetaCryptoType: discoveredConnector.metaCryptoType(),
|
MetaCryptoType: discoveredConnector.metaCryptoType(),
|
||||||
Key: discoveredMatcher.Key(),
|
Key: discoveredMatcher.Key(),
|
||||||
Name: discoveredMatcher.Name(matchCtx),
|
Name: discoveredMatcher.Name(matchCtx),
|
||||||
|
|
|
@ -34,7 +34,7 @@ func scanUDP(discoverySession session.DiscoverySession, targetPort *omd.Port) er
|
||||||
Name: _matcher.Name(matchCtx),
|
Name: _matcher.Name(matchCtx),
|
||||||
}
|
}
|
||||||
|
|
||||||
discoverySession.AddService(s)
|
go discoverySession.AddService(s)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user