24 lines
475 B
Go
Raw Normal View History

2017-11-18 17:23:39 +09:00
package ipv4
2017-11-21 14:31:17 +09:00
import (
"sync"
"git.loafle.net/overflow/overflow_discovery/api/module/discovery/model"
)
2017-11-18 17:23:39 +09:00
2017-11-18 21:08:08 +09:00
func ScanPort(host *model.Host, dp *model.DiscoveryPort, resultChan chan interface{}, errChan chan error, stopChan chan struct{}) {
2017-11-21 14:31:17 +09: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 17:23:39 +09:00
2017-11-21 14:31:17 +09:00
wg.Wait()
2017-11-18 17:23:39 +09:00
}