]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/dnsdist-dynbpf.hh
auth: switch circleci mssql image
[thirdparty/pdns.git] / pdns / dnsdist-dynbpf.hh
index 3fed6f18cbf34a55ea5620e656ac5930529a197a..521006bd3df5b037eefe56f1dedb30bf4a3036f2 100644 (file)
 class DynBPFFilter
 {
 public:
-  DynBPFFilter(std::shared_ptr<BPFFilter> bpf): d_bpf(bpf)
+  DynBPFFilter(std::shared_ptr<BPFFilter>& bpf): d_bpf(bpf)
   {
   }
   ~DynBPFFilter()
   {
   }
+  void excludeRange(const Netmask& range)
+  {
+    d_excludedSubnets.addMask(range);
+  }
+  void includeRange(const Netmask& range)
+  {
+    d_excludedSubnets.addMask(range, false);
+  }
   /* returns true if the addr wasn't already blocked, false otherwise */
   bool block(const ComboAddress& addr, const struct timespec& until);
   void purgeExpired(const struct timespec& now);
@@ -63,6 +71,7 @@ private:
   container_t d_entries;
   std::mutex d_mutex;
   std::shared_ptr<BPFFilter> d_bpf;
+  NetmaskGroup d_excludedSubnets;
 };
 
 #endif /* HAVE_EBPF */