Netmask¶
- 
newNetmask(str) → Netmask¶
- 
newNetmask(ca, bits) → Netmask
- New in version 1.5.0. - Returns a Netmask - Parameters: - str (string) – A netmask, like 192.0.2.0/24.
- ca (ComboAddress) – A ComboAddress.
- bits (int) – The number of bits in this netmask.
 
- str (string) – A netmask, like 
- 
class Netmask¶
- New in version 1.5.0: Represents a netmask. - 
:getBits() → int¶
- Return the number of bits of this netmask, for example - 24for- 192.0.2.0/24.
 - 
:getMaskedNetwork() → ComboAddress¶
- Return a - ComboAddressobject representing the base network of this netmask object after masking any additional bits if necessary (for example- 192.0.2.0if the netmask was constructed with- newNetmask('192.0.2.1/24')).
 - 
:empty() → bool¶
- Return true if the netmask is empty, meaning that the netmask has not been set to a proper value. 
 - 
:isIPv4() → bool¶
- Return true if the netmask is an IPv4 one. 
 - 
:isIPv6() → bool¶
- Return true if the netmask is an IPv6 one. 
 - 
:getNetwork() → ComboAddress¶
- Return a - ComboAddressobject representing the base network of this netmask object.
 - 
:match(str) → bool¶
- Return true if the address passed in the - strparameter belongs to this netmask.- Parameters: - str (string) – A network address, like - 192.0.2.0.
 - 
:toString() → string¶
- Return a string representation of the netmask, for example - 192.0.2.0/24.
 
- 
