probe/discovery/protocol/tcp/tcp.go

25 lines
607 B
Go
Raw Normal View History

2018-08-31 10:46:52 +00:00
package tcp
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-08-31 12:56:36 +00:00
if nil == targetHost || nil == discoverySession.DiscoverPort() {
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
}