| 374 | } |
| 375 | |
| 376 | bool SocketAdapter::SendIP(IP_Packet* ipPkt) |
| 377 | { |
| 378 | if (ipPkt->VerifyChecksum() == false) |
| 379 | { |
| 380 | Console.Error("DEV9: Socket: IP packet with bad CSUM"); |
| 381 | return false; |
| 382 | } |
| 383 | //Do Checksum in sub functions |
| 384 | |
| 385 | ConnectionKey Key{}; |
| 386 | Key.ip = ipPkt->destinationIP; |
| 387 | Key.protocol = ipPkt->protocol; |
| 388 | |
| 389 | std::lock_guard deletelock(deleteRecvSentry); |
| 390 | switch (ipPkt->protocol) //(Prase Payload) |
| 391 | { |
| 392 | case (u8)IP_Type::ICMP: |
| 393 | return SendICMP(Key, ipPkt); |
| 394 | case (u8)IP_Type::IGMP: |
| 395 | return SendIGMP(Key, ipPkt); |
| 396 | case (u8)IP_Type::TCP: |
| 397 | return SendTCP(Key, ipPkt); |
| 398 | case (u8)IP_Type::UDP: |
| 399 | return SendUDP(Key, ipPkt); |
| 400 | default: |
| 401 | //Log_Error("Unkown Protocol"); |
| 402 | Console.Error("DEV9: Socket: Unkown IPv4 Protocol %X", ipPkt->protocol); |
| 403 | return false; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | bool SocketAdapter::SendICMP(ConnectionKey Key, IP_Packet* ipPkt) |
| 408 | { |
nothing calls this directly
no test coverage detected