36 #ifndef _Wolframe_TYPES_ADDRESS_RESTRICTION_HPP_INCLUDED
37 #define _Wolframe_TYPES_ADDRESS_RESTRICTION_HPP_INCLUDED
39 #include <boost/asio/ip/address.hpp>
40 #include <boost/cstdint.hpp>
66 bool isAllowed(
const boost::asio::ip::address& adr)
const;
Structure to define and check configured ip based authorization.
Definition: addressRestriction.hpp:47
static boost::uint8_t parseNetworkMask(bool isIPv6, const char *str)
static bool matches(const std::vector< Element > &ar, const IPAddress &addr)
boost::asio::ip::address IPAddress
Definition: addressRestriction.hpp:72
AddressRestriction()
Default constructor.
Definition: addressRestriction.hpp:51
bool isAllowed(const boost::asio::ip::address &adr) const
Check if an address belongs to the set of allowed.
Element(const Element &o)
Definition: addressRestriction.hpp:81
void defineAddressAllowed(const std::string &adr)
Define an explicitely allowed address.
One element of a list of address restrictions (deny or allow)
Definition: addressRestriction.hpp:76
std::string tostring() const
Get all the restriction definitions defined in this structure as string.
IPAddress ip
Definition: addressRestriction.hpp:78
AddressRestriction(const AddressRestriction &o)
Copy constructor.
Definition: addressRestriction.hpp:53
Element()
Definition: addressRestriction.hpp:83
boost::uint8_t netMask
Definition: addressRestriction.hpp:79
void defineAllowedAll()
Define all addresses as allowed.
std::vector< Element > m_allowedar
array of allowed addresses/networks
Definition: addressRestriction.hpp:93
void defineDeniedAll()
Define all addresses as denied.
std::vector< Element > m_deniedar
array of denied addresses/networks
Definition: addressRestriction.hpp:94
static Element parseAddress(const std::string &adr)
void defineAddressDenied(const std::string &adr)
Define an explicitely denied address.