probe/_discoverer/service.go
crusader ffd94e2c8e ing
2018-08-29 21:04:23 +09:00

27 lines
757 B
Go

package discoverer
import (
"fmt"
omd "git.loafle.net/overflow/model/discovery"
omm "git.loafle.net/overflow/model/meta"
"git.loafle.net/overflow_scanner/probe/discoverer/ipv4"
"git.loafle.net/overflow_scanner/probe/discoverer/ipv6"
)
func scanService(port *omd.Port, ds *omd.DiscoverService, resultChan chan interface{}, errChan chan error, doneChan chan<- struct{}, stopChan chan struct{}) {
defer func() {
doneChan <- struct{}{}
}()
switch omm.ToMetaIPTypeEnum(port.Host.MetaIPType) {
case omm.MetaIPTypeEnumV4:
ipv4.ScanService(port, ds, resultChan, errChan, stopChan)
case omm.MetaIPTypeEnumV6:
ipv6.ScanService(port, ds, resultChan, errChan, stopChan)
default:
errChan <- fmt.Errorf("Discovery: Not supported MetaIPType")
}
}