Update AW.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2022-03-23 11:44:53 +00:00
parent 49885bbecb
commit 661de9972d
3 changed files with 15 additions and 0 deletions

View file

@ -35,6 +35,7 @@ set(SOURCE_FILES
Tfe/tfesupp.cpp
Tfe/NetworkBackend.cpp
Tfe/PCapBackend.cpp
Tfe/IPRaw.cpp
Debugger/Debug.cpp
Debugger/Debugger_Help.cpp
@ -124,6 +125,7 @@ set(HEADER_FILES
Tfe/tfesupp.h
Tfe/NetworkBackend.h
Tfe/PCapBackend.h
Tfe/IPRaw.h
Uthernet1.h
Uthernet2.h

View file

@ -200,4 +200,15 @@ bool SlirpBackend::isValid()
return true;
}
void SlirpBackend::getMACAddress(const uint32_t address, MACAddress & mac)
{
// a bit of a hack, I've found out that slirp uses
/* emulated hosts use the MAC addr 52:55:IP:IP:IP:IP */
// https://gitlab.freedesktop.org/slirp/libslirp/-/blob/bf917b89d64f57d9302aba4b2f027ea68fb78c13/src/slirp.c#L78
mac.address[0] = 0x52;
mac.address[1] = 0x55;
uint32_t * ptr = reinterpret_cast<uint32_t *>(mac.address + 2);
*ptr = address;
}
#endif

View file

@ -30,6 +30,8 @@ public:
void update(const ULONG nExecutedCycles) override;
bool isValid() override;
void getMACAddress(const uint32_t address, MACAddress & mac) override;
void sendToGuest(const uint8_t *pkt, int pkt_len);
int addPoll(const int fd, const int events);