2022-12-14 20:08:52 +00:00
|
|
|
/***
|
|
|
|
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
|
|
|
|
{
|
2023-12-10 15:42:04 +00:00
|
|
|
const AuString &GetName() override;
|
|
|
|
const AuString &GetDevice() override;
|
2022-12-14 20:08:52 +00:00
|
|
|
|
|
|
|
AuUInt16 GetIndex() override;
|
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
EIPProtocol GetFamily() override;
|
2022-12-14 20:08:52 +00:00
|
|
|
|
2024-04-01 05:41:51 +00:00
|
|
|
EAdapterType GetAdapterType() override;
|
|
|
|
EAdapterStatus GetAdapterStatus() override;
|
2023-12-01 12:11:54 +00:00
|
|
|
|
2024-04-14 19:11:08 +00:00
|
|
|
AuOptional<const IPAddress &> GetAddress() override;
|
|
|
|
AuOptional<const IPAddress &> GetBroadcastAddress() override;
|
|
|
|
AuOptional<const IPAddress &> GetAnycastAddress() override;
|
|
|
|
AuOptional<const IPAddress &> GetSubnetMask() override;
|
|
|
|
AuOptional<const IPAddress &> GetGateway() override;
|
2022-12-14 20:08:52 +00:00
|
|
|
|
2024-04-01 05:44:20 +00:00
|
|
|
const AuList<IPAddress> &GetDNS() override;
|
2022-12-14 20:08:52 +00:00
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
AuArray<AuUInt8, 8> GetMacAddress() override;
|
2023-10-24 18:12:47 +00:00
|
|
|
|
|
|
|
bool HasDHCP() override;
|
|
|
|
|
|
|
|
AuUInt32 GetMTU() override;
|
2023-12-01 13:22:44 +00:00
|
|
|
AuUInt64 GetTransmitBytesPerSec() override;
|
|
|
|
AuUInt64 GetReceiveBytesPerSec() override;
|
2023-10-24 18:12:47 +00:00
|
|
|
|
2022-12-14 20:08:52 +00:00
|
|
|
// 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;
|
2024-04-14 19:11:08 +00:00
|
|
|
AuOptional<IPAddress> address;
|
|
|
|
AuOptional<IPAddress> broadcast;
|
|
|
|
AuOptional<IPAddress> anycast;
|
|
|
|
AuOptional<IPAddress> subnet;
|
|
|
|
AuOptional<IPAddress> gateway;
|
2024-04-01 05:41:51 +00:00
|
|
|
EAdapterType eNetworkType { EAdapterType::eUnknown };
|
|
|
|
EAdapterStatus eNetworkStatus { EAdapterStatus::eUp };
|
2023-10-24 18:12:47 +00:00
|
|
|
bool dhcp {};
|
|
|
|
AuArray<AuUInt8, 8> mac;
|
2023-12-01 13:22:44 +00:00
|
|
|
AuUInt64 uTransmitBytesPerSec { 10 * 1000 * 1000 / 8 };
|
|
|
|
AuUInt64 uReceiveBytesPerSec { 10 * 1000 * 1000 / 8 };
|
2023-10-24 18:12:47 +00:00
|
|
|
AuUInt32 mtu;
|
2022-12-14 20:08:52 +00:00
|
|
|
AuList<IPAddress> dns;
|
|
|
|
|
|
|
|
AuUInt16 index {};
|
|
|
|
};
|
|
|
|
}
|