probe/discovery/service/service.go
crusader 56ed908c50 ing
2018-08-31 19:53:33 +09:00

21 lines
531 B
Go

package service
import (
omd "git.loafle.net/overflow/model/discovery"
omm "git.loafle.net/overflow/model/meta"
"git.loafle.net/overflow_scanner/probe/discovery/session"
)
func Scan(discoverySession session.DiscoverySession, targetPort *omd.Port) error {
metaPortTypeEnum := omm.ToMetaPortTypeEnum(targetPort.MetaPortType)
switch metaPortTypeEnum {
case omm.MetaPortTypeEnumTCP:
return scanTCP(discoverySession, targetPort)
case omm.MetaPortTypeEnumUDP:
return scanUDP(discoverySession, targetPort)
}
return nil
}