Our name resolution logic does not use the address block
of the lookup result. As a small optimization avoid a
memset/memcpy to return the result and just return
two const string pointers.
* Remove an internal implementation from the public API. Now the result
is propagated as second parameter while the return value indicates
whether an entry was found.
* Change iteration function to avoid comparing string pointers, two
different values may or may not point to the same underlying value
depending on linker optimization.
* None of the OUI tables are supposed to be written to, constify them.
* Use proper types in the bsearch parameters to avoid confusion.
* Move masking outside the bsearch function as tiny optimization.
* Document the MA-L/M/S macros.
Add the short name (used by Wireshark for MAC address name resolution)
to the output as another column. This matches the historical
format for this text file, before it was turned into static
binary data.
The use case for still parsing an optional external manuf text file
is to allow customization of the compiled in data, for any reason.
In that case it is useful to be able to run something like:
tshark -G manuf | grep MyVendorName >> ~/.config/wireshark/manuf
And then edit the newly added short name entries to one's satisfaction.
To reduce startup external file parsing replce the manuf file with
static arrays compiled into the binary.
Add 3 tables for MA-L, MA-M and MA-S. Add a fourth table to direct
a 24-bit MAC prefix (OUI) to one of these tables.
Adapt the make-manuf.py script to generate the static C data
instead of the text file.
The arrays are sorted and a binary search is performed to map
an OUI (24bit/28bit/36bit) to a short and long name.