#include #include #include void uint16_store_bigendian(unsigned char *s,uint16_t x) { x = htobe16(x); memcpy(s,&x,sizeof x); }