mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-29 20:42:22 +00:00
types/view: add ContainsNonExitSubnetRoutes func
Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
parent
b49eb7d55c
commit
5363a90272
@ -216,6 +216,17 @@ func (v IPPrefixSlice) ContainsExitRoutes() bool {
|
|||||||
return tsaddr.ContainsExitRoutes(v.ж.ж)
|
return tsaddr.ContainsExitRoutes(v.ж.ж)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ContainsNonExitSubnetRoutes reports whether v contains Subnet
|
||||||
|
// Routes other than ExitNode Routes.
|
||||||
|
func (v IPPrefixSlice) ContainsNonExitSubnetRoutes() bool {
|
||||||
|
for i := 0; i < v.Len(); i++ {
|
||||||
|
if v.At(i).Bits() != 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalJSON implements json.Marshaler.
|
// MarshalJSON implements json.Marshaler.
|
||||||
func (v IPPrefixSlice) MarshalJSON() ([]byte, error) {
|
func (v IPPrefixSlice) MarshalJSON() ([]byte, error) {
|
||||||
return v.ж.MarshalJSON()
|
return v.ж.MarshalJSON()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user