mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
Get rid of lanplus-specific yet very generic in nature lanplus_swap() function that unconditionally swaps bytes in an arbitrary byte array. Move it to helper module and add two conditionally working interfaces to it: - array_ntoh() for network (BE) to host conversion, and - array_letoh() for ipmi (LE) to host conversion. The added functions will only perform byte swapping if the target architecture differs in endianness from the data source. array_ntoh() will only do swap on LE machines, while array_letoh() will only do it on BE ones. These functions are introduced for future use in other places of ipmitool. Partially resolves ipmitool/ipmitool#26 Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>