e3719d6d59
This reverts commit 06a799f5a6
29 lines
619 B
Go
29 lines
619 B
Go
package discovery
|
|
|
|
type DiscoverPort struct {
|
|
FirstScanRange int `json:"firstScanRange,omitempty"`
|
|
LastScanRange int `json:"lastScanRange,omitempty"`
|
|
ExcludePorts []int `json:"excludePorts,omitempty"`
|
|
|
|
IncludeTCP bool `json:"includeTCP,omitempty"`
|
|
IncludeUDP bool `json:"includeUDP,omitempty"`
|
|
|
|
DiscoverService *DiscoverService `json:"discoverService,omitempty"`
|
|
}
|
|
|
|
func (dp *DiscoverPort) 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
|
|
}
|