24 lines
494 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"
2017-12-04 18:37:39 +09:00
discoveryM "git.loafle.net/overflow/overflow_commons_go/modules/discovery/model"
2017-11-21 14:31:17 +09:00
)
2017-11-18 17:23:39 +09:00
2017-12-04 18:37:39 +09:00
func ScanPort(host *discoveryM.Host, dp *discoveryM.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
}