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

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

BOOL SendParameter(
    IP aDestinationAddress,
    unsigned char ucError);

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

try
{
    //Construct the header
    LPICMPHeader lpHead;
    lpHead=ConstructICMP();

    if (!lpHead)
    {
        //Report it
        ReportError("SendParameter","Failed to construct ICMP header!");

        //Exit
        return FALSE;
    }

    //Protect it
    std::auto_ptr<ICMPHeader> pProtection(lpHead);

    //Set the values
    lpHead->ucICMPType=ICMP_Parameter;
    lpHead->ucICMPCode=ICMP_Parameter_ERROR;
    lpHead->sICMP.sUC.uc1=ucError;

    //And the checksum
    lpHead->usICMPChecksum=CalculateChecksum((unsigned short*)lpHead,ICMPHeaderLength);

    //Send it
    BOOL bSend;
    bSend=SendICMP(lpHead,
                   aDestinationAddress);

    //Done
    return bSend;
}
ERROR_HANDLER_RETURN("SendParameter",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 © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003.