host4451%python.module
fault.internet

Endpoint and Service type for referencing internet addresses for Internet Protocol version 4 and 6.

typing
import

ipaddress0
import

Service0
class

Internet port identifier. Empty subclass for identification purposes.

Service__slots__0
data

__slots__ = ()

Servicevalid_range0
data

valid_range = (0, 0xFFFF)

Servicesystem_range0
data

system_range = (0, 1024)

Serviceepheremal_range0
data

epheremal_range = (49152, 0xFFFF)

Servicevalid40%
method

valid(self)

Whether or not the Service port is within the standard range.

Servicesystem40%
method

system(self)

Whether or not the Service port is considered a 'well known' port.

Serviceephemeral40%
method

ephemeral(self)

Whether or not the Service port is considered an 'ephemeral' port by IANA.

Servicefrom_name10%
classmethod

from_name(Class, name)

common_services0
data

common_services = {
	'domain': Service(53),

	'http': Service(80),
	'https': Service(443),
	'ftp': Service(21),
	'ftps': Service(990),

	'ssh': Service(22),
	'telnet': Service(23),

	'smtp': Service(25),
	'kerberos': Service(88),
	'ntp': Service(123),
	'bgp': Service(179),
	'irc': Service(194),
	'ldap': Service(389),
}

Endpoint0
class

A precise Endpoint for internet addresses and local sockets.

Endpoint__slots__0
data

__slots__ = ()

Endpointaddress_types0
data

address_types = (ipaddress.IPv4Address, ipaddress.IPv6Address)
	@classmethod

Endpointcreate_ip40
classmethod

create_ip4(Class, string, port)

Create an IPv4 Endpoint Instance

Endpointcreate_ip60
classmethod

create_ip6(Class, string, port)

Create an IPv6 Endpoint Instance

Endpointprotocol20%
property

Addressing protocol; 4 or 6

Endpointinterface20%
property

The ipaddress typed address.

Endpointaddress0
data

address = interface
	@property

Endpointport20%
property

The Service of the endpoint.

Endpoint__str__40%
method

__str__(self)

"<address>:<port>" representation suitable for interpolation into an IRI network location.

Endpoint__repr__50%
method

__repr__(self)

Endpoint__hash__10%
method

__hash__(self)

Endpointcreate20%
classmethod

create(Class, interface, port)

Create an IPv4 or IPv6 endpoint based on the type detected from the string.

The ipaddress type will be selected by the ipaddress.ip_address function.

Reference0
class

A domain name referencing a set of endpoints.

References are actually service references for a specific domain. They consist of protocol, address, port, and service fields that define the reference. Normally, protocol is "dns" and implies system DNS.

Protocol variations can be used to describe more complicated name resolutions.

Reference__slots__0
data

__slots__ = ()

Referencefields0
data

fields = (
	'protocol',
	'address',
	'port',
	'service',
)
	@property

Referenceprotocol233%
property
str

Resolution protocol to use to extract endpoints from address. Usually, 'internet-names'.

Referenceaddress233%
property
object

The unencoded domain name.

Referenceport233%
property
Service

The resolved or overridden port for the service. Usually, this is None as the service will refer to the desired Service port or the resolver will manage a

Referenceservice233%
property
str

The actual service name being referred to. Used by resolvers that support service name resolution.

Reference__str__20%
method

__str__(self)

Formatted reference for canonical printing. Return "<service>:[<protocol>]<name>:<port>".

Reference__repr__30%
method

__repr__(self)

Referencefrom_domain0
classmethod

from_domain(Class, name, service)

realize0
function
typing.Union[Reference, Endpoint]

realize(struct)

Construct an Endpoint or Reference from struct.

Usual case:
from fault.internet import ri
target = host.realize(ri.parse(url))