sources/network/ipaddress.h

changeset 189
248d0b85cbda
parent 188
5fc32e4b2a8c
child 190
90bf9049e5eb
equal deleted inserted replaced
188:5fc32e4b2a8c 189:248d0b85cbda
38 BEGIN_ZFC_NAMESPACE 38 BEGIN_ZFC_NAMESPACE
39 39
40 namespace net 40 namespace net
41 { 41 {
42 using octet_t = std::uint8_t; 42 using octet_t = std::uint8_t;
43 using port_t = std::uint16_t;
44 using host_t = std::uint32_t;
43 struct ip_address 45 struct ip_address
44 { 46 {
45 std::uint32_t host; 47 net::host_t host = 0;
46 std::uint16_t port; 48 net::port_t port = 0;
47 bool operator<(const ip_address& other) const; 49 bool operator<(const ip_address& other) const;
48 bool operator==(const ip_address& other) const; 50 bool operator==(const ip_address& other) const;
49 }; 51 };
50 constexpr ip_address localhost = {0x7f000001, 0}; 52 constexpr ip_address localhost = {0x7f000001, 0};
51 int ip_compare(const ip_address& one, const ip_address& other); 53 int ip_compare(const ip_address& one, const ip_address& other);

mercurial