From c85694fac48b17f3d657ad407257a40a65ee310b Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Fri, 4 Mar 2022 09:05:25 -0800 Subject: [PATCH] types/views: add ContainsExitRoutes to IPPrefixSlice Signed-off-by: Maisem Ali --- types/views/views.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/views/views.go b/types/views/views.go index d92b9c342..b930d359f 100644 --- a/types/views/views.go +++ b/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.ж)