24 lines
458 B
Go
Raw Normal View History

2018-04-19 20:36:56 +09:00
package ipv4
import (
"sync"
2018-04-26 18:00:24 +09:00
ocmd "git.loafle.net/overflow/commons-go/model/discovery"
2018-04-19 20:36:56 +09:00
)
2018-04-28 01:20:01 +09:00
func ScanPort(host *ocmd.Host, dp *ocmd.DiscoverPort, resultChan chan interface{}, errChan chan error, stopChan chan struct{}) {
2018-04-19 20:36:56 +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)
}
wg.Wait()
}