use HAS_HTONL and htonl/ntohl if available in order to guarantee we retain the old format in any architecture