AuroraRuntime/Source/IO/Net/AuNetAdapter.hpp

47 lines
1.2 KiB
C++
Raw Normal View History

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuNetAdapter.hpp
Date: 2022-11-14
Author: Reece
***/
#pragma once
namespace Aurora::IO::Net
{
struct NetAdapter : INetAdapter
{
const AuString &ToName() override;
const AuString &ToDevice() override;
AuUInt16 GetIndex() override;
EIPProtocol ToFamily() override;
IPAddress ToAddress() override;
IPAddress ToBroadcastAddress() override;
IPAddress ToAnycastAddress() override;
IPAddress ToSubnetMask() override;
IPAddress ToGateway() override;
AuList<IPAddress> GetDNS() override;
// FriendlyName
static AuString GetHostname();
static AuList<AuSPtr<INetAdapter>> GetIPv4s(); // must be called first under lock
static AuList<AuSPtr<INetAdapter>> GetIPv6s(); // followed by me
// other protocols can go here
AuString name;
AuString device;
IPAddress address;
IPAddress broadcast;
IPAddress anycast;
IPAddress subnet;
IPAddress gateway;
AuList<IPAddress> dns;
AuUInt16 index {};
};
}