2022-12-14 20:08:52 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: AuNetAdapter.cpp
|
|
|
|
Date: 2022-11-14
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#include "Networking.hpp"
|
|
|
|
#include "AuNetAdapter.hpp"
|
|
|
|
#include "AuNetAdapter.hpp"
|
|
|
|
|
|
|
|
namespace Aurora::IO::Net
|
|
|
|
{
|
2023-12-10 15:42:04 +00:00
|
|
|
const AuString &NetAdapter::GetName()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->name.empty() ? this->device : this->name;
|
|
|
|
}
|
|
|
|
|
2024-04-01 05:05:30 +00:00
|
|
|
const IPAddress &NetAdapter::GetSubnetMask()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->subnet;
|
|
|
|
}
|
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
const AuString &NetAdapter::GetDevice()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->device;
|
|
|
|
}
|
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
ENetworkAdapterType NetAdapter::GetAdapterType()
|
2023-12-01 12:11:54 +00:00
|
|
|
{
|
|
|
|
return this->eNetworkType;
|
|
|
|
}
|
|
|
|
|
2024-04-01 05:05:30 +00:00
|
|
|
ENetworkAdapterStatus NetAdapter::GetAdapterStatus()
|
2023-12-01 12:11:54 +00:00
|
|
|
{
|
|
|
|
return this->eNetworkStatus;
|
|
|
|
}
|
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
EIPProtocol NetAdapter::GetFamily()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->address.ip;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuUInt16 NetAdapter::GetIndex()
|
|
|
|
{
|
|
|
|
return this->index;
|
|
|
|
}
|
|
|
|
|
2024-04-01 05:05:30 +00:00
|
|
|
const IPAddress &NetAdapter::GetAddress()
|
|
|
|
{
|
|
|
|
return this->address;
|
|
|
|
}
|
|
|
|
|
|
|
|
const IPAddress &NetAdapter::GetBroadcastAddress()
|
|
|
|
{
|
|
|
|
return this->broadcast;
|
|
|
|
}
|
|
|
|
|
|
|
|
const IPAddress &NetAdapter::GetAnycastAddress()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->anycast;
|
|
|
|
}
|
|
|
|
|
2024-04-01 05:05:30 +00:00
|
|
|
const IPAddress &NetAdapter::GetGateway()
|
2022-12-14 20:08:52 +00:00
|
|
|
{
|
|
|
|
return this->gateway;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuList<IPAddress> NetAdapter::GetDNS()
|
|
|
|
{
|
|
|
|
return this->dns;
|
|
|
|
}
|
2023-10-24 18:12:47 +00:00
|
|
|
|
2023-12-10 15:42:04 +00:00
|
|
|
AuArray<AuUInt8, 8> NetAdapter::GetMacAddress()
|
2023-10-24 18:12:47 +00:00
|
|
|
{
|
|
|
|
return this->mac;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NetAdapter::HasDHCP()
|
|
|
|
{
|
|
|
|
return this->dhcp;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuUInt32 NetAdapter::GetMTU()
|
|
|
|
{
|
|
|
|
return this->mtu;
|
|
|
|
}
|
2023-12-01 13:22:44 +00:00
|
|
|
|
|
|
|
AuUInt64 NetAdapter::GetTransmitBytesPerSec()
|
|
|
|
{
|
|
|
|
return this->uTransmitBytesPerSec;
|
|
|
|
}
|
|
|
|
|
|
|
|
AuUInt64 NetAdapter::GetReceiveBytesPerSec()
|
|
|
|
{
|
|
|
|
return this->uReceiveBytesPerSec;
|
|
|
|
}
|
2022-12-14 20:08:52 +00:00
|
|
|
}
|