Gio.InetAddressMask¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.Initable (2) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(addr, length) | 
| class | new_from_string(mask_string) | 
| equal(mask2) | |
| get_address() | |
| get_family() | |
| get_length() | |
| matches(address) | |
| to_string() | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.Initable (1) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| address | Gio.InetAddress | r/w | The base address | 
| family | Gio.SocketFamily | r | The address family (IPv4 or IPv6) | 
| length | int | r/w | The prefix length | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gio.InetAddressMask(**kwargs)¶
- Bases: - GObject.Object,- Gio.Initable- Abstract: - No - Structure: - Gio.InetAddressMaskClass- Gio.InetAddressMaskrepresents a range of IPv4 or IPv6 addresses described by a base address and a length indicating how many bits of the base address are relevant for matching purposes. These are often given in string form. Eg, “10.0.0.0/8”, or “fe80::/10”.- New in version 2.32. - 
classmethod new(addr, length)[source]¶
- Parameters: - addr (Gio.InetAddress) – aGio.InetAddress
- length (int) – number of bits of addr to use
 - Raises: - Returns: - a new - Gio.InetAddressMask, or- Noneon error- Return type: - Creates a new - Gio.InetAddressMaskrepresenting all addresses whose first length bits match addr.- New in version 2.32. 
- addr (
 - 
classmethod new_from_string(mask_string)[source]¶
- Parameters: - mask_string ( - str) – an IP address or address/length string- Raises: - GLib.Error- Returns: - a new - Gio.InetAddressMaskcorresponding to string, or- Noneon error.- Return type: - Gio.InetAddressMask- Parses mask_string as an IP address and (optional) length, and creates a new - Gio.InetAddressMask. The length, if present, is delimited by a “/”. If it is not present, then the length is assumed to be the full length of the address.- New in version 2.32. 
 - 
equal(mask2)[source]¶
- Parameters: - mask2 ( - Gio.InetAddressMask) – another- Gio.InetAddressMask- Returns: - whether self and mask2 are the same mask - Return type: - bool- Tests if self and mask2 are the same mask. - New in version 2.32. 
 - 
get_address()[source]¶
- Returns: - self’s base address - Return type: - Gio.InetAddress- Gets self’s base address - New in version 2.32. 
 - 
get_family()[source]¶
- Returns: - the - Gio.SocketFamilyof self’s address- Return type: - Gio.SocketFamily- Gets the - Gio.SocketFamilyof self’s address- New in version 2.32. 
 - 
matches(address)[source]¶
- Parameters: - address ( - Gio.InetAddress) – a- Gio.InetAddress- Returns: - whether address falls within the range described by self. - Return type: - bool- Tests if address falls within the range described by self. - New in version 2.32. 
 
- 
classmethod 
Property Details¶
- 
Gio.InetAddressMask.props.address¶
- Name: - address- Type: - Gio.InetAddress- Default Value: - None- Flags: - READABLE,- WRITABLE- The base address 
- 
Gio.InetAddressMask.props.family¶
- Name: - family- Type: - Gio.SocketFamily- Default Value: - Gio.SocketFamily.INVALID- Flags: - READABLE- The address family (IPv4 or IPv6)