mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 02:38:37 +12:00
Add CELL_NET_CTL_INFO_DHCP_HOSTNAME impl
This commit is contained in:
parent
c13039396c
commit
67378c7dea
3 changed files with 12 additions and 1 deletions
|
@ -103,7 +103,8 @@ np_handler::np_handler()
|
|||
|
||||
bool np_handler::discover_ip_address()
|
||||
{
|
||||
std::array<char, 1024> hostname;
|
||||
hostname.clear();
|
||||
hostname.resize(1024);
|
||||
|
||||
if (gethostname(hostname.data(), hostname.size()) == -1)
|
||||
{
|
||||
|
@ -111,6 +112,8 @@ bool np_handler::discover_ip_address()
|
|||
return false;
|
||||
}
|
||||
|
||||
nph_log.notice("Hostname was determined to be %s", hostname);
|
||||
|
||||
hostent *host = gethostbyname(hostname.data());
|
||||
if (!host)
|
||||
{
|
||||
|
@ -221,6 +224,11 @@ const std::array<u8, 6>& np_handler::get_ether_addr() const
|
|||
return ether_address;
|
||||
}
|
||||
|
||||
const std::string& np_handler::get_hostname() const
|
||||
{
|
||||
return hostname;
|
||||
}
|
||||
|
||||
u32 np_handler::get_local_ip_addr() const
|
||||
{
|
||||
return local_ip_addr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue