This commit is contained in:
crusader
2017-11-22 15:33:41 +09:00
parent 2e81139374
commit 18fe18ccef
4 changed files with 75 additions and 21 deletions

View File

@@ -15,10 +15,6 @@ type DiscoveryHost struct {
DiscoveryPort *DiscoveryPort `json:"discoveryPort"`
}
func (dh *DiscoveryHost) Contains(ip string) bool {
}
type DiscoveryPort struct {
FirstScanRange int `json:"firstScanRange"`
LastScanRange int `json:"lastScanRange"`
@@ -30,6 +26,22 @@ type DiscoveryPort struct {
DiscoveryService *DiscoveryService `json:"discoveryService"`
}
func (dp *DiscoveryPort) Contains(port int) bool {
if dp.FirstScanRange < port {
return false
}
if dp.LastScanRange > port {
return false
}
for _, p := range dp.ExcludePorts {
if p == port {
return false
}
}
return true
}
type DiscoveryService struct {
IncludeServices []string `json:"includeServices"`
}