v0.0.0
Initial release.
Earlier version numbers appear in this project's git history but were never
tagged or published, so there is no upgrade path to describe -- everything
below is simply what the package contains.
Added
- Interface discovery --
get_interfaces()reports adapter names, MACs,
MTU and real prefix lengths on Linux, macOS/BSD and Windows, viactypes
bindings togetifaddrs(3)andGetAdaptersAddresses. No third-party
dependency.Interface.is_loopbackis derived from the addresses rather than
the name, sincelo,lo0andLoopback Pseudo-Interface 1share no
spelling.Interface.primary_ip()picks one entry;iter_addresses()is the
flattened per-address view. - Types and parsing --
IPAddress/IPInterface/IPNetworkunion aliases
to annotate with, and oneparse(value, type, **kwargs)entry point with
non-raisingtry_parseand booleanis_validsiblings. Concrete types are
strict about family; networks are non-strict about host bits by default. MACAddress-- colon/hyphen/dot/bare plusint/bytes, hashable and
ordered, with.packed,.oui,.is_multicast,.is_localand
case-selectable rendering. A value type exposing.packed, not abytes
subclass, matching howipaddressmodels addresses.- Socket helpers --
bind(),bind_error_hint(),interface_for(),
get_source_ip(),get_free_port(),tcp_check(),wait_for_port(). UdpEndpoint-- UDP receive reporting which interface a datagram arrived
on viaIP_PKTINFO, degrading whererecvmsgdoes not exist.- Routing and MTU --
get_route()(first hop, unprivileged),hop_count()
(raw sockets or a traceroute fallback, so it works without elevation),
discover_mtu()(measures the real path --method="icmp"with DF-flagged
pings,"udp"with datagrams, or"tcp"deriving from the negotiated MSS
since TCP cannot be probed),get_pmtu()(the kernel's cached answer, usually
None),get_tcp_mss(), andInterface.mtu. Header arithmetic is
family-aware: IPv6 adds 20 bytes over IPv4, and assuming v4 on a v6 path
under-reports by exactly that. - CIDR maths and host parsing --
collapse(),subtract()(absent from
ipaddress), andnormalize_host(), which keeps"::1"an address rather
than host"::"port1. - Scheme/port registry --
get_default_port(),get_default_scheme(),
register_port(). - DNS --
resolve()returning native types (A/AAAAasipaddress
objects),[]on a genuine lookup failure, andValueErrorfor a malformed
query rather than a silent empty result. ping()-- returns aPingResultwith round-trip time and TTL that stays
truthy.method="icmp"|"tcp"|"udp"reaches hosts through firewalls that drop
echo; all three ask "is the host up?", so a TCP refusal or an ICMP
port-unreachable counts as success.tcp_checkremains the "is the service
up?" question, where a refusal is a failure.ttl=behaves identically on every platform, because Windowsping
exits 0 for "TTL expired in transit" and the reply address is verified
instead of the exit code.- Scanning -- concurrent
scan_ports()/scan_hosts(), ports addressable
by scheme name. - Multicast --
multicast_socket(),join_group(),leave_group(),
wrapping a setup whose failure modes are otherwise silent. Host,retry()/backoff_delays(), and the named networksAPIPA,
LOOPBACK_V4,LOOPBACK_V6,LINK_LOCAL_V6.
Full Changelog: https://github.com/jose-pr/netimps/commits/v0.0.0