X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Ficmp.c;h=5d53cc6c42db4ec61705a65d815ec59989e4cb62;hb=0f48b41ce8edd3b6d549d641b35901e4b51a5132;hp=4eb4fa408b81c3effb88a31c70c84bb0a6c2ca76;hpb=04b368645c34cc3853fc13f93e33ac7878be8479;p=tpg%2Facess2.git diff --git a/Modules/IPStack/icmp.c b/Modules/IPStack/icmp.c index 4eb4fa40..5d53cc6c 100644 --- a/Modules/IPStack/icmp.c +++ b/Modules/IPStack/icmp.c @@ -3,11 +3,12 @@ * - ICMP Handling */ #include "ipstack.h" +#include "ipv4.h" #include "icmp.h" // === PROTOTYPES === void ICMP_Initialise(); -void ICMP_GetPacket(tInterface *Interface, int Length, void *Buffer); +void ICMP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer); // === GLOBALS === @@ -18,7 +19,7 @@ void ICMP_GetPacket(tInterface *Interface, int Length, void *Buffer); */ void ICMP_Initialise() { - + IPv4_RegisterCallback(IP4PROT_ICMP, ICMP_GetPacket); } /** @@ -27,6 +28,11 @@ void ICMP_Initialise() */ void ICMP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer) { - //tICMPHeader *hdr = Buffer; + tICMPHeader *hdr = Buffer; + Log("[ICMP ] hdr->Type = %i", hdr->Type); + Log("[ICMP ] hdr->Code = %i", hdr->Code); + Log("[ICMP ] hdr->Checksum = 0x%x", ntohs(hdr->Checksum)); + Log("[ICMP ] hdr->ID = 0x%x", ntohs(hdr->ID)); + Log("[ICMP ] hdr->Sequence = 0x%x", ntohs(hdr->Sequence)); }