(pat, cast=float)
| 1637 | '--script-args', f'broadcast-dhcp-discover.timeout={int(timeout_s)}'] |
| 1638 | if interface and _valid_iface(interface): |
| 1639 | cmd += ['-e', interface] |
| 1640 | res = _run(cmd, timeout=int(timeout_s) + 25) |
| 1641 | if res['rc'] == 127: |
| 1642 | return [], 'nmap not found' |
| 1643 | return _parse_dhcp_discover(res['out']), None |
| 1644 | |
| 1645 | |
| 1646 | def _parse_dhcp_capture(output): |
| 1647 | """Parse verbose `tcpdump` DHCP output into client-request stats: |
| 1648 | (requests, distinct_client_macs). Counts DISCOVER/REQUEST (client→server) |
| 1649 | and the distinct BOOTP client hardware addresses (chaddr) behind them — |
no test coverage detected