Class CICMPSocket::
SendRedirect()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SendQuenchNext page: SendTime    Show member index
Public Function Declared in:
ICMPSocket.h

'Declaration' icon -- Shortcut to top of page. Declaration

BOOL SendRedirect(
    LPCSTR lpDestinationAddress,
    unsigned char cType,
    LPCSTR lpGatewayAddress);

'Function Body' icon -- Shortcut to top of page. Function Body

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=SendICMP(lpHead,lpDestinationAddress);

    //Clear up
    delete lpHead;

    return bSend;
}
ERROR_HANDLER_RETURN("SendRedirect",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CSpoofSocket  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.