![]() |
SendRedirect() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: ICMPSocket.h |
BOOL SendRedirect( LPCSTR lpDestinationAddress, unsigned char cType, LPCSTR lpGatewayAddress);
try { LPICMPHeader lpHead; lpHead=ConstructICMP(); if (!lpHead) { ReportError("SendRedirect","Failed to construct ICMP header!"); return FALSE; } lpHead->ICMPType=ICMP_Redirect; lpHead->ICMPCode=cType; lpHead->sICMP.sUL=inet_addr(lpGatewayAddress); //And the checksum lpHead->ICMPChecksum=CalculateChecksum((unsigned short*)lpHead,ICMPHeaderLength); //Send it BOOL bSend; bSend=CSpoofSocket::Send(lpDestinationAddress,(char*)lpHead,ICMPHeaderLength); //Clear up delete lpHead; return bSend; } ERROR_HANDLER_RETURN("SendRedirect",FALSE)
![]() |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |