From: Stephan Bosch Date: Wed, 9 Oct 2019 00:34:15 +0000 (+0200) Subject: iputils.hh: Netmask: Add getNormalized() X-Git-Tag: auth-4.3.0-beta2~20^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9a5bdb12befd37c611e6223e6afc33570dfea3c;p=thirdparty%2Fpdns.git iputils.hh: Netmask: Add getNormalized() --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 9bfb317dfe..09134e2ad4 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -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;