33 lines
677 B
C++
33 lines
677 B
C++
|
/***
|
||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: IPAddress.hpp
|
||
|
Date: 2022-8-15
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
namespace Aurora::IO::Net
|
||
|
{
|
||
|
struct AUKN_SYM IPAddress : AuEnableHashCodeOnData<IPAddress>
|
||
|
{
|
||
|
EIPProtocol ip;
|
||
|
union
|
||
|
{
|
||
|
AuUInt8 v4[4];
|
||
|
AuUInt16 v6[8];
|
||
|
};
|
||
|
|
||
|
IPAddress();
|
||
|
IPAddress(const AuString &parse);
|
||
|
|
||
|
AuString ToString() const;
|
||
|
bool IsValid() const;
|
||
|
|
||
|
operator bool() const;
|
||
|
|
||
|
bool operator ==(const IPAddress &cmp) const;
|
||
|
|
||
|
void UpdateFromName(bool bIPv6, const char *buf);
|
||
|
};
|
||
|
}
|