overflow_discovery/discovery/ipv4/port.go
crusader 9527a68c71 ing
2017-12-04 18:37:39 +09:00

24 lines
494 B
Go

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