Infinity.IpAddress¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Infinity.IpAddress¶
Infinity.IpAddress
is an opaque data type. You should only access it via the public API functions.- classmethod new_from_string(str)¶
- Parameters:
str (
str
) – A string containing an IPv4 or IPv6 address in standard dots notation.- Returns:
A new
Infinity.IpAddress
, orNone
.- Return type:
Creates a new IP address (either IPv4 or IPv6) from the given string.
- classmethod new_loopback4()¶
- Returns:
A new
Infinity.IpAddress
.- Return type:
Creates a new IPv4 address that contains the local host’s IP address (“127.0.0.1”).
- classmethod new_loopback6()¶
- Returns:
A new
Infinity.IpAddress
.- Return type:
Creates a new IPv6 address that contains the local host’s IP address (”::1”).
- classmethod new_raw4(address)¶
- Parameters:
address (
int
) – An IPv4 address in network byte order.- Returns:
A new
Infinity.IpAddress
.- Return type:
Creates a new IPv4 address.
- classmethod new_raw6(address)¶
- Parameters:
address (
int
) – An IPv6 address in network bype order.- Returns:
A new
Infinity.IpAddress
.- Return type:
Creates a new IPv6 address.
- collate(address2)¶
- Parameters:
address2 (
Infinity.IpAddress
) – Second address.- Returns:
-1 if self compares before, 0 if it compares equal or 1 if it compares after address.
- Return type:
Compares the two addresses for sorting.
- copy()¶
- Returns:
A new
Infinity.IpAddress
.- Return type:
Creates a new
Infinity.IpAddress
that contains the same address as self.
- free()¶
Frees self.
- get_family()¶
- Returns:
- Return type:
Returns the address family of self.
- get_raw()¶
-
Returns either 32 bit (IPv4) or 128 bit (IPv6) raw address data in host byte order of self.