probe/_discoverer/ipv4/port.go

24 lines
444 B
Go
Raw Normal View History

2018-08-13 07:19:59 +00:00
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()
}