From: Stephan Bosch Date: Mon, 30 Sep 2019 08:30:24 +0000 (+0200) Subject: iputils.hh: Netmask: Add getAddressBits() X-Git-Tag: auth-4.3.0-beta2~20^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d7557e313c6d3060d4d3b26f9ef653a9544923e;p=thirdparty%2Fpdns.git iputils.hh: Netmask: Add getAddressBits() --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 245beccab7..f85355e397 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -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;