+
+ // -- 3: Destination Unreachable
+ case ICMP_UNREACHABLE:
+ switch(hdr->Code)
+ {
+ case 3: // Port Unreachable
+ Log_Debug("ICMPv4", "Destination Unreachable (Port Unreachable)");
+ break;
+ default:
+ Log_Debug("ICMPv4", "Destination Unreachable (Code %i)", hdr->Code);
+ break;
+ }
+// IPv4_Unreachable( Interface, hdr->Code, htons(hdr->Length)-sizeof(tICMPHeader), hdr->Data );
+ break;
+
+ // -- 8: Echo Request
+ case ICMP_ECHOREQ:
+ if(hdr->Code != 0) {
+ Log_Warning("ICMPv4", "Code == %i for ICMP Echo Request, should be 0", hdr->Code);
+ return ;
+ }
+ //Log_Debug("ICMPv4", "Replying");
+ hdr->Type = ICMP_ECHOREPLY;
+ hdr->Checksum = 0;
+ hdr->Checksum = htons( IPv4_Checksum( (Uint16*)hdr, Length/2 ) );
+ //Log_Debug("ICMPv4", "Checksum = 0x%04x", hdr->Checksum);
+ IPv4_SendPacket(Interface, *(tIPv4*)Address, 1, ntohs(hdr->Sequence), Length, hdr);
+ break;
+ default:
+ break;