2018-08-31 23:00:08 +09:00
|
|
|
package syn
|
2018-08-31 19:46:52 +09:00
|
|
|
|
|
|
|
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, targetHost *omd.Host) error {
|
2018-09-01 17:49:01 +09:00
|
|
|
if nil == targetHost || nil == discoverySession.DiscoverPort() || !discoverySession.DiscoverPort().IncludeTCP {
|
2018-08-31 21:56:36 +09:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-08-31 19:46:52 +09:00
|
|
|
metaIPTypeEnum := omm.ToMetaIPTypeEnum(discoverySession.Zone().MetaIPType)
|
|
|
|
|
|
|
|
switch metaIPTypeEnum {
|
|
|
|
case omm.MetaIPTypeEnumV4:
|
|
|
|
return scanV4(discoverySession, targetHost)
|
|
|
|
case omm.MetaIPTypeEnumV6:
|
2018-09-03 13:44:54 +09:00
|
|
|
return scanV6(discoverySession, targetHost)
|
2018-08-31 19:46:52 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|