Network-related utilities and helper functions.
Calculate IPv6 address using EUI-64 specification.
This method calculates the IPv6 address using the EUI-64 addressing scheme as explained in rfc2373.
Parameters: |
|
---|---|
Returns: | IPv6 address on success. |
Raises ValueError, TypeError: | |
For any invalid input. |
Returns the actual ipv4 of the local machine.
This code figures out what source address would be used if some traffic were to be sent out to some well known address on the Internet. In this case, IP from RFC5737 is used, but the specific address does not matter much. No traffic is actually sent.
Check if IPv6 support is enabled on the platform.
This api will look into the proc entries of the platform to figure out the status of IPv6 support on the platform.
Returns: | True if the platform has IPv6 support, False otherwise. |
---|
Verify that address represents a valid IP address.
Parameters: | address (string) – Value to verify |
---|---|
Returns: | bool |
Verify that address represents a valid IPv4 address.
Parameters: | address (string) – Value to verify |
---|---|
Returns: | bool |
Verify that address represents a valid IPv6 address.
Parameters: | address (string) – Value to verify |
---|---|
Returns: | bool |
Verify that port represents a valid port number.
Interpret a string as a host:port pair.
An IPv6 address MUST be escaped if accompanied by a port, because otherwise ambiguity ensues: 2001:db8:85a3::8a2e:370:7334 means both [2001:db8:85a3::8a2e:370:7334] and [2001:db8:85a3::8a2e:370]:7334.
>>> parse_host_port('server01:80')
('server01', 80)
>>> parse_host_port('server01')
('server01', None)
>>> parse_host_port('server01', default_port=1234)
('server01', 1234)
>>> parse_host_port('[::1]:80')
('::1', 80)
>>> parse_host_port('[::1]')
('::1', None)
>>> parse_host_port('[::1]', default_port=1234)
('::1', 1234)
>>> parse_host_port('2001:db8:85a3::8a2e:370:7334', default_port=1234)
('2001:db8:85a3::8a2e:370:7334', 1234)
>>> parse_host_port(None)
(None, None)
Set values for tcp keepalive parameters
This function configures tcp keepalive parameters if users wish to do so.
Parameters: |
|
---|