]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
iputils.hh: Netmask: Add getAddressBits()
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 30 Sep 2019 08:30:24 +0000 (10:30 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 11 Feb 2020 01:01:47 +0000 (02:01 +0100)
pdns/iputils.hh

index 245beccab74933f547bd0aad621e6a3648673202..f85355e3970e17ae5bf579e63768d19567dfc9d7 100644 (file)
@@ -590,6 +590,12 @@ public:
   Netmask getSuper(uint8_t bits) const {
     return Netmask(d_network, std::min(d_bits, bits));
   }
+
+  //! Get the total number of address bits for this netmask (either 32 or 128 depending on IP version)
+  uint8_t getAddressBits() const
+  {
+    return d_network.getBits();
+  }
 private:
   ComboAddress d_network;
   uint32_t d_mask;