container_discovery/internal/discoverer/ipv4/port.go
crusader c40d8eb004 ing
2018-04-19 20:36:56 +09:00

24 lines
459 B
Go

package ipv4
import (
"sync"
ocdm "git.loafle.net/overflow/commons-go/discovery/model"
)
func ScanPort(host *ocdm.Host, dp *ocdm.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()
}