h表示主机(host),n表示网络(net),l表示32位长整数,s表示16短整数。
uint32_t转化为点分格式字符串ip:
struct in_addr ip4_addr;
ip4_addr.s_addr = uint32_t;
inet_ntoa(ip4_addr);
点分格式字符串ip转化为uint32_t:
ntohl(inet_addr("192.168.1.1"));
h表示主机(host),n表示网络(net),l表示32位长整数,s表示16短整数。
uint32_t转化为点分格式字符串ip:
struct in_addr ip4_addr;
ip4_addr.s_addr = uint32_t;
inet_ntoa(ip4_addr);
点分格式字符串ip转化为uint32_t:
ntohl(inet_addr("192.168.1.1"));