Browse Source

types/views: add ContainsExitRoutes to IPPrefixSlice

Signed-off-by: Maisem Ali <[email protected]>
Maisem Ali 4 years ago
parent
commit
c85694fac4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      types/views/views.go

+ 5 - 0
types/views/views.go

@@ -101,6 +101,11 @@ func (v IPPrefixSlice) ContainsFunc(f func(netaddr.IPPrefix) bool) bool {
 	return tsaddr.PrefixesContainsFunc(v.ж, f)
 }
 
+// ContainsExitRoutes reports whether v contains ExitNode Routes.
+func (v IPPrefixSlice) ContainsExitRoutes() bool {
+	return tsaddr.ContainsExitRoutes(v.ж)
+}
+
 // MarshalJSON implements json.Marshaler.
 func (v IPPrefixSlice) MarshalJSON() ([]byte, error) {
 	return json.Marshal(v.ж)