overflow_discovery/discovery/ipv4/port.go

24 lines
494 B
Go
Raw Permalink Normal View History

2017-11-18 08:23:39 +00:00
package ipv4
2017-11-21 05:31:17 +00:00
import (
"sync"
2017-12-04 09:37:39 +00:00
discoveryM "git.loafle.net/overflow/overflow_commons_go/modules/discovery/model"
2017-11-21 05:31:17 +00:00
)
2017-11-18 08:23:39 +00:00
2017-12-04 09:37:39 +00:00
func ScanPort(host *discoveryM.Host, dp *discoveryM.DiscoveryPort, resultChan chan interface{}, errChan chan error, stopChan chan struct{}) {
2017-11-21 05:31:17 +00:00
var wg sync.WaitGroup
if dp.IncludeTCP {
wg.Add(1)
go scanPortTCP(host, dp, resultChan, errChan, stopChan, &wg)
}
if dp.IncludeUDP {
wg.Add(1)
go scanPortUDP(host, dp, resultChan, errChan, stopChan, &wg)
}
2017-11-18 08:23:39 +00:00
2017-11-21 05:31:17 +00:00
wg.Wait()
2017-11-18 08:23:39 +00:00
}