Do it with a bunch of ifs rather than with a translation table; that
lets the logic work differently for DLT_ -> LINKTYPE_ mapping and
LINKTYPE_ -> DLT_ mapping.
Have two "matching" ranges, so that the linktypes that preceded the BSDs
all going off in their own directions can be handled as a matching
range.
Avoid doing mapping if the corresponding LINKTYPE_ and DLT_ codes have
the same numerical value.
For LINKTYPE_ -> DLT_ mapping, don't map link-layer type values outside
either of the matching ranges if we don't have a specific mapping set up
for them, just treat the LINKTYPE_ value as if it's a DLT_ value. That
makes us handle some DLT_ codes outside the high mapping range to which
we assigned matching LINKTYPE_ codes, as well as attempting, as best we
can, files written with platform-dependent DLT_ codes (such as DLT_RAW)
as link-layer type codes (programs *on that platform* will handle them
correctly; programs will not do so on other platforms, but that's better
than not handling them correctly anywhere).