network_tools 6.1.0
network_tools: ^6.1.0 copied to clipboard
Networking Tools library which can help you discover open ports, devices on subnet and many other things.
Change Log #
6.1.0 #
- iOS and macOS stop missing devices with closed ports: the TCP sweep treated a refused connection as proof of life only for the Linux/Android (
111) and Windows (10061) error codes. Darwin reportsECONNREFUSEDas61, so on iOS every device whose 14 probe ports were all closed counted as offline while the same scan on Android found it.HostScannerServiceImpl.refusalErrorCodesnow carries all three codes and_tryConnectreads from it. Measured on one /24 with 5 hosts proven alive by a TCP RST: the shipped code reported 2, this reports 5. Confirmed on an iPhone 14 Pro (iOS 27.2) by the reporter, whose iOS, Android and router client lists now agree. Fixes #307. - The TCP probe releases its sockets: the probe applied
Future.timeoutto the connect future instead of passingtimeout:toSocket.connect, so a probe that timed out was abandoned while still open, and a probe that reached an open port half-closed instead of tearing down. A finished whole-subnet sweep kept those descriptors — 3,495 held IPv4 sockets measured on one /24 — so the VM stayed alive after the scan returned and the count grew with every repeated scan. Two new tests assert the scanning isolate terminates, which covers both halves. closeNetworkTools():configureNetworkTools()opened the drift/SQLite ARP connection and no public API closed it, so a CLI, a test or a one-shot script printed everything it had to say and then hung at exit — the symptom reads as a stuck scan rather than a finished one. Shutting down now takesawait closeNetworkTools()instead of importingsrc/, and configuring again afterwards still works: the closed connection is dropped from the cache that made every later ARP read throwConnectionClosedException, reconfiguring skips registration instead of failing withType DatabaseService<AppDatabase> is already registered,Repository.close()awaits the connection close rather than returning while the background isolate is still up, and the debug log listener is replaced instead of added to, so N configures no longer print each record N times.tool/scan_report.dartlost itsexit(0)backstop.dart_pingfloor raised to^10.0.1: on 9.x the iOS branch of thePingfactory throwsUnimplementedErrorunless a separate plugin registers aniosFactory— which this package never does — and the scanner catches that per host, so an app whose dependency graph is held at 9.x silently lost the ICMP fallback, the leg that rescues exactly the hosts a TCP probe misses. A fresh resolve already picked 10.x; the floor is what stops anything older from being usable.- A reset is a closed port, not a failed scan:
connectToPortrethrew every socket error that was not a refusal, so a probe answered with RST instead ofECONNREFUSEDaborted the whole scan. Darwin and Linux reply RST when a port is rebound between the probe and the reply — that surfaced aserrno = 54on amacos-latestCI run, where 400 local bind-close-connect cycles had all reported61.PortScannerServiceImpl.closedPortErrorCodesnow carries ECONNRESET for each family (54 Darwin, 104 Linux/Android, 10054 Windows), and the classification moved intoisClosedPortError, which a new suite pins per platform.
6.0.18 #
- Vendor table ships inside the package:
hook/build.dartand thevendor_map.dartstub are replaced byvendor_index.data.dart— the same 49,533 assignments as a packed binary index, gzipped into a Dart string literal. The first lookup decodes it, about 10 ms and 1.4 MB, and every lookup after that is a binary search. Nothing is generated while you build, so the 6.0.17 failure mode where a cold build raced the hook and compiled the empty stub is gone: vendor data needs no network access at build time and the first build of an app resolves vendors. - Smaller app binaries: on a Vernet macOS release build carrying the same data, the Dart AOT snapshot drops from 13.6 MB to 10.1 MB and the
.appbundle from 32.6 MB to 29.2 MB. Against 6.0.16 the snapshot is 2.0 MB smaller while covering a third more assignments. - Bigger install: the published archive grows from 50 KB to 612 KB — the same trade, moved from build time to download time. The
hooksdependency is dropped, andconfigureNetworkTools(buildVendorTable: false)now only skips the warm-up in isolates that never look a vendor up. - One generator, drift-checked:
tool/build_vendor_index.dartreplacestool/generate_vendor_map.dartand the hook, andtest/vendor_index_parity_test.dartrebuilds the index from the bundled IEEE CSV and compares it byte for byte, so the committed index cannot silently go stale. Replace the CSV, run the tool, commit both files.
6.0.17 #
- Longest-prefix vendor matching:
ActiveHost.vendornow resolves MA-M, MA-S and IAB blocks as well as MA-L. Lookups probe the most specific block first (9 hex digits, then 7, then 6), so a device in a sub-block is attributed to its own assignee instead of theIEEE Registration Authorityentry registered for the parent block. Fixes #303. - Smaller package, fuller table: the generated table is no longer committed.
hook/build.dartbuilds it at compile time from the IEEE CSV, and it now covers 49,533 assignments instead of 34,451. The published archive drops from 749 KB to 49 KB. Vendor data therefore needs network access at build time: a build that cannot fetch the CSV compiles against an empty table and resolves no vendors.
6.0.16 #
- IPv6 port scanning: Port scanner now resolves and scans IPv6 addresses. Removed the IPv4-only DNS filter so both IPv4 and IPv6 hosts work.
6.0.15 #
- Device type inference: Discovered devices now include an inferred type (Router, Printer, Switch, etc.) based on open port patterns. The
ActiveHost.deviceTypefield is populated during TCP probing by analyzing which common service ports responded. - CI/CD pipeline: Releasing a new version now creates the git tag and GitHub release, then publishes to pub.dev automatically with tag-based OIDC authentication.
6.0.14 #
- TCP-connect sweep for cross-platform consistency: Host discovery now uses TCP-connect probes to 14 common ports (21, 22, 23, 53, 80, 161, 443, 445, 631, 3389, 5900, 8080, 8443, 9100) instead of ICMP ping on all platforms. This ensures Android, iOS, macOS, Windows, and Linux discover the same devices.
- Bounded concurrency with platform-specific tuning: Mobile platforms use 56 concurrent connections, desktop uses 96. Prevents network stack overload on mobile while maintaining fast scans on desktop.
- Smooth progress reporting: Progress bar updates continuously from 0% to 100%. TCP phase covers 0-95%, ping fallback (if needed) covers 95-100%. Reports 0% immediately when scan starts to prevent frozen UI feeling.
- Two-phase discovery: TCP-connect sweep runs first with bounded concurrency, then ICMP ping fallback for hosts that didn't respond to TCP. Both phases use the same concurrency limits.
- 14-port TCP probe: Discovers more device types by probing common service ports (FTP, SSH, Telnet, DNS, HTTP, SNMP, HTTPS, SMB, IPP, RDP, VNC, HTTP-Alt, HTTPS-Alt, Printer).
- Removed dead ARP code: Cleaned up unused ARP table reading methods and simplified the discovery pipeline.
- Default timeout increased to 2s: Catches slow-responding devices that were missed with the previous 1s timeout.
- mDNS merge by IP: Devices found via mDNS are merged with TCP-discovered hosts by IP address, enriching device information.
- Unit tests added: Tests for concurrency settings, progress callback behavior, and cross-platform consistency.
6.0.13 #
- Build hook refined: removed unused
data_assetsdependency, added comprehensive tests for generated vendor map (6 new tests verifying structure, count, and known entries). - Hybrid approach for vendor map: committed minimal stub file that build hook replaces with full 34,451-entry map during
dart pub get. Reduces repository size while ensuring package works immediately after cloning.
6.0.12 #
- Isolate failures no longer hang a scan:
getAllPingableDevicesAsyncandcustomDiscover(async: true)spawn their isolate with error and exit ports, so an uncaught error or an early isolate exit surfaces to the caller instead of leaving the stream open forever. - Both isolate entry points now catch failures and report them, so a bad database directory or an unresolvable target arrives as an exception rather than a silent isolate death.
- Added regression coverage for the async port scan failing on an unresolvable target.
- MAC vendor lookup moved from runtime CSV download to compile-time generation: build hook downloads the vendor CSV during
dart pub getand generates a const map with 34,451 entries, providing O(1) lookups without runtime network dependency. Removed SQLite vendor table and unused dependencies (csv, http, data_assets). SDK constraint upgraded to >=3.10.0 for build hooks support.
6.0.11 #
- Much faster host discovery on Linux, macOS and Windows: the scanner primes the neighbour cache with UDP and reads the numeric ARP table once (
arp -an,/proc/net/arp, numericarp -a) instead of spawning apingprocess per address. Hosts that ignore ICMP are still found, the device the scan runs on is included when it falls in the range, broadcast and multicast MAC rows are filtered out, and mobile platforms or non-local subnets fall back to the ICMP sweep. - Host names now resolve concurrently for the discovered hosts (250 ms budget during the scan, plus a lazy retry on first access) instead of relying on the serial reverse lookups
arp -aperforms. Networks without reverse DNS return no name, anddeviceNamefalls back to mDNS, the ARP entry, thenGeneric Device. getAllPingableDevicesAsyncno longer builds the vendor table inside its isolate, removing a multi-second first-use vendor CSV download from the start of a scan.configureNetworkToolsgained abuildVendorTableoption for worker isolates.- Scan progress now reports 100 when discovery completes, including on the async API.
- MAC vendor and ARP table failures are non-fatal: vendor CSV download/parse errors are logged and skipped, ARP command errors no longer abort host discovery, and MAC prefixes are normalized before lookup.
- Faster scans: host details (hostname, MAC vendor, mDNS) resolve lazily, port scans use bounded concurrency (
maxConcurrency, default 128), and subnet scans run in a single isolate. - Added database indexes for vendor and ARP lookups.
- README updated with the current API, a working example (
example/main.dart), the discovery and hostname behavior, mobile permission notes, and corrected Vernet repository and support/donate links. - Improved hostname and MAC vendor resolution for
vernetissues #119 and #121. - Added regression tests, raising line coverage to 92%.
6.0.10 #
Bug fixes and improvements.
6.0.9 #
Bug fixes and improvements.
6.0.8 #
Fix for missing example tab.
6.0.7 #
Csv upgrade and downgrade fix.
6.0.6 #
Dependency update, bug fixes, example tab fix.
6.0.5 #
Bug fixes and improvements
6.0.4 #
Performance improvements
6.0.3 #
Bug fixes and performance improvements
6.0.2 #
Database error fix
6.0.1 #
Bug fix for windows
6.0.0 #
Performance improvement using drift database
5.0.6 #
mDNS search improvements
5.0.5 #
Fixed compatibility for web
5.0.4 #
Updated dependencies, added tests, and updated GHA.
5.0.3 #
Updated dependencies
5.0.2 #
- Bug for other languages on Windows fixed by codepage.
- Added mac address option to ActiveHost constractor.
5.0.1 #
- Bug fixes and improvements
5.0.0 #
- Added hostIds list parameter to restrict scan to only these ids.
- Breaking changes on calling static methods. You have to use instance of service now.
Breaking change Replace these occurences in your project
* HostScanner to HostScannerService.instance
* PortScanner to PortScannerService.instance
4.0.4 #
- Bug fix for sync runs when async flag is true
4.0.3 #
- scanPortsForSingleDevice and customDiscover supports async mode now.
4.0.2 #
- Separated logs for example and library
4.0.1 #
- Fixed path problem for dart and flutter sdk
3.2.7 #
- Removed example folder and added pubignore.
- Added vendor details but database looks old.
- More results are added using ARP on Lin/Mac/Win.
3.2.6 #
- Added mac address support on Desktop (Linux, macOS, and Windows)
3.2.5 #
- Bug fix for iOS listing all results in HostScanner
3.2.4 #
- Bug fixes and improvements. Better code coverage reports.
3.2.3 #
- Upgraded dependencies and improved pub score, moved network_tools_flutter to new repo
3.2.2 #
- Supporting changes for network_tools_flutter
3.2.1 #
- Now GHA runs tests against 3 platforms windows, ubuntu, macos
- Code coverage is fixed so that it's visible in codecov portal.
3.2.0 #
- getAllPingableDevicesAsync runs inside isolate to find all devices in a network.
- Bug fixes and improvements
3.1.0 #
Web Support and bug fixes for mDns devices giving error in getting IP
3.0.0+3 #
Refactoring for field names
3.0.0+2 #
This release is only meant to test Github Actions for Dart Package publishing. It's same as v3.0.0. Nothing changed.
3.0.0+1 #
This release is only meant to test Github Actions for Dart Package publishing. It's same as v3.0.0. Nothing changed.
3.0.0 #
Breaking change Change most of the methods names
* HostScanner.discover to HostScanner.getAllPingableDevices
* HostScanner.discoverPort to HostScanner.scanDevicesForSinglePort
* PortScanner.discover to PortScanner.scanPortsForSingleDevice
Ip field in ActiveHost is now InternetAddress type instead of string which improve handling of IPv6.
ActiveHost now contains host name of the address if exist.
Better naming of methods
Bug fixes and improvements
2.1.0 #
Added partly support for searching mdns devices.
2.0.0 #
Breaking change Bump minimum dart version to 2.17.0.
Updated dart_ping package version to 7.0.1.
Updated test package version to 1.21.4.
1.0.8 #
Fixes
Add logs using logging package #13.
Even more points in pub.dev page #20.
1.0.7 #
Fixed
Saving the response time from each device #9.
Example crash on Windows #14.
Bump package version #15.
0.0.6 #
Resolved issue #9 and #10.
0.0.5 #
Resolved issue #1.
0.0.4 #
Single and Custom Port Scan added.
0.0.3 #
Subnet and Port range added.
0.0.2 #
Added example and followed pub conventions.
0.0.1 #
PortScanner and HostScanner.