Bunch of rule JSON stuff.
This commit is contained in:
parent
3cb2e1197f
commit
bd15262e54
2 changed files with 427 additions and 40 deletions
|
@ -300,6 +300,19 @@ struct InetAddress : public sockaddr_storage
|
|||
*/
|
||||
inline unsigned int netmaskBits() const throw() { return port(); }
|
||||
|
||||
/**
|
||||
* @return True if netmask bits is valid for the address type
|
||||
*/
|
||||
inline bool netmaskBitsValid() const
|
||||
{
|
||||
const unsigned int n = port();
|
||||
switch(ss_family) {
|
||||
case AF_INET: return (n <= 32);
|
||||
case AF_INET6: return (n <= 128);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for port()
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue