| 339 | } |
| 340 | |
| 341 | bool NetAdapter::InternalServerRecv(NetPacket* pkt) |
| 342 | { |
| 343 | IP_Payload* ippay; |
| 344 | ippay = dhcpServer.Recv(); |
| 345 | if (ippay != nullptr) |
| 346 | { |
| 347 | IP_Packet* ippkt = new IP_Packet(ippay); |
| 348 | ippkt->destinationIP = {{{255, 255, 255, 255}}}; |
| 349 | ippkt->sourceIP = internalIP; |
| 350 | EthernetFrame frame(ippkt); |
| 351 | frame.sourceMAC = internalMAC; |
| 352 | frame.destinationMAC = ps2MAC; |
| 353 | frame.protocol = static_cast<u16>(EtherType::IPv4); |
| 354 | frame.WritePacket(pkt); |
| 355 | InspectRecv(pkt); |
| 356 | return true; |
| 357 | } |
| 358 | |
| 359 | ippay = dnsServer.Recv(); |
| 360 | if (ippay != nullptr) |
| 361 | { |
| 362 | IP_Packet* ippkt = new IP_Packet(ippay); |
| 363 | ippkt->destinationIP = ps2IP; |
| 364 | ippkt->sourceIP = internalIP; |
| 365 | EthernetFrame frame(ippkt); |
| 366 | frame.sourceMAC = internalMAC; |
| 367 | frame.destinationMAC = ps2MAC; |
| 368 | frame.protocol = static_cast<u16>(EtherType::IPv4); |
| 369 | frame.WritePacket(pkt); |
| 370 | InspectRecv(pkt); |
| 371 | return true; |
| 372 | } |
| 373 | |
| 374 | return false; |
| 375 | } |
| 376 | |
| 377 | bool NetAdapter::InternalServerSend(NetPacket* pkt) |
| 378 | { |
nothing calls this directly
no test coverage detected