example:
12:45:ff:ab:aa:cd is valid 45:jj:jj:kk:ui>cd is not valid
You can rely on the sscanf to check the format and content of the provided MAC address, something like
bool checkMacAddr(const char * mac) noexcept
{
if(nullptr == mac) return false;
printf("[%s] strlen(%s)=%lu\n", __func__, mac, strlen(mac));
if(strlen(mac) != 17) return false;
uint32_t bytes[6]={0};
return (6 == sscanf(mac, "%02X:%02X:%02X:%02X:%02X:%02X"
, &bytes[5]
, &bytes[4]
, &bytes[3]
, &bytes[2]
, &bytes[1]
, &bytes[0]));
}