34 #ifndef INCLUDE_OLA_NETWORK_IPV4ADDRESS_H_
35 #define INCLUDE_OLA_NETWORK_IPV4ADDRESS_H_
40 #include <netinet/in.h>
80 : m_address(address) {
88 m_address.s_addr = address;
96 : m_address(other.m_address) {
104 if (
this != &other) {
105 m_address = other.m_address;
116 return m_address.s_addr == other.m_address.s_addr;
125 return !(*
this == other);
134 return m_address.s_addr < other.m_address.s_addr;
143 return m_address.s_addr > other.m_address.s_addr;
158 uint32_t
AsInt()
const {
return m_address.s_addr; }
165 return m_address.s_addr == INADDR_ANY;
174 void Get(uint8_t ptr[LENGTH]) {
176 reinterpret_cast<uint8_t*>(&m_address.s_addr),
253 struct in_addr m_address;
260 #endif // INCLUDE_OLA_NETWORK_IPV4ADDRESS_H_