More work on UDI, cleanup and pseudod should now load.
[tpg/acess2.git] / Modules / IPStack / icmp.c
index bd9c05f..5d53cc6 100644 (file)
@@ -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);
 }
 
 /**
@@ -29,4 +30,9 @@ void ICMP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buff
 {
        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));
 }

UCC git Repository :: git.ucc.asn.au