probe/discovery/protocol/tcp/syn/syn.go

25 lines
654 B
Go
Raw Normal View History

2018-08-31 14:00:08 +00:00
package syn
2018-08-31 10:46:52 +00: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 08:49:01 +00:00
if nil == targetHost || nil == discoverySession.DiscoverPort() || !discoverySession.DiscoverPort().IncludeTCP {
2018-08-31 12:56:36 +00:00
return nil
}
2018-08-31 10:46:52 +00:00
metaIPTypeEnum := omm.ToMetaIPTypeEnum(discoverySession.Zone().MetaIPType)
switch metaIPTypeEnum {
case omm.MetaIPTypeEnumV4:
return scanV4(discoverySession, targetHost)
case omm.MetaIPTypeEnumV6:
return scanV4(discoverySession, targetHost)
}
return nil
}