moved mac_trans function to add_dev.c