78 lines
1.3 KiB
C++
78 lines
1.3 KiB
C++
/***
|
|
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
|
|
{
|
|
const AuString &NetAdapter::ToName()
|
|
{
|
|
return this->name.empty() ? this->device : this->name;
|
|
}
|
|
|
|
IPAddress NetAdapter::ToAddress()
|
|
{
|
|
return this->address;
|
|
}
|
|
|
|
IPAddress NetAdapter::ToBroadcastAddress()
|
|
{
|
|
return this->broadcast;
|
|
}
|
|
|
|
IPAddress NetAdapter::ToSubnetMask()
|
|
{
|
|
return this->subnet;
|
|
}
|
|
|
|
const AuString &NetAdapter::ToDevice()
|
|
{
|
|
return this->device;
|
|
}
|
|
|
|
EIPProtocol NetAdapter::ToFamily()
|
|
{
|
|
return this->address.ip;
|
|
}
|
|
|
|
AuUInt16 NetAdapter::GetIndex()
|
|
{
|
|
return this->index;
|
|
}
|
|
|
|
IPAddress NetAdapter::ToAnycastAddress()
|
|
{
|
|
return this->anycast;
|
|
}
|
|
|
|
IPAddress NetAdapter::ToGateway()
|
|
{
|
|
return this->gateway;
|
|
}
|
|
|
|
AuList<IPAddress> NetAdapter::GetDNS()
|
|
{
|
|
return this->dns;
|
|
}
|
|
|
|
AuArray<AuUInt8, 8> NetAdapter::ToMacAddress()
|
|
{
|
|
return this->mac;
|
|
}
|
|
|
|
bool NetAdapter::HasDHCP()
|
|
{
|
|
return this->dhcp;
|
|
}
|
|
|
|
AuUInt32 NetAdapter::GetMTU()
|
|
{
|
|
return this->mtu;
|
|
}
|
|
} |