wifi_lab
Clone
https://git.tahinli.com/Tahinli/wifi_lab.git
0 watching0 forksRust2.1 MiBb265998Tahinli1 month ago27 commits
| 1 | //! OUI vendor lookup for MAC prefixes. |
| 2 | //! |
| 3 | //! Three checked-in snapshot tables from IEEE registries (provenance and |
| 4 | //! update semantics in docs/CONTRACT.md `## oui.rs`): |
| 5 | //! - `src/data/oui.txt` — MA-L 24-bit (`AABBCC|Vendor`, 6 hex chars) |
| 6 | //! - `src/data/oui28.txt` — MA-M 28-bit (`AABBCCD|Vendor`, 7 hex chars) |
| 7 | //! - `src/data/oui36.txt` — MA-S 36-bit (`AABBCCDEE|Vendor`, 9 hex chars) |
| 8 | //! |
| 9 | //! Vendors (= short name, ≤32 chars) are byte-sorted and unique per file. |
| 10 | //! Lookup is longest-prefix-first: MA-S (36) → MA-M (28) → MA-L (24), since |
| 11 | //! the sub-assignments sit under someone else's MA-L base. |
| 12 | |
| 13 | use LazyLock; |
| 14 | |
| 15 | use crateMacAddr; |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | /// Parsed `(prefix, vendor)` pairs from `data/oui.txt` (24-bit MA-L). |
| 28 | static TABLE24: = |
| 29 | new; |
| 30 | /// MA-M 28-bit sub-assignments. |
| 31 | static TABLE28: = |
| 32 | new; |
| 33 | /// MA-S 36-bit sub-assignments. |
| 34 | static TABLE36: = new |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | ; |
| 44 | |
| 45 | /// True for locally administered MACs (U/L bit set, wire byte order): the |
| 46 | /// randomized/rotated addresses modern phones and laptops send. These have |
| 47 | /// no IEEE vendor — `lookup` returns None for them by design. |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | /// Vendor for a MAC's prefix; None for locally-administered/unknown |
| 53 | /// prefixes (see `is_locally_administered`). |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 |