Releases: jose-pr/netimps
Releases · jose-pr/netimps
Release list
v0.1.0
Added
- Complete local-interface membership lookups.
interfaces_for()yields
every adapter matching an interface, exact address/IPInterface, network,
orMACAddress, whileinterface_for()keeps the first-match scalar
contract.is_local_address()distinguishes an assigned or loopback address
from one that is merely private, link-local, on-link or reachable. - Static parser contracts.
TypeFormoverloads preserve union and concrete
result types, callable builders, and explicittry_parse(default=...)
fallbacks.IPInterfaceLikenow complements the existing input aliases.
Changed
interface_for()accepts networks and MAC addresses, including MAC text and
6-byte packed values. Integer MACs remain explicitMACAddressvalues. Its legacy
strict=Falsesynthetic fallback remains address-only because a missing
network or MAC has no honest single-interface representation.- The IP input aliases now include packed bytes plus the exact stdlib
two-tuple and existing-interface forms accepted by the interface/network
factories.is_valid()is documented as a boolean convertibility check
rather than an unsound type guard for the original object.
Full Changelog: v0.0.2...v0.1.0
v0.0.2
Added
ws/wssin the built-in scheme→port table (80/443). WebSocket schemes
(RFC 6455) ride the HTTP/HTTPS ports but are absent from/etc/services, so
get_default_port("wss")previously returnedNoneand every websocket
consumer had toregister_portthem.http/httpsremain canonical for
80/443.
Full Changelog: v0.0.1...v0.0.2
v0.0.1
Added
- Command-line interface (
netimps .../python -m netimps), built on
duho and installed by the newcliextra. Eleven subcommands cover the
diagnostic surface:interfaces,ping,resolve,check,route,mtu,
scan,addr,source,port,split. Every one takes--json, and exit
codes distinguish success from "the answer was no" from a caller error.
duhois CLI-only -- importing the library does not require it.
Full Changelog: v0.0.0...v0.0.1
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