AuroraRuntime/Source/IO/Net/AuNetAdapter.hpp
Jamie Reece Wilson ec8f3b3f23 [+] INetAdapter::ToMacAddress
[+] INetAdapter::HasDHCP
[+] INetAdapter::GetMTU
2023-10-24 19:12:47 +01:00

56 lines
1.4 KiB
C++

/***
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;
AuArray<AuUInt8, 8> ToMacAddress() override;
bool HasDHCP() override;
AuUInt32 GetMTU() 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;
bool dhcp {};
AuArray<AuUInt8, 8> mac;
AuUInt32 mtu;
AuList<IPAddress> dns;
AuUInt16 index {};
};
}