]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
iputils.hh: Netmask: Add getNormalized()
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 9 Oct 2019 00:34:15 +0000 (02:34 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 11 Feb 2020 01:01:47 +0000 (02:01 +0100)
pdns/iputils.hh

index 9bfb317dfe5ae603713aa848f73371c13c33159d..09134e2ad4457a19daf4b7042a261d8a5b13e510 100644 (file)
@@ -537,6 +537,10 @@ public:
     return d_network.sin4.sin_family==0;
   }
 
+  //! Get normalized version of the netmask. This means that all address bits below the network bits are zero.
+  Netmask getNormalized() const {
+    return Netmask(getMaskedNetwork(), d_bits);
+  }
 private:
   ComboAddress d_network;
   uint32_t d_mask;