Skip to content

Release v1.2.0: hostname resolution, hardware vendor lookup, and CLI UX improvements - #49

Merged
Criseda merged 1 commit into
mainfrom
feat/hostname-vendor-lookup
Sep 18, 2026
Merged

Criseda merged 1 commit into
mainfrom
feat/hostname-vendor-lookup

Conversation

@Criseda

@Criseda Criseda commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

Release v1.2.0: Adds zero-privilege, cross-platform hostname resolution, hardware manufacturer identification, parallel ARP fallback verification, and refined CLI UX to NetScanner (ns -s), achieving full feature parity with tools like Advanced IP Scanner across Windows, Linux, and macOS without requiring root privileges.

Key Changes

  1. Embedded OUI Database (src/core/oui.zig):

    • Bundles 1,969 curated IEEE OUI manufacturer prefixes parsed at compile time from standard Wireshark manuf flat format (src/core/data/manuf.txt) and sorted in .rodata for sub-microsecond binary search lookups ($O(\log_2 N)$, < 50ns per host).
    • Zero runtime memory allocation, zero runtime parsing, and zero startup delay (0.0 ms).
    • Supports --oui-file <path> to dynamically load full external Wireshark manuf or IEEE flat files without code changes, handling colon (:) and hyphen (-) delimiters, single- or double-digit hex octets, and safe memory lifecycle management on reloads.
  2. Multi-Protocol Hostname Resolution (src/c/resolver.c, src/core/resolver.zig):

    • RFC 6762 mDNS (UDP 5353): Resolves gaming consoles (PS5), smart home bridges (Philips Hue), Apple devices, and smart TVs via lightweight reverse PTR probes with compression label pointer loop guards and bounds validation.
    • RFC 1002 NetBIOS NBSTAT (UDP 137): Resolves Windows PCs, Samba servers, and NAS devices with source IP validation against rogue LAN broadcast traffic.
    • Reverse DNS (PTR): Standard getnameinfo(..., NI_NAMEREQD) with domain suffix stripping (.local, .lan, ISP suffixes) and IP-echo filtering (ignoring PTR records that merely echo numeric IP addresses or .in-addr.arpa).
    • Terminal Escape Filtering: Enforces strict printable ASCII validation (c >= 32 && c <= 126) on NetBIOS and mDNS hostnames to prevent malicious LAN devices from injecting ANSI terminal escape sequences.
  3. Ping-Blocking Host Discovery (src/core/scanner.zig, src/core/utils.zig):

    • Windows: ARP harvest pass verifies candidates that drop ICMP pings via a parallel SendARP worker pool, discovering hardened IoT devices and repeaters (GL.iNet, TP-Link, smart plugs) in milliseconds without stalling discovery sweeps.
    • Linux: Kernel neighbor reachability evaluation (REACHABLE and DELAY states) via ip neigh confirms live hosts immediately.
  4. CLI Flags & Redesigned Usage Output (src/core/utils.zig, src/core/main.zig):

    • Added --resolve (hostnames + vendors), --hostname, --vendor, and --oui-file <path>.
    • Displays an aligned tabular view (IP, HOSTNAME, MAC, MANUFACTURER) when resolution flags are used, while preserving the clean numerical recap when omitted.
    • Restructured, modern --help layout with categorized sections (COMMANDS, SUBNET OPTIONS, PORT OPTIONS, GLOBAL FLAGS, EXAMPLES).
    • Added -h and -v shorthands alongside --help and --version.
  5. Version Bump to v1.2.0:

    • Updated build.zig.zon, CHANGELOG.md, README.md, docs/README.md, and src/core/utils.zig.

Verification

  • Live Local Network Sweep (ns -s 192.168.0.1/24 --resolve): 10/10 live hosts matched Advanced IP Scanner with exact hostnames and manufacturers in 6.8s.
  • Automated Tests: All 40 unit and integration tests passed (zig build test --summary all).
  • Multi-Platform Release: Successfully cross-compiled for all 5 release targets (zig build release -Doptimize=ReleaseFast).

@Criseda
Criseda force-pushed the feat/hostname-vendor-lookup branch 4 times, most recently from fbb9cab to dcf4f9c Compare September 18, 2026 20:21
@Criseda Criseda changed the title feat: add hostname resolution and hardware manufacturer lookup Release v1.2.0: hostname resolution, hardware vendor lookup, and CLI UX improvements Sep 18, 2026
…nd CLI UX improvements

Implements zero-privilege, cross-platform hostname resolution, hardware
manufacturer identification, parallel ARP fallback verification, and
improved CLI UX for subnet discovery (ns -s), achieving feature parity
with Advanced IP Scanner across Windows, Linux, and macOS without requiring
root privileges. Bumps package and documentation to v1.2.0.

Key additions & architectural highlights:
- Embedded OUI database (src/core/oui.zig): 1,969 curated IEEE OUI
  prefixes parsed at compile time from standard Wireshark manuf flat format
  and baked into .rodata for sub-microsecond binary search lookups (< 50ns per host).
  Allows loading external Wireshark manuf and IEEE flat files via
  --oui-file <path> with colon/hyphen normalization and safe reload management.
- Multi-protocol hostname resolution (src/c/resolver.c, src/core/resolver.zig):
  * RFC 6762 mDNS (UDP 5353) unicast reverse PTR with compression label
    handling and cyclic pointer bounds checking.
  * RFC 1002 NetBIOS NBSTAT (UDP 137) with source IP verification.
  * Terminal escape sequence filtering for untrusted network hostnames.
  * Standard Reverse DNS PTR via getnameinfo(NI_NAMEREQD).
  * Automated domain cleaning, suffix stripping, and IP-echo filtering.
- Ping-blocking host discovery (src/core/scanner.zig, src/core/utils.zig):
  * Windows: Parallel SendARP worker pool catches firewalled IoT devices
    and smart plugs in milliseconds without stalling discovery sweeps.
  * Linux: Kernel neighbor reachability evaluation (REACHABLE/DELAY states)
    via ip neigh for immediate confirmation.
- CLI flags & formatting (src/core/utils.zig, src/core/main.zig):
  * Flags: --resolve, --hostname, --vendor, and --oui-file <path>.
  * Shorthands: -h and -v alongside --help and --version.
  * Redesigned, categorized --help output with clear usage examples.
  * Aligned tabular output (IP, HOSTNAME, MAC, MANUFACTURER) when resolution
    is active; backward-compatible numeric recap when omitted.
- Version bump: build.zig.zon, CHANGELOG.md, README.md, docs/README.md, utils.zig.
- Verified: All 40 automated unit and integration tests pass; all 5 release
  targets build cleanly.
@Criseda
Criseda force-pushed the feat/hostname-vendor-lookup branch from dcf4f9c to aa745f8 Compare September 18, 2026 20:24
@Criseda
Criseda merged commit 90ad95d into main Sep 18, 2026
3 checks passed
@Criseda
Criseda deleted the feat/hostname-vendor-lookup branch September 18, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant