24 lines
475 B
Go
24 lines
475 B
Go
package ipv4
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"git.loafle.net/overflow/overflow_discovery/api/module/discovery/model"
|
|
)
|
|
|
|
func ScanPort(host *model.Host, dp *model.DiscoveryPort, 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()
|
|
}
|