12 #ifndef __NET_IPVALIDATOR_H__
13 #define __NET_IPVALIDATOR_H__
48 if (!myMasksV6.isEmpty())
51 for (
auto&& net : myMasksV6)
57 if (net.address() == ip)
76 return match(ip.
toV4());
86 return match(ip.
toV4());
87 return match(ip.
toV6());
102 myCustomMask.clear();
112 for (
auto&&
mask : masks)
118 for (
auto&&
mask : myMasksV4)
124 if (!myCustomMask.isEmpty())
128 wbuf.
append(myCustomMask);
136 for (
auto&&
mask : myMasksV6)
156 #endif // __NET_IPVALIDATOR_H__
void setMask(const UT_StringHolder &mask)
SYS_NO_DISCARD_RESULT bool isV4Mapped() const
bool match(const UT_IpAddressV6 &ip) const
Check if the provided ip matches one of the ip masks.
void addMasks(const UT_StringArray &masks)
Add the provided list of masks to the current list of masks.
This represents a Ipv4 address.
NET_IpValidator(const NET_IServerInfo &server)
void setMasks(const UT_StringArray &masks)
Adapter to retrieve basic server information.
This represents either an Ipv4 address or an Ipv6 address.
SYS_NO_DISCARD_RESULT bool isSubnetOf(const UT_IpNetworkV6 &net) const
SYS_NO_DISCARD_RESULT UT_IpAddressV4 toV4() const
SYS_FORCE_INLINE bool isEmpty() const
SYS_NO_DISCARD_RESULT UT_IpAddressV4 toV4() const
SYS_NO_DISCARD_RESULT bool isV4() const
UT_StringHolder toStringV6() const
This represents a Ipv6 address.
SYS_NO_DISCARD_RESULT UT_IpAddressV6 toV6() const
bool match(const UT_IpAddress &ip) const
SYS_FORCE_INLINE void append(char character)
UT_StringHolder toStringV4() const
NET_IpValidator(const NET_IServerInfo &server, const UT_StringArray &masks)