ios/net/ip/top: introduce a helper to write ip addr (quiets warning)

This commit is contained in:
Shawn Hoffman 2017-06-07 04:22:07 -07:00
parent 4a1b32afe4
commit 8f12d7fb3c
1 changed files with 8 additions and 3 deletions

View File

@ -76,6 +76,11 @@ NetIPTop::~NetIPTop()
#endif
}
static constexpr u32 inet_addr(u8 a, u8 b, u8 c, u8 d)
{
return (static_cast<u32>(a) << 24) | (static_cast<u32>(b) << 16) | (static_cast<u32>(c) << 8) | d;
}
static int inet_pton(const char* src, unsigned char* dst)
{
int saw_digit, octets;
@ -818,9 +823,9 @@ IPCCommandResult NetIPTop::HandleGetInterfaceOptRequest(const IOCtlVRequest& req
case 0x4003: // ip addr table
Memory::Write_U32(0xC, request.io_vectors[1].address);
Memory::Write_U32(10 << 24 | 1 << 8 | 30, request.io_vectors[0].address);
Memory::Write_U32(255 << 24 | 255 << 16 | 255 << 8 | 0, request.io_vectors[0].address + 4);
Memory::Write_U32(10 << 24 | 0 << 16 | 255 << 8 | 255, request.io_vectors[0].address + 8);
Memory::Write_U32(inet_addr(10, 0, 1, 30), request.io_vectors[0].address);
Memory::Write_U32(inet_addr(255, 255, 255, 0), request.io_vectors[0].address + 4);
Memory::Write_U32(inet_addr(10, 0, 255, 255), request.io_vectors[0].address + 8);
break;
case 0x4005: // hardcoded value