probe/scan/host.go
2018-08-12 20:08:31 +09:00

26 lines
676 B
Go

package scan
import (
"fmt"
oms "git.loafle.net/overflow/model/scan"
"git.loafle.net/overflow_scanner/probe/scan/ipv4"
"git.loafle.net/overflow_scanner/probe/scan/ipv6"
)
func scanHost(zone *oms.Zone, dh *oms.DiscoverHost, resultChan chan interface{}, errChan chan error, doneChan chan<- struct{}, stopChan chan struct{}) {
defer func() {
doneChan <- struct{}{}
}()
switch ocmm.ToMetaIPTypeEnum(dh.MetaIPType) {
case ocmm.MetaIPTypeEnumV4:
ipv4.ScanHost(zone, dh, resultChan, errChan, stopChan)
case ocmm.MetaIPTypeEnumV6:
ipv6.ScanHost(zone, dh, resultChan, errChan, stopChan)
default:
errChan <- fmt.Errorf("Discovery: Not supported MetaIPType")
}
}