17 #ifndef HH_SENF_Socket_Protocols_INet_INet4Address_ 18 #define HH_SENF_Socket_Protocols_INet_INet4Address_ 1 22 #include <boost/cstdint.hpp> 23 #include <boost/array.hpp> 24 #include <boost/operators.hpp> 79 :
public boost::array<boost::uint8_t,4>,
116 template <
class InputIterator>
146 inaddr_type
inaddr()
const;
156 enum InAddr_t { IsInAddr };
158 inaddr_type & iref();
159 inaddr_type iref()
const;
197 template <boost::u
int32_t address,
unsigned prefix_len>
209 :
public boost::equality_comparable<INet4Network>,
226 unsigned prefix_len()
const;
245 INet4Network subnet(boost::uint32_t net,
unsigned prefix_len);
260 boost::uint32_t
mask()
const;
261 unsigned prefix_len_checked(
unsigned prefix_len)
const;
263 unsigned prefix_len_;
static INet4Address const Broadcast
address_type address() const
Return address represented as integer number.
Check INet4Address against a fixed network prefix.
bool local() const
true, if address is locally administered
std::ostream & operator<<(std::ostream &os, INet4Address const &addr)
Output INet4Address instance as it's string representation.
static INet4Address const None
The empty (0) address.
static INet4Address from_inaddr(inaddr_type v)
Construct address from integer in network byte order.
bool operator==(EUI64 const &eui64, MACAddress const &mac)
bool broadcast() const
true, if address is 255.255.255.255
bool multicast() const
true, if address is a multicast address
static INet4Address from_string(std::string const &s)
Convert string to address.
static INet4Address from_data(InputIterator i)
Construct address from 4 bytes of raw data.
uint32_t inaddr_type
Legacy address representation in network byte order.
std::istream & operator>>(std::istream &os, INet4Address &addr)
Initialize INet4Address instance from a string representation sets std::ios::failbit on the stream if...
bool loopback() const
true, if address is within the loopback network
uint32_t address_type
Address representation as number in host byte order.
bool boolean_test() const
true, if address is non-empty (!= 0.0.0.0)
inaddr_type inaddr() const
Return the raw network byte order address.
static INet4Address const Loopback
The loopback (127.0.0.1) address.
INet4Address()
Construct an empty address.