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.InitableAbstract: No Structure: Gio.InetAddressMaskClassGio.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, orNoneon errorReturn 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 stringRaises: GLib.ErrorReturns: a new Gio.InetAddressMaskcorresponding to string, orNoneon error.Return type: Gio.InetAddressMaskParses 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) – anotherGio.InetAddressMaskReturns: whether self and mask2 are the same mask Return type: boolTests if self and mask2 are the same mask.
New in version 2.32.
-
get_address()[source]¶ Returns: self’s base address Return type: Gio.InetAddressGets self’s base address
New in version 2.32.
-
get_family()[source]¶ Returns: the Gio.SocketFamilyof self’s addressReturn type: Gio.SocketFamilyGets the
Gio.SocketFamilyof self’s addressNew in version 2.32.
-
matches(address)[source]¶ Parameters: address ( Gio.InetAddress) – aGio.InetAddressReturns: whether address falls within the range described by self. Return type: boolTests if address falls within the range described by self.
New in version 2.32.
-
classmethod
Property Details¶
-
Gio.InetAddressMask.props.address¶ Name: addressType: Gio.InetAddressDefault Value: NoneFlags: READABLE,WRITABLEThe base address
-
Gio.InetAddressMask.props.family¶ Name: familyType: Gio.SocketFamilyDefault Value: Gio.SocketFamily.INVALIDFlags: READABLEThe address family (IPv4 or IPv6)