Gio.InetAddressMask¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.InetAddressMask(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GInetAddressMask
represents 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. For example,10.0.0.0/8
, orfe80::/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
, orNone
on error- Return type:
Creates a new
Gio.InetAddressMask
representing all addresses whose first length bits match addr.New in version 2.32.
- classmethod new_from_string(mask_string)[source]¶
- Parameters:
mask_string (
str
) – an IP address or address/length string- Raises:
- Returns:
a new
Gio.InetAddressMask
corresponding to string, orNone
on error.- Return type:
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
) – anotherGio.InetAddressMask
- Returns:
whether self and mask2 are the same mask
- Return type:
Tests if self and mask2 are the same mask.
New in version 2.32.
- get_address()[source]¶
- Returns:
self's base address
- Return type:
Gets self's base address
New in version 2.32.
- get_family()[source]¶
- Returns:
the
Gio.SocketFamily
of self's address- Return type:
Gets the
Gio.SocketFamily
of self's addressNew in version 2.32.
- matches(address)[source]¶
- Parameters:
address (
Gio.InetAddress
) – aGio.InetAddress
- Returns:
whether address falls within the range described by self.
- Return type:
Tests if address falls within the range described by self.
New in version 2.32.
Property Details¶
- Gio.InetAddressMask.props.address¶
- Name:
address
- Type:
- Default Value:
- Flags:
The base address.
New in version 2.32.
- Gio.InetAddressMask.props.family¶
- Name:
family
- Type:
- Default Value:
- Flags:
The address family (IPv4 or IPv6).
New in version 2.32.