
2.1 字节排序函数
h 代表host, n 代表 network
#include <netinet/in.h>
uint16_t htons(uint16_t host16bitvalue); //转换端口
uint32_t htonl(uint32_t host32bitvalue); //转换IP地址
uint16_t ntohs(uint16_t net16bitvalue);
uint32_t ntohl(uint32_t net32bitvalue);
2.2 字节操纵函数
2.3 地址转换函数