24 lines
444 B
Go
24 lines
444 B
Go
package ipv4
|
|
|
|
import (
|
|
"sync"
|
|
|
|
omd "git.loafle.net/overflow/model/discovery"
|
|
)
|
|
|
|
func ScanPort(host *omd.Host, dp *omd.DiscoverPort, resultChan chan interface{}, errChan chan error, stopChan chan struct{}) {
|
|
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)
|
|
}
|
|
|
|
wg.Wait()
|
|
}
|