![]() |
GetInformation() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: ICMPCrafter.h |
char * GetInformation( BOOL bReply, unsigned short usIdentifier, unsigned short usSequence, unsigned short& usTotalSize) const;
Get the memory for the following ICMP types
try { //Create the header LPICMPHeader lpHead; lpHead=ConstructICMP(); if (!lpHead) { ReportError("GetInformation","Failed to construct ICMP header!"); return FALSE; } //Protect it std::auto_ptr<ICMPHeader> pProtection(lpHead); //Check if echo or reply if (bReply) lpHead->ucICMPType=ICMP_Information_Reply; else lpHead->ucICMPType=ICMP_Information; lpHead->ucICMPCode=0; lpHead->sICMP.sUS.us1=htons(usIdentifier); lpHead->sICMP.sUS.us2=htons(usSequence); //And the checksum //Using only first 8 bytes lpHead->usICMPChecksum=CalculateChecksum((unsigned short*)lpHead,ICMP_Information_SIZE); //Create the packet return CreateFinal(lpHead, usTotalSize); } ERROR_HANDLER_RETURN("GetInformation",NULL)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |