#include <endian.h>unsigned short inthtons(unsigned short int hostshort) {#if __BYTE_ORDER==__LITTLE_ENDIANreturn((hostshort>>8)&0xff) | (hostshort<<8);#elsereturn hostshort;#endif}unsigned short intntohs(unsigned short int hostshort)__attribute__((weak,alias("htons")));