* Valid results IF and only IF the stored IP address is actually a network bitmask
\retval N number of bits which are set in the bitmask stored.
*/
- int GetCIDR();
+ int GetCIDR() const;
/** Apply a mask to the stored address.
\param mask Netmask format to be bit-mask-AND'd over the stored address.
}
int
-IPAddress::GetCIDR()
+IPAddress::GetCIDR() const
{
uint8_t shift,byte;
uint8_t bit,caught;
int len = 0;
#if USE_IPV6
- uint8_t *ptr= m_SocketAddr.sin6_addr.s6_addr;
+ const uint8_t *ptr= m_SocketAddr.sin6_addr.s6_addr;
#else
- uint8_t *ptr= (uint8_t *)&m_SocketAddr.sin_addr.s_addr;
+ const uint8_t *ptr= (uint8_t *)&m_SocketAddr.sin_addr.s_addr;
#endif
/* Let's scan all the bits from Most Significant to Least */