![]() |
SendInformation() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: ICMPSocket.h |
BOOL SendInformation( LPCSTR lpDestinationAddress, BOOL bReply, unsigned short usIdentifier, unsigned short usSequence);
Send ICMP messages according to the name
try { LPICMPHeader lpHead; lpHead=ConstructICMP(); if (!lpHead) { ReportError("SendInformation","Failed to construct ICMP header!"); return FALSE; } //Check if echo or reply if (bReply) lpHead->ICMPType=ICMP_Information_Reply; else lpHead->ICMPType=ICMP_Information; lpHead->ICMPCode=0; lpHead->sICMP.sUS.us1=htons(usIdentifier); lpHead->sICMP.sUS.us2=htons(usSequence); //And the checksum //Using only first 8 bytes lpHead->ICMPChecksum=CalculateChecksum((unsigned short*)lpHead,ICMP_Information_SIZE); //Send it BOOL bSend; bSend=CSpoofSocket::Send(lpDestinationAddress,(char*)lpHead,ICMP_Information_SIZE); //Clear up delete lpHead; return bSend; } ERROR_HANDLER_RETURN("SendTimestamp",FALSE)
![]() |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |