(3) byte order
<1> Big endian byte order
The highest significant bit is stored at the lowest memory address, and the least significant bit is stored at the highest memory address.
<2> Small-endian byte order
The highest significant bit is stored at the highest memory address, and the least significant bit is stored at the lowest memory address.
Save 0x12345678
-----------------> The direction of memory address growth
12 34 56 78 big endian byte order
78 56 34 12 small-endian byte-order
<3> Host byte order
Different hosts have different byte-order, such as x86 is the small-endian byte-order, ARM is configurable byte-order
<4> Network byte order
network byte order defined as big endian byte order
<5> byte-Order conversion functions
uint32_t htonl (uint32_t hostlong);
uint16_t htons (uint16_t hostshort);
uint32_t Ntohl (uint32_t netlong);
uint16_t Ntohs (uint32_t netlong);
<6> Address Conversion functions
#incldue <netinet/in.h>
#include <arpa/inet.h>
int Inet_aton (const char *pc, struct in_addr *inp); Convert dotted decimal to address structure
in_addr_t inet_addr (const char *pc); Convert dotted decimal to 32-bit integers
Char *inet_ntoa (struct in_addr in); Converts an address structure to a dotted-decimal IP address
"Linux Network Programming" byte order and address reload