Endpoint and Service type for referencing internet addresses for Internet Protocol version 4 and 6.
typing
ipaddress0
Service0
Internet port identifier. Empty subclass for identification purposes.
Service__slots__0
__slots__ = ()
Servicevalid_range0
valid_range = (0, 0xFFFF)
Servicesystem_range0
system_range = (0, 1024)
Serviceepheremal_range0
epheremal_range = (49152, 0xFFFF)
Servicevalid40%
valid(self)
Whether or not the Service port is within the standard range.
Servicesystem40%
system(self)
Whether or not the Service port is considered a 'well known' port.
Serviceephemeral40%
ephemeral(self)
Whether or not the Service port is considered an 'ephemeral' port by IANA.
Servicefrom_name10%
from_name(Class, name)
common_services0
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
A precise Endpoint for internet addresses and local sockets.
Endpoint__slots__0
__slots__ = ()
Endpointaddress_types0
address_types = (ipaddress.IPv4Address, ipaddress.IPv6Address)
@classmethod
Endpointcreate_ip40
create_ip4(Class, string, port)
Create an IPv4 Endpoint Instance
Endpointcreate_ip60
create_ip6(Class, string, port)
Create an IPv6 Endpoint Instance
Endpointprotocol20%
Addressing protocol; 4 or 6
Endpointinterface20%
The ipaddress typed address.
Endpointaddress0
address = interface
@property
Endpointport20%
The Service of the endpoint.
Endpoint__str__40%
__str__(self)
"<address>:<port>" representation suitable for interpolation into an IRI network location.
Endpoint__repr__50%
__repr__(self)
Endpoint__hash__10%
__hash__(self)
Endpointcreate20%
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
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
__slots__ = ()
Referencefields0
fields = (
'protocol',
'address',
'port',
'service',
)
@property
Referenceprotocol233%str
Resolution protocol to use to extract endpoints from address. Usually, 'internet-names'.
Referenceaddress233%object
The unencoded domain name.
Referenceport233%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%str
The actual service name being referred to. Used by resolvers that support service name resolution.
Reference__str__20%
__str__(self)
Formatted reference for canonical printing. Return "<service>:[<protocol>]<name>:<port>".
Reference__repr__30%
__repr__(self)
Referencefrom_domain0
from_domain(Class, name, service)
realize0typing.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))