4#ifndef _Stroika_Foundation_IO_Network_InternetAddress_h_
5#define _Stroika_Foundation_IO_Network_InternetAddress_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
12#if qStroika_Foundation_Common_Platform_POSIX
14#include <sys/socket.h>
15#elif qStroika_Foundation_Common_Platform_Windows
23#include "Stroika/Foundation/Common/Common.h"
24#include "Stroika/Foundation/DataExchange/DefaultSerializer.h"
25#include "Stroika/Foundation/IO/Network/InternetProtocol/IP.h"
61 using Characters::String;
66#if qStroika_Foundation_Common_Platform_POSIX
186 constexpr
InternetAddress (
byte octet1,
byte octet2,
byte octet3,
byte octet4);
187 constexpr
InternetAddress (uint8_t octet1, uint8_t octet2, uint8_t octet3, uint8_t octet4);
193 template <ranges::range ITERABLE_OF_UINT8OrByte>
195 requires (Traversal::IIterableOfTo<ITERABLE_OF_UINT8OrByte,
byte> or Traversal::IIterableOfTo<ITERABLE_OF_UINT8OrByte, uint8_t>);
206 nonvirtual constexpr
bool empty () const;
213 nonvirtual
void clear ();
282 template <typename T>
283 nonvirtual T
As () const;
284 template <typename T>
290 nonvirtual strong_ordering operator<=> (const
InternetAddress& rhs) const;
309 nonvirtual
InternetAddress KeepSignificantBits (
unsigned int significantBits) const;
374 array<uint8_t, 4> fArray_4_uint_;
375 array<byte, 4> fArray_4_byte_;
376 array<uint8_t, 16> fArray_16_uint_;
377 array<byte, 16> fArray_16_byte_;
380 static_assert (totally_ordered<InternetAddress>);
435 struct DefaultSerializer<Stroika::Foundation::IO::Network::InternetAddress> {
450 static const InternetAddress kLowerBound;
451 static const InternetAddress kUpperBound;
453 static InternetAddress GetNext (InternetAddress n);
454 static InternetAddress GetPrevious (InternetAddress n);
466#include "InternetAddress.inl"
#define Stroika_Define_Enum_Bounds(FIRST_ITEM, LAST_ITEM)
String is like std::u32string, except it is much easier to use, often much more space efficient,...
nonvirtual bool IsPrivateAddress() const
nonvirtual constexpr bool empty() const
nonvirtual String ToString() const
constexpr InternetAddress()
nonvirtual constexpr optional< size_t > GetAddressSize() const
nonvirtual InternetAddress PinLowOrderBitsToMax(unsigned int o) const
offset this IP Address by 'o' by setting the low order 'o' bits to the maximum value
nonvirtual bool IsLinkLocalAddress() const
array< uint8_t, 16 > IPv6AddressOctets
nonvirtual optional< InternetAddress > AsAddressFamily(AddressFamily family) const
array< uint8_t, 4 > IPv4AddressOctets
nonvirtual bool IsLocalhostAddress() const
nonvirtual constexpr AddressFamily GetAddressFamily() const
static constexpr InternetAddress max()
nonvirtual InternetAddress Offset(uint64_t o) const
offset this IP Address by 'o' discrete addresses (positive only, unsigned offset).
static constexpr InternetAddress min()
nonvirtual bool IsMulticastAddress() const
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.
conditional_t<(sizeof(CHECK_T)<=2 *sizeof(void *)) and is_trivially_copyable_v< CHECK_T >, CHECK_T, const CHECK_T & > ArgByValueType
This is an alias for 'T' - but how we want to pass it on stack as formal parameter.
Traversal::Iterable< InternetAddress > InternetAddresses_Localhost(InternetProtocol::IP::IPVersionSupport ipSupport=InternetProtocol::IP::IPVersionSupport::eDEFAULT)
Traversal::Iterable< InternetAddress > InternetAddresses_Any(InternetProtocol::IP::IPVersionSupport ipSupport=InternetProtocol::IP::IPVersionSupport::eDEFAULT)
Memory::BLOB operator()(const T &t) const
This defines the default openness for a given type T, except for specializaitons. This is used by Exp...