ing
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user