30 #ifndef TINS_IPV6_ADDRESS 31 #define TINS_IPV6_ADDRESS 37 #include <tins/cxxstd.h> 38 #include <tins/macros.h> 47 static const size_t address_size = 16;
64 static IPv6Address from_prefix_length(uint32_t prefix_length);
100 std::string to_string()
const;
120 return address_ + address_size;
127 const_iterator
end()
const {
128 return address_ + address_size;
139 return std::equal(begin(), end(), rhs.address_);
150 return !(*
this == rhs);
161 return std::lexicographical_compare(begin(), end(), rhs.
begin(), rhs.
end());
172 return !operator>(rhs);
183 return std::lexicographical_compare(rhs.
begin(), rhs.
end(), begin(), end());
194 return !operator<(rhs);
212 template<
typename OutputIterator>
213 OutputIterator
copy(OutputIterator iter)
const {
214 return std::copy(begin(), end(), iter);
223 bool is_loopback()
const;
231 bool is_multicast()
const;
249 TINS_API
friend std::ostream& operator<<(std::ostream& os,
const IPv6Address& addr);
267 void init(
const char* addr);
269 uint8_t address_[address_size];
278 struct hash<
Tins::IPv6Address> {
281 std::size_t output = Tins::IPv6Address::address_size;
283 for (; iter != addr.
end(); ++iter) {
284 output ^= *iter + 0x9e3779b9 + (output << 6) + (output >> 2);
292 #endif // TINS_IS_CXX11 294 #endif // TINS_IPV6_ADDRESS bool operator>(const IPv6Address &rhs) const
Compares this address for greater-than inequality.
Definition: ipv6_address.h:182
iterator end()
Definition: ipv6_address.h:119
Definition: hw_address.h:456
uint8_t * iterator
Definition: ipv6_address.h:52
bool operator==(const IPv6Address &rhs) const
Compares this address for equality.
Definition: ipv6_address.h:138
bool operator>=(const IPv6Address &rhs) const
Compares this address for greater-than equality.
Definition: ipv6_address.h:193
size_t size() const
Returns the size of an IPv6 Address.
Definition: ipv6_address.h:238
bool operator!=(const IPv6Address &rhs) const
Compares this address for inequality.
Definition: ipv6_address.h:149
const_iterator end() const
Definition: ipv6_address.h:127
The Tins namespace.
Definition: address_range.h:38
OutputIterator copy(OutputIterator iter) const
Helper function which copies the address into an output iterator.
Definition: ipv6_address.h:213
iterator begin()
Definition: ipv6_address.h:105
bool operator<=(const IPv6Address &rhs) const
Compares this address for less-than equality.
Definition: ipv6_address.h:171
bool operator<(const IPv6Address &rhs) const
Compares this address for less-than inequality.
Definition: ipv6_address.h:160
const_iterator begin() const
Definition: ipv6_address.h:112
Definition: ipv6_address.h:45
const uint8_t * const_iterator
Definition: ipv6_address.h:57