1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Add IPv4/6Address::size member function

This commit is contained in:
Matias Fontanini
2017-10-01 20:38:54 -07:00
parent db0fb7f20d
commit f2766db829
4 changed files with 29 additions and 1 deletions

View File

@@ -32,10 +32,10 @@
#include <string>
#include <iosfwd>
#include <functional>
#include <stdint.h>
#include <tins/cxxstd.h>
#include <tins/macros.h>
#include <functional>
namespace Tins {
/**
@@ -181,6 +181,15 @@ public:
* \brief Returns true if this is a broadcast IPv4 address.
*/
bool is_broadcast() const;
/**
* \brief Returns the size of an IPv4 Address.
*
* This returns the value of IPv4Address::address_size
*/
size_t size() const {
return address_size;
}
/**
* \brief Writes this address to a std::ostream.

View File

@@ -196,6 +196,15 @@ public:
* ff00::/8, false otherwise.
*/
bool is_multicast() const;
/**
* \brief Returns the size of an IPv6 Address.
*
* This returns the value of IPv6Address::address_size
*/
size_t size() const {
return address_size;
}
/**
* \brief Writes this address in hex-notation to a std::ostream.