Resolve `name` through every system resolver plus public 1.1.1.1 / 8.8.8.8, reporting per-resolver answers, query latency and the DNSSEC AD flag, whether the resolvers agree (split-DNS / hijack smell), and DoH/DoT reachability.
(name)
| 1083 | try: |
| 1084 | return int(mac[0:2], 16) |
| 1085 | except (ValueError, TypeError): |
| 1086 | return None |
| 1087 | |
| 1088 | |
| 1089 | def _is_laa(mac): |
| 1090 | """True if the locally-administered (privacy/spoof) bit is set.""" |
| 1091 | b0 = _mac_first_octet(mac) |
| 1092 | return b0 is not None and bool(b0 & 0x02) |
| 1093 | |
| 1094 | |
| 1095 | def _is_universal_prefix(oui): |
| 1096 | """True if a 6-hex OUI could be a legitimately-registered (LAA-clear) OUI. |
| 1097 | Filters junk out of the vendor table so an LAA/randomization range in a full |
| 1098 | manuf file can't be mistaken for a real vendor by the spoof check.""" |
| 1099 | try: |
| 1100 | b0 = int(oui[0:2], 16) |
| 1101 | except (ValueError, TypeError, IndexError): |
| 1102 | return False |
| 1103 | return not (b0 & 0x02) and not (b0 & 0x01) |
| 1104 | |
| 1105 | |
| 1106 | def _load_oui_db(): |
| 1107 | """Load {6-hex-prefix: vendor} from the arp-scan / nmap OUI DB if present, |
| 1108 | merged over the built-in seed. Universal prefixes only; cached.""" |
| 1109 | global _oui_db_cache |
| 1110 | if _oui_db_cache is not None: |
| 1111 | return _oui_db_cache |
| 1112 | with _oui_db_lock: |
| 1113 | if _oui_db_cache is not None: |
| 1114 | return _oui_db_cache |
| 1115 | db = {} |
| 1116 | for oui, vendor in _MAC_VENDOR_SEED.items(): |
| 1117 | db[oui.replace(':', '')] = vendor |
| 1118 | for path in _OUI_DB_PATHS: |
| 1119 | try: |
| 1120 | with open(path, encoding='utf-8', errors='replace') as f: |
| 1121 | for line in f: |
| 1122 | line = line.strip() |
| 1123 | if not line or line.startswith('#'): |
| 1124 | continue |
no test coverage detected