optimize ntohl etc. in terms of bswap functions