Unverified Commit 792f39c2 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #815

Clarify bit representation of ipv4 address factory
parents 46dba713 4d286a3d
......@@ -46,6 +46,7 @@ public:
explicit ipv4_address(array_type bytes);
/// Constructs an IPv4 address from bits in network byte order.
static ipv4_address from_bits(uint32_t bits) {
ipv4_address result;
result.bits(bits);
......@@ -60,13 +61,14 @@ public:
/// Returns whether this is a multicast address.
bool is_multicast() const noexcept;
/// Returns the bits of the IP address in a single integer.
/// Returns the bits of the IP address in a single integer arranged in network
/// byte order.
inline uint32_t bits() const noexcept {
return bits_;
}
/// Sets all bits of the IP address in a single 32-bit write.
/// @private
/// Sets all bits of the IP address with a single 32-bit write. Expects
/// argument in network byte order.
inline void bits(uint32_t value) noexcept {
bits_ = value;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment