Are there standard (or semi-standard, widely deployed) C macros for:
I have seen these defined in proprietary header files at various times, but I see a lot of sample/tutorial code that otherwise uses "proper" macros and doesn't have anything for these -- the "6" is always hardcoded.
FWIW I'm on linux.
Obviously it's trivial to define my own, but I'd like to use a standard where possible.
Some platforms define a "/usr/include/net/ethernet.h" which does something like:
#define ETHER_ADDR_LEN 6
And some platforms have similar defines in if_ether.h
(located in various places, including netinet).
However, I'm unaware of anything that defines the length of a "string formatted" address, and I'm unaware of any standard that imposes these #define
s, so they're likely not universally portable.